Android Trivia (@androidtrivia) profile picture

Learn about Android platform 140 characters at a time!

Joined June 2009
TIP good starting tutorial for using database in #android http://www.devx.com/wireless/Article/40842
1
1
A8 AlertDialog a = new AlertDialog.Builder(context).create(); a.setMessage(msg);a.setCancelable(true); a.show(); #android
Q8 How to display an AlertDialog in under 140 characters of code? (Handy debugging technique in no console scenario)
A7 call context's getWindow() and invoke setFlags() w/ flags and mask set to WindowManager.LayoutParams.FLAG_BLUR_BEHIND http://bit.ly/BUuel
Q7 How to use blurred version of #android home screen as a backdrop of your app?
A6 Put android:configChanges="keyboardHidden|orientation" in AndroidManifest.xml, override onConfigurationChanged() ref http://bit.ly/2hTD4N
Q6 on #android the Activity restarts whn screen is rotated (or Keyboard is slid out on G1). It can be expensive for an app. How to avoid it?
A5 ConnectivityManager.getActiveNetworkInfo().getTypeName() will return the n/w #android phone is on. http://bit.ly/6PqDQ
Q5 How to find if the network that the #android phone is using, is "MOBILE" or "WIFI"?
A4.2 ..on #android phone, a tap generates ACTION_DOWN followed by _UP, a scroll gesture generates _DOWN followed by _MOVE and optionally _UP
A4.1 capture android.view.MotionEvent s w/ OnTouchListener. sequence of generated MotionEvent s is diff for a tap and a scrolling gesture...
Q4 On an #android phone, how to differentiate a tap from a scrolling gesture?
A3 RemoteViews useful 4 #android app widgets. creates view hierarchy to display in another process http://bit.ly/WYhwW http://bit.ly/19kEb7
Q3 Where to use android.widget.RemoteViews?
A2 check out android.Manifest.permission for list of #android permissions http://bit.ly/11Hhff
Q2 Where can one find list of all in-built #android permissions?
A1 See ConnectivityManager's getActiveNetworkInfo(). It returns a NetworkInfo object. use isRoaming() of that object. http://trunc.it/lrj4
Q1 What #android API call helps you find if the phone is on roaming network? (Check back for answer in few hours)