Tuesday, July 23, 2013

Show your Android device on a Computer

With Droid@Screen you can easily show the screen of an Android device on a computer/laptop (PC, Mac, Linux, ...) and then project the desktop using a LCD-projector. Droid@Screen is used for training/teaching and demonstration purposes.

We can  scale the device to fit to your PC size.
We can show multiple devices and view their properties.
We can easily take snapshots and Continuously record screenshots and can save them to directory.


Official Site : http://droid-at-screen.ribomation.com/

Monday, July 22, 2013

Android: Put CheckBox & URL In a AlertBox



Create a custom view and the view to AlertDialogBox to get.

Initialize CheckBox, TextView.
add both the views to layout.
Then add the layout to the alertDialog setView.
Run your code and check :)

For URL in alert box, have setMovementMethod(LinkMovementMethod.getInstance()) to the TextView, so that we can have action for the text.


<string name="url">Accept Google Link <a href="http://www.google.com"> Click Here </a></string>

public void callAlertBox() {

       CheckBox checkBox = new CheckBox(this);

       TextView textView = new TextView(this);
       textView.setMovementMethod(LinkMovementMethod.getInstance());
       textView.setText(R.string.url);

       LinearLayout checkBoxLayout = new LinearLayout(this);
       checkBoxLayout.setLayoutParams(new LinearLayout.LayoutParams(
                     LinearLayout.LayoutParams.MATCH_PARENT,
                     LinearLayout.LayoutParams.MATCH_PARENT));

       checkBoxLayout.addView(checkBox);
       checkBoxLayout.addView(textView);

       AlertDialog.Builder altDialog = new AlertDialog.Builder(this);
       altDialog.setView(checkBoxLayout);
       altDialog.setMessage("Check Box & URL in Alert Box");
       altDialog.setPositiveButton("OK",
              new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                                                                     Toast.makeText(getApplicationContext(), "Ok button Pressed", Toast.LENGTH_SHORT).show();
                     }
              });
       altDialog.setNegativeButton("Canceel",
              new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                                         dialog.dismiss();
                     }
              });

       altDialog.show();
}

Output: