ANDROID AND JELLYBEAN TIPS AND TRICKSFaisal Abid   @faisalabid              www.faisalabid.com
WHO AM I? • Software developer working with Android since 	 	 the beta days • Started working in Node.js and Coffeescript ...
ABOUT THIS TALK • Learn some of the tips and tricks I’ve learnt over the years • Working at Kobo and building an Android t...
1. AppStackNavigation • Up and Back are two different things now. As if things 		 	 weren’t bad enough. • Up means going u...
2. Getting Media Thumbnails • Getting thumbnails from Android videos is very weird. • ICS’s new MediaMetadataRetriever mak...
3. Set Alarm Programmatically • I honestly had no idea you could do this! • Set an alarm programmatically. Not an AlarmMan...
4. Handle Bitmap OOM Errors • Lots and lots of ways exist. • Tried many solutions • This one worked the bestFaisal Abid   ...
5. Handling Awesome progress animations • I love progress loaders. Really set the app apart • WhereIsMyBus has a cool prog...
6. ActivityAnimations • Simple but cool. In Jellybean Android added 	 new activity animation. • Take advantage of them!Fai...
7. Animation keeps getting better • With Project Butter. Android Animation keeps getting 		 	 better. • Use the built-in ....
8. ContentProvider with custom methods! • Honeycomb introduced this. • Not widely known. • call() you can add all the cool...
9. Monkey • Still not used as much as you should • Simple as running monkeyrunner.Faisal Abid   @faisalabid              w...
10. Async Tasks have changed! • ICS, AsyncTasks run in a single threaded threadpool now. • To change it run it on an execu...
11. Security Changes to Android • More of a PSA • Soon android users will be required to allow the app to 		 	 Read SD car...
11.5. More security changes • As of Android 3.1, no BroadcastReceiver will work until 		 	 the user has manually launched ...
THANK YOU!Faisal Abid   @faisalabid              www.faisalabid.com
Upcoming SlideShare
Loading in …5
×

FITC 2012 Jellybean Tips and Tricks

416 views

Published on

FITC 2012 Jellybean Tips and Tricks

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
416
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

FITC 2012 Jellybean Tips and Tricks

  1. 1. ANDROID AND JELLYBEAN TIPS AND TRICKSFaisal Abid @faisalabid www.faisalabid.com
  2. 2. WHO AM I? • Software developer working with Android since the beta days • Started working in Node.js and Coffeescript for the past year. • Software Engineer at Kobo • Co-Author Flex 3 in Action • Entrepreneur, Author, Teacher & DeveloperFaisal Abid @faisalabid www.faisalabid.com
  3. 3. ABOUT THIS TALK • Learn some of the tips and tricks I’ve learnt over the years • Working at Kobo and building an Android tablet, you pick up on a few cool things. • I want to share these things with you!Faisal Abid @faisalabid www.faisalabid.com
  4. 4. 1. AppStackNavigation • Up and Back are two different things now. As if things weren’t bad enough. • Up means going up to the next page in the app. • Back means going back irrespective of where you are. • You can control this stuff in code but it gets messy. • Android Jellybean introduces the new ParentActivity tag in the manifestFaisal Abid @faisalabid www.faisalabid.com
  5. 5. 2. Getting Media Thumbnails • Getting thumbnails from Android videos is very weird. • ICS’s new MediaMetadataRetriever makes it easy private Bitmap getThumbnailForVideoUri(Context cx, Uri contentURI) { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); try { retriever.setDataSource(cx, contentURI); return retriever.getFrameAtTime(); } catch (Exception e) { // exception } }Faisal Abid @faisalabid www.faisalabid.com
  6. 6. 3. Set Alarm Programmatically • I honestly had no idea you could do this! • Set an alarm programmatically. Not an AlarmManager alarm, but an actual alarm. Intent i = new Intent(AlarmClock.ACTION_SET_ALARM);Faisal Abid @faisalabid www.faisalabid.com
  7. 7. 4. Handle Bitmap OOM Errors • Lots and lots of ways exist. • Tried many solutions • This one worked the bestFaisal Abid @faisalabid www.faisalabid.com
  8. 8. 5. Handling Awesome progress animations • I love progress loaders. Really set the app apart • WhereIsMyBus has a cool progress loader • AnimationDrawable will give you OOM. • AnimationDrawable loves to load up all the items in memory. • Solution is by “Yar” from StackOverFlow http://bit.ly/OsGSsbFaisal Abid @faisalabid www.faisalabid.com
  9. 9. 6. ActivityAnimations • Simple but cool. In Jellybean Android added new activity animation. • Take advantage of them!Faisal Abid @faisalabid www.faisalabid.com
  10. 10. 7. Animation keeps getting better • With Project Butter. Android Animation keeps getting better. • Use the built-in .animate() class to get full performance. • No need to learn OpenGL or anything else for trivial animations.Faisal Abid @faisalabid www.faisalabid.com
  11. 11. 8. ContentProvider with custom methods! • Honeycomb introduced this. • Not widely known. • call() you can add all the cool stuff you want. • Built system wide image cache on the Arc.Faisal Abid @faisalabid www.faisalabid.com
  12. 12. 9. Monkey • Still not used as much as you should • Simple as running monkeyrunner.Faisal Abid @faisalabid www.faisalabid.com
  13. 13. 10. Async Tasks have changed! • ICS, AsyncTasks run in a single threaded threadpool now. • To change it run it on an executor.Faisal Abid @faisalabid www.faisalabid.com
  14. 14. 11. Security Changes to Android • More of a PSA • Soon android users will be required to allow the app to Read SD card. • Read_External_storage is a good permission to have, Start thinking about it. • You’ll get a filenotfound exception if you don’t have it. • If you have Write_External_storage you are goodFaisal Abid @faisalabid www.faisalabid.com
  15. 15. 11.5. More security changes • As of Android 3.1, no BroadcastReceiver will work until the user has manually launched an activityFaisal Abid @faisalabid www.faisalabid.com
  16. 16. THANK YOU!Faisal Abid @faisalabid www.faisalabid.com

×