Skip to main content

Posts

Showing posts from December, 2011

Share data android

 Intent msg = new Intent(Intent.ACTION_SEND);  String[] recipients = { "" }; // this.is@recipient.com   String[] carbonCopies = { "" }; // hey.another@recipient.   msg.putExtra(Intent.EXTRA_EMAIL, recipients);   msg.putExtra(Intent.EXTRA_CC, carbonCopies);  msg      .putExtra(        Intent.EXTRA_TEXT,        "your text");   // Change from ApplicationStep class subject line     // Html.   msg.putExtra(Intent.EXTRA_SUBJECT, ApplicationStep.EMAIL_SUBJECT);     msg.putExtra(Intent.EXTRA_STREAM, Uri.parse(sUri)); // attachment    msg.setType("image/png");   startActivity(Intent.createChooser(msg,      "Please choose an email client"));

Get ImageFile form server and Store onto Device's memory and display it

public class DataStoreActivity extends Activity {     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //setContentView(R.layout.main);         DownloadFile(" i mage file path www.");         byte b[] = readInternalStoragePrivate("download.jpg");                 Bitmap bmp = BitmapFactory.decodeByteArray(b, 0, b.length);                 ImageView imageView = new ImageView(this);         imageView.setImageBitmap(bmp);         setContentView(imageView);   ...

Simple Android Audio record Example Android

public class AudioRecorder { final MediaRecorder recorder = new MediaRecorder(); public void start() throws IOException { recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(sdCardPath+ "/xyz.3gp "); recorder.prepare(); recorder.start(); } public void stop() throws IOException { recorder.stop(); recorder.release(); } }

ProgressDialog in android

ProgressDialog progressDialog = null ;     // ...     progressDialog = ProgressDialog . show ( this , "Please wait..." , true );     new Thread () {         public void run () {             try {                   // Grab your data                                                             } catch ( Exception e ) { }             // When grabbing data is finish: Dismiss your Dialog             progressDialog . dismiss ();         }     }. start ();

ProgressDialog using Handler Use

Step 1: Create Global Handler Class. private EventHandler mEventHandler = new EventHandler(); class EventHandler extends Handler { int tempMsg = 0; @Override public void handleMessage(Message msg) { try { switch (msg.what) { case 1: // call method whatever you want. break; dialog.dismiss(); } catch (Exception e) { Log.d("XReader", "Error in " + e.getMessage()); } } }; step2: call Hender using Msg ProgressDialog dialog = ProgressDialog.show(XReaderActivity.this, "", "Please wait",true); Message message = new Message(); message.what = 1; mEventHandler.sendMessage(message);

ESRI using Eclipse setup guide

Please follow these steps to install the ArcGIS for Android 1.0 Beta Eclipse plug-ins: 1. Start Eclipse, then select Help > Install New Software.... 2. In the top-right corner, Click Add. 3. In the Add Repository dialog that appears, enter “ArcGIS Android” for the Name and the following URL for the Location: http://downloads.esri.com/software/arcgis/android 4. In the Available Software dialog, select the checkbox next to ArcGIS for Android and click Next. 5. In the next window, you'll see two plug-ins to be installed. Click Next. 6. Display the License text by clicking on "IMPORTANT-READ CAREFULLY". Read the license text, then click the radio button to accept the license agreements, then click Finish. 7. When the installation completes, restart Eclipse. * Notes for users of ArcGIS for Android Early Adopter release only If you had installed the plug-ins for the ArcGIS for Android Early Adopter release, please refer to the Help for ArcGIS API for Android ...

Hw to use android:layout_weight

Use android : layout_weight < LinearLayout         android : orientation = "vertical" android : layout_width = "fill_parent"         android : layout_height = "fill_parent" android : weightSum = "100"         xmlns : android = "http://schemas.android.com/apk/res/android" >         < LinearLayout             android : layout_width = "fill_parent" android : layout_height = "wrap_content"             android : layout_weight = "70" >         < /LinearLayout>         <LinearLayout android:id="@+id/ widget32 " android:orientation=" horizontal "             android:layout_weight=" 30 " android:layout_width=" fill_parent "             android:layout_height=" wrap_content ">         </LinearLay...