Tricks & Tips

Any small tips, hints, or tricks will be noted here for references.

1. Setting button colors

2. Add external JAR files to use in Android project

3. Activity without Title bar

4. Display application in full-screen

5. Retrieve list of installed applications

6. Launch an activity

7. Get screen resolution (in pixels)

8. Get XY-coordinates when touch on screen

9. Check network availability

10. Caching View using View.tag mechanism

11. Retrieve monitor screen resolution (more)

12. Passing complex data structure to Intent

13. Locate Android virtual devices settings and images

14. Query emulator/device instances

15. Push files/directories into devices

16. Get files from devices

17. Create floating view using FrameLayout

18. Emulator file management (using DDMS)

19. Capture Emulator Screen (using DDMS)

20. Animation for sliding from left to right

21. Animation for sliding from right to left

22. A custom scrollable image view

23. Check if SIM card available on device

24. Get current directory

25. Check whether SD Card is mounted or not

26. Handle hard-key MENU long press event

27. Simulate a call from/to emulator (using telnet)

28. Connect to a specific device in Monkey script

29. Sending messages among devices

30. Check if droid can handle PDF file

31. ImageView alignment trick

32. Auto-close dialog after a specific time

33. Detect layout type (landscape/portrait)

34. Set icon for Android application

35. ListView doesn’t respond to OnItemClickListener

36. APK is just a packed ZIP file

37. Multiple instances of the same activity are created

38. ListView in one activity doesn’t refresh data sending another activity

39. Set line-break in TextView

40. Remove scrollbars while scrolling the view

41. Load WebView with ProgressDialog

42. Get Window Status Bar and Title Bar Height Size

43. Copy Bitmap object to avoid references

44. The less-known over screen orientation

45. Colorizing the Title Bar

46. Set Phone Ringer Mode

47. Get SIM card number

48. How to kill your application

49. Get device current IP address

50. Calculate memory usage at runtime

51. Convert Bitmap to byte array and reverse

32. Clear EditText content on focus

53. Lose EditText content while rotating

54. Launch camera programmatically

55. Google Android Phone Secret Codes

56. Retrieve all secrect codes from your Android devices

57. Expand the status notification bar

58. Disable vertical scrolling of GridView

59. Detect when mobile is booted completely

60. Detect screen type and apply the correct orientation to application

61. Improve finger/multi-touch on ViewGroup

62. Common array clone mistake in Java

63. Create application with multiple entry-point activities

64. Query all installed Launcher Applications

65. The Magic behind App Protector Application

66. Get Default Launcher on Device

67. Do TaskManager apps really kill other apps immediately?

68. Error creating project in ADT rev.20

69. Launch Youtube app to play video

70. Get date time in custom format

71. Launch Home Chooser Dialog

72. Launch applications on custom secret code

73. Compress file using Zip utility

74. Decompress file using Zip utility

75. Detect if an application is installed or not

76. A Note when Using Jsoup: User-Agent


Pete Houston

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: