Skip to main content

Android Intents PART-2

1. Launching the Music Player

 Intent myActivity2 = new Intent("android.intent.action.MUSIC_PLAYER");  
 startActivity(myActivity2);  

2. Playing a song stored in the SD card

 Intent myActivity2 = new Intent(android.content.Intent.ACTION_VIEW);  
 Uri data = Uri.parse("file:///sdcard/test.mp3");  
 String type = "audio/mp3";  
 myActivity2.setDataAndType(data, type);  
 startActivity(myActivity2);  

3. Sending MMS
 Uri uri = Uri.parse("content://media/external/images/media/1");  
 Intent i = new Intent(Intent.ACTION_SEND);  
 i.putExtra("address", "555-1234");  
 i.putExtra("sms_body", "some text message");  
 i.putExtra(Intent.EXTRA_STREAM, uri);  
 i.setType("image/png");  
 startActivity(i);  

4. Sending Email
 Uri uri = Uri.parse("mailto:dhaval0122@gmail.com");  
 Intent myActivity2 = new Intent(Intent.ACTION_SENDTO, uri);  
 myActivity2.putExtra(Intent.EXTRA_SUBJECT, "subject goes here");  
 myActivity2.putExtra(Intent.EXTRA_TEXT,"The email's body goes here");  
 startActivity(myActivity2);  

5. Setting System
 Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);  
 startActivity(intent);  


6. Setting System Locale: Language & Keyboard

 Intent intent = new Intent(android.provider.Settings.ACTION_LOCALE_SETTINGS);  
 startActivity(intent);  

Comments

Popular posts from this blog

Android - Google MAP V2 PART 3 (add Polyline)

Download Full Code  of  PART-1 , 2 , 3 , 4 Before go ahead Please look in to PART-1 & PART-2 I have just modify Main Activity class: package com.djandroid.mapsv2; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap.OnMapClickListener; import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; import com.google.android.gms.maps.model.PolylineOptions; public class MainActivity extends FragmentActivity { private GoogleMap MAP; private boolean markClic...

Android Material Design - 2 (Good bay ActionBar, Hello ToolBar with Navigation Drawer)

hello all, after long time i have update my blog with android material Design theme, i am tying to demonstrate new things which is available with android lollipop. using different example i 'll show you, one sample app with material design which include ToolBar, Floting Actions, Tabs, Cardview, Recycle view. Download full example on  Github . In this example we will take a look at the new Actionbar replacement called Toolbar. It is introduced in Android Lollipop, API level 21 release, and hence it is available to use, out of box for the application that are targeted to 21 and above. However, as always Google provides fully supported Toolbar features to lower android os devices via AppCompact support library. In AppCompat, Toolbar is implemented in the  android.support.v7.widget.Toolbar  class. Pre-requirements: 1. Android Studio 1.0.1 (Latest while writing the post) 2. Appcombat v7 Support librar...

Android - Google MAP V2 PART 4 (Google Map V2 Direction)

Download Full Code  of  PART-1 , 2 , 3 , 4 before go ahead check all articals. Android google map v2 part-1 Android google map v2 part-2 Android google map v2 part-3 for support all Android OS Version I have used  ActionBarSherLock  library. Do not forgate to generate Google MAP API KEY and add Google Play services library . Download Code Note: this code is only work in Android Device not in Android Emulator