Taking a Picture with Camera (using built-in intent)

This example shows you easiest way to instruct Android to run Camera app (comes with android system) to take a photo and returns. import needed for this to work: import java.io.File;   import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; private constants & variable uses in the class: private static int […]

Some Android built-in Intents

Examples of how to use some Android built-in intents. public static void invokeWebBrowser(Activity activity) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.google.com")); activity.startActivity(intent); } public static void invokeWebSearch(Activity activity) { Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); intent.setData(Uri.parse("http://www.google.com")); activity.startActivity(intent); } public static void dial(Activity activity) { Intent intent = new Intent(Intent.ACTION_DIAL); activity.startActivity(intent); }   public static void call(Activity […]

Android: Some Common Intents

//Email Intent allow you launch android email program to send an email Intent i = new Intent(Intent.ACTION_SEND); //i.setType("text/plain"); //use this line for testing in the emulator i.setType("message/rfc822") ; // use from live device i.putExtra(Intent.EXTRA_EMAIL, new String[]{"test@gmail.com"}); i.putExtra(Intent.EXTRA_SUBJECT,"subject goes here"); i.putExtra(Intent.EXTRA_TEXT,"body goes here"); startActivity(Intent.createChooser(i, "Select email application."));