Source : https://medium.com/@cketti/android-sending-email-using-intents-3da63662c58f#.ug8c5jq9s
Thanks to https://medium.com/@cketti
Many things on Android are as easy as starting an Activity using the right Intent. Sending an email to a specific recipient is one of those things.
Sadly, there is much bad advice out there on how to send emails using Intents. Because I write an open source email app I have a pretty good understanding of what goes on behind the scenes. That’s why I believe I know better than all those other people
Android Studio have many keyboard shortcuts that helps developers to develop android application. Let me show you some of the shortcuts for android studio for Mac user.
|Android Studio Command Type||Mac OS X Shortcuts|
|Reformat code||OPTION + CMD + L|
|Show selected API documentation||F1 / FUNCTION + F1|
|Generate Source Code||CMD + N|
|Jump to source||CMD + DOWN ARROW KEY|
|Delete Line||CMD + BACKSPACE|
|Search by symbol name||OPTION + CMD + O|
|Build||CMD + F9|
|Build and Run||CTRL + R|
|Toggle Project Sidebar Visibility||CMD + 1|
|Open Class||CMD + O|
|Open File ( including resources)||CMD + SHIFT + O|
|Recent Files Opened||CMD + E|
|Recently edited files||CMD + SHIFT + E|
|Previous Next/Previous Error||F2 / FUNCTION F2|
|Last Edited Location||CMD + SHIFT + BACKSPACE|
|Last Location||CMD + [ and CMD + ]|
|Go to Declaration||CMD + B|
|Go to Super||CMD + Y|
|Next Word Navigation||ALT + LEFT/RIGHT ARROW KEY|
|Find||CMD + F|
|Find in Path||SHIFT + CMD + F|
|Refactor Class, Method||CTRL + T|
Now I’m using Android Studio to develop Android Application. Eclipse not good enough for me to develop android application, sorry to say especially for eclipse’s fans (Because Eclipse ever delete all my folders inside the workspace folder for no reason – not only once). And also Eclipse 3.6 (Helios) is no longer supported with the latest version of ADT (Check Here). With Android Studio, you can easily import library with Gradle with simple way.
So I will share you about Android Studio have many shortcut / tips to help you develop Android Application. Here tips of the day From Philippe Breault (Thanks to him) and here the Wiki that collects all current tips from him (on Pavlos Petros Tournaris’s Github -Thanks to Pavlos-Petros Tournaris) Or maybe you can visit Developerphil’s Website Part 1, Part 2, Part 3, Part 4, Part 5, Part 6 and also you can see every day Android Studio tips from Philippe Breault’s Google+).
Cheers guys and happy coding
We all know we cannot just pass object references to activities or fragments, we must put those in an Intent / Bundle. We only have two options, with Parcelable or Serializable. How about the performance / speed?
Here the results:
Serializable: 1.0004ms, Parcelable: 0.0850ms – 10.16x improvement.
Serializable: 1.8539ms – Parcelable: 0.1824ms – 11.80x improvement.
Serializable: 5.1224ms – Parcelable: 0.2938ms – 17.36x improvement.
Source By : http://www.developerphil.com/parcelable-vs-serializable/
Thanks to Philippe Breault.
And here the Source to download
One time I develop an application that requires trigger a notification every specific time. Then I create Alarm Manager for trigger Android Notification, but i got my Alarm Manager firing random time after first notification. So my notification sometimes show at random time.
// Example now date + 7 day
Date now = new date();
calendar = Calendar.getInstance();
myIntent = new Intent(mContext, MyReceiver.class);
pendingIntent = PendingIntent.getBroadcast(mContext, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC, calendar.getTimeInMillis(), pendingIntent);
If we code inside an Activity and we need the application context we can use getApplicationContext().
Inside an Activity we can use getApplicationContext() if we need the application context. But what if we are not inside an Activity and we need that? I will explain how you can get the context of the application outside an Activity with simple coding.
Once time, I make android application and requires pull data from web servers (Json). And then i do HttpGET to load the data from web server (big enough), after that i must insert the data into database. It takes 12-15 minutes WTF.., how can i used the application if it takes so long?
Then i found Jackson Library And Use Bulk Insert after that it takes only 10 – 15 seconds. Very Amazing