Dynamically Create View Elements - Android Example
Create Notification Alert - Android Example
Skew Or Bind Image On SDCARD - Android Example
Swipe screen left right top bottom
Create Repeating Alarm Start After Each 2 Minutes
In this example creating a date picker to pick day month year of date.
Time Picker With AM_PM Values - Android Example
Time Picker Basics Part 1 - Android Example
In this example getting registered email Accounts in android phone.
Getting primary(google) mail account and all registered acconts. Showing accounts on screen.
This android example will work in real device.
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
Call getAccounts() method from AccountManager class to get all registered email accounts on android phone.
import android.os.Bundle; import android.accounts.Account; import android.accounts.AccountManager; import android.app.Activity; import android.util.Log; import android.widget.TextView; public class RegisteredEmailAccounts extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.registered_email_account); final TextView accountsData = (TextView) findViewById(R.id.accounts); String possibleEmail=""; try{ possibleEmail += "************* Get Registered Gmail Account *************nn"; Account[] accounts = AccountManager.get(this).getAccountsByType("com.google"); for (Account account : accounts) { possibleEmail += " --> "+account.name+" : "+account.type+" , n"; possibleEmail += " nn"; } } catch(Exception e) { Log.i("Exception", "Exception:"+e) ; } try{ possibleEmail += "**************** Get All Registered Accounts *****************nn"; Account[] accounts = AccountManager.get(this).getAccounts(); for (Account account : accounts) { possibleEmail += " --> "+account.name+" : "+account.type+" , n"; possibleEmail += " n"; } } catch(Exception e) { Log.i("Exception", "Exception:"+e) ; } // Show on screen accountsData.setText(possibleEmail); Log.i("Exception", "mails:"+possibleEmail) ; } }