2015年8月27日星期四

Android Resources

SQL:

Android SQL Database tutorial:
https://www.youtube.com/watch?v=cp2rL3sAFmI

How to read database file in Android with Eclipse
http://jingyan.baidu.com/article/6b97984d9b1bed1ca3b0bf4a.html

SQL tutorial
http://www.w3school.com.cn/sql/

Shared Preference:
http://developer.android.com/guide/topics/data/data-storage.html#pref
http://developer.android.com/training/basics/data-storage/shared-preferences.html
http://www.cnblogs.com/linjiqin/archive/2011/05/26/2059133.html


ListView:

Android official tutorial for List View, the key part is filling an adaptor view with data
http://developer.android.com/guide/topics/ui/declaring-layout.html#AdapterViews

Android ListView tutorial with array adaptor:
https://www.youtube.com/watch?v=eAPFgC9URqc

Use simple Adaptor to create ListView where each element contains several lines with Hashmap:
http://blog.csdn.net/hellogv/article/details/4542668

A detailed, complete ListView app development
http://www.vogella.com/tutorials/AndroidListView/article.html

Intent:

Official guidance: just introduce explicit and implicit intent
http://developer.android.com/guide/components/intents-filters.html

Transmit object between activities:Intent.putExtras(Bundle extras)
http://blog.csdn.net/withiter/article/details/16946659
http://blog.csdn.net/android_tutor/article/details/5740845
http://zhouhongyu1989.blog.51cto.com/2931598/1407257

Note: for databasehelper, don't need to pass databasehelper object between activities. Just create a new databasehelper and use the database directly

Sensor:
motion sensor values reading:
https://www.youtube.com/watch?v=MwH0z1HIxog

Handler:
Official Definition:
http://developer.android.com/reference/android/os/Handler.html
introduction:
http://www.codeceo.com/article/android-handler-message.html
http://mobile.51cto.com/aprogram-442833.htm
Examples:
http://www.jb51.net/article/43360.htm

bundle can pass object, handler can pass bundle, so handler can pass object:
Can see the pedometer project where I use handler to pass location object.
Handler uses message to transmit bundle, bundle uses serial or parallel way to transmit object.
In my pedometer project, I created a handler to update an address textview whenever GPS location changes.
http://www.lxway.com/8184952.htm

Bundle: transmit string , int...etc directly or any object serial or parallel
pass object serially or parallel
http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2012/1211/694.html
Note: In pedometer project, I try to pass a Location variable serially, but failed. While I succeed when passing it parallel. Interesting. There are still some differences between these two ways!


System time:
SystemClock:
http://developer.android.com/reference/android/os/SystemClock.html
Calendar:
http://developer.android.com/reference/java/util/GregorianCalendar.html

GPS:
Official tutorial:
https://developer.android.com/training/location/display-address.html
Get Current Location with Geocoding:
In android studio, there is a debug hint for locationManager.requestLocationUpdates(), ignore that.
Don't do any modification!!
http://javapapers.com/android/android-get-address-with-street-name-city-for-location-with-geocoding/ 
Good tutorial for just Geolocation:
http://javapapers.com/android/get-current-location-in-android/
https://www.youtube.com/watch?v=7-n6p6RxSS8
http://www.androidhive.info/2015/02/android-location-api-using-google-play-services/

Common projects:
Timer:
http://examples.javacodegeeks.com/android/core/os/handler/android-timer-example/

Step counts algorithm:
http://blog.bawa.com/2013/11/create-your-own-simple-pedometer.html
http://motzcod.es/post/82515321689/part-1-my-stepcounter-android-step-sensors

Common Step when finishing app
Creating signed APK in Android Studio
Change App icon
Change Background Picture
Change APK version


Google map
how to configure project when using map
Store location in a list then draw polyline in map
http://stackoverflow.com/questions/17038258/update-polyline-according-to-the-user-moving-android-googlemaps-v2
Polyline official tutorial
https://developers.google.com/maps/documentation/android-api/shapes
How to display path of updated locations:
1. add new location to polyoptions; 2. clear google map; 3. draw new polyoptions to polyline
http://www.pubnub.com/blog/displaying-android-location-live-updating-map-google-maps/

Fragment:
TextViews don't appear when fragment is full screen ---- declare TextView after the fragment
http://stackoverflow.com/questions/26550722/put-two-textviews-above-fragment-that-contains-a-google-maps
How to display android mapfragment view in specified shape or background
TIP: to change the size of fragment, just do it in xml file
Some solution says to use fragment.getView().getRootView().setBackgroundResource(), however, don't work for me.
http://stackoverflow.com/questions/20278693/how-to-display-android-mapfragment-view-rounded-shape


Weird problems when developing:
1. R cannot be resolved
     a. change the minSDK version;
     b. update the SDK
     c. add packages into build.gradle like compile 'com.google.android.gms:play-services:7.8.0'
2. Google map doesn't display, API KEY authentication problem



没有评论:

发表评论