
Android
totogogo
@CityU of HK
展开
-
Android app里如何共享object
有时你希望在你的app里对一些创建好的object进行共享,例如httpClient object, login flag variable。你当然可以用static or Singleton pattern来实现共享,但最好的方法就是创建一个custom Application class,然后把你要共享的object放在这个class里。这个class instance存在于你的a原创 2012-03-01 12:00:23 · 1244 阅读 · 0 评论 -
google map javascript api example in android
android map app by using google map javascript api(solution: communication between html javascript and android app native code)http://code.google.com/intl/zh-TW/apis/maps/articles/android_v3.h转载 2011-12-15 00:49:52 · 1027 阅读 · 0 评论 -
Android: 详细的对话框AlertDialog.Builder使用方法
http://www.cnblogs.com/Gaojiecai/archive/2011/12/10/2283156.html转载 2012-04-15 02:16:49 · 631 阅读 · 0 评论 -
Android: thread & handler
Android UI操作并不是线程安全的, UI操作必须在UI线程中执行,也就是说你不能在自己另起的一个thread里进行UI操作。举个例子,下列代码是希望在自定义的thread中修改Activity里的button name。ThreadHandlerDemoActivity.javapublic class ThreadHandlerDemoActivity extends Act原创 2012-04-15 01:20:09 · 775 阅读 · 0 评论 -
Java UDP Socket
Java UDP Socket使用2个class: DatagramSocket and DatagramPacket在DatagramSocket中並不區分ServerSocket和ClientSocket,调用send方法的就相当于socket client,调用receive方法的就相当于socket server。调用DatagramSocket 的receive方法时原创 2012-04-13 15:35:02 · 1771 阅读 · 1 评论 -
Android: HttpClient与Webview共享cookies
httpclient与webview需要进行cookie 共享,因为如果不共享,那么假设你在httpclient进行了登录,然后用webview里打开那些login之后才能看的page,就会叫你再loginDefaultHttpClient httpclient=....;String toUrl="https://cap.cityu.edu.hk/studentlan/deta原创 2012-03-01 13:53:24 · 10984 阅读 · 3 评论 -
android html parser
I choose "htmlcleaner" parser because its size is smallanother alternative option is "jsoup"原创 2012-02-29 17:13:46 · 824 阅读 · 0 评论 -
google map public transit route (大众运输路线)
google map direction api只开放3种travel mode (driving, walk, bicycle),并没有开放travel mode "大眾運輸"。因此无法获取大众运输的route。ref links:http://maps.google.com.hk/intl/zh-TW/landing/transit/text.html#ymdhttp://原创 2012-01-02 00:08:39 · 2134 阅读 · 0 评论 -
在android mapview控件里画简单导航路线的方法
基本原理是: send http request to google direction api url (http://maps.google.com/maps/api/directions/json?xxx) parse the response, and then draw it.google direction api user guide: http://code.goo原创 2011-12-16 00:05:17 · 1551 阅读 · 0 评论 -
两分钟彻底让你明白Android Activity生命周期(图文)!
http://blog.youkuaiyun.com/Android_Tutor/article/details/5772285转载 2012-07-09 11:58:44 · 510 阅读 · 0 评论 -
Android app online install without google store
从eclipse你的project的bin folder下复制apk file到web site,然后提供一条link给user下载。注意:如果user在device browser点该link显示"404 page not found",表示web server不认识apk mime type,你需要在你的web server添加一个mime type for apk with fo原创 2012-07-12 12:27:42 · 1754 阅读 · 0 评论 -
android: Google Cloud Messaging (GCM)
GCM是第二代的google message service, 第一代是c2dm。 目前c2dm已经相当于不能用了,因为它不在允许新的android注册和使用c2dm。如何创建一个最简单的app和相关的server side. (ref link)1. 首先要有一个google account,and then access Google APIs Console page原创 2012-07-12 19:03:16 · 3154 阅读 · 0 评论 -
Android: google play graphic assets guide
http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1078870转载 2012-08-09 12:18:16 · 799 阅读 · 0 评论 -
mobile app design experience
* for tablet version, should support both portrait and landscape. * for phone version, consider support landscape。如果支持打横,考虑在弹出keyboard时,要调整text field的位置使其不要被遮挡。假设你的navigation bar的height很高,而text fiel原创 2012-09-05 14:32:40 · 685 阅读 · 0 评论 -
mobile push notification ppt
http://www.slideshare.net/mwillbanks/mobile-push-notifications转载 2012-09-13 10:32:25 · 1191 阅读 · 0 评论 -
open android sdk manager and avd manager in Mac
open a terminal and navigate to the tools/ directory in the Android SDK, then to open sdk manager, execute "./android" instead of "android"to open avd manager, execute "./android avd"原创 2013-03-27 11:10:06 · 1660 阅读 · 0 评论 -
Android screen capture in Eclipse DDMS
http://chicagoandroid.com/profiles/blogs/android-screen-capture-in转载 2013-11-18 18:40:11 · 5404 阅读 · 0 评论 -
android activity之间的切换和传值
http://android.blog.51cto.com/268543/323982http://hatsukiakio.blogspot.com/2009/06/startactivitystartactivityforresult.htmlhttp://www.moke.tw/wordpress/computer/advanced/231转载 2012-01-02 19:30:53 · 779 阅读 · 0 评论 -
android google map bubble box
最好的solution:https://github.com/jgilfelt/android-mapviewballoons其他的solutions:http://www.anddev.org/map-tutorials-f18/nice-bubble-in-android-maps-t52751.htmlhttps://github.com/commonsguy/cw-ad原创 2012-01-06 10:12:05 · 1043 阅读 · 0 评论 -
Android webview访问HTTPS web page如何忽略验证
当使用webview访问ssl加密的url时,页面显示是空白的,而使用系统自带的浏览器打开时,会弹出确认证书的对话框。忽略这步的方法是: WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.loadUrl("https://cap.cityu.edu.hk/studentlan/");原创 2012-03-01 11:46:09 · 12140 阅读 · 2 评论 -
unable to get system library for the project" error when import android project to eclips
solution:open "project.properties" file and update "target" version, the sdk version must be already installed to your machine.原创 2012-02-29 23:03:56 · 1157 阅读 · 0 评论 -
Android: get IP address of device
在网上查了下,多数使用下列代码: private String getLocalIpAddress() { try { for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf原创 2012-04-15 00:49:06 · 3259 阅读 · 0 评论 -
android异步
有2个方案,一是自己写thead + handler 来实现, 另一种是使用AsyncTask。我选择后者参考文档:http://blog.youkuaiyun.com/mylzc/article/details/6736988http://blog.youkuaiyun.com/mylzc/article/details/6772129下面连接提供了自己写thread + handl原创 2012-02-29 17:28:26 · 612 阅读 · 0 评论 -
Android 中的BroadCastReceiver
http://yangguangfu.iteye.com/blog/1063732http://blog.youkuaiyun.com/luoshengyang/article/details/6737352转载 2012-01-09 02:29:17 · 483 阅读 · 0 评论 -
android手机之间用wifi direct通信
android p2p wifi package (use wifi direct)http://developer.android.com/reference/android/net/wifi/p2p/package-summary.htmlwifi direct demohttp://developer.android.com/resources/samples/WiFiDirec原创 2012-01-08 00:28:30 · 5011 阅读 · 1 评论 -
申請Google Map API Key
如何申請Google Map API Key (模擬器用)参考文档: http://wangshifuola.blogspot.com/2010/12/androidgoogle-map-api-key.htmlstep 1: 找到android key store file的path: in eclipse, access "Windows > Preferences > A转载 2012-01-02 04:56:18 · 2229 阅读 · 0 评论 -
如何改变android app的entry activity
修改android project里的AndroidManifest.xml的 tag的"android:name" property原创 2011-12-16 15:44:28 · 927 阅读 · 1 评论 -
2 solutions for google map app in android
solution 1: use google map javascript api + webview compenent优点:1. 所有对地图的操作都写在html page的javascript代码里,android side的app只是使用webview控件来当成一个web browser来显示。由于android app的java代码可以调用webview里的html page里的j原创 2011-12-15 23:50:31 · 1663 阅读 · 0 评论 -
Android在真机用GPS API出现的getLastKnowLocation空指针异常
http://blog.youkuaiyun.com/kesenhoo/article/details/6566388转载 2011-11-17 10:47:06 · 1298 阅读 · 0 评论 -
build android development environment
1. install eclipse2. install ADT plugin http://developer.android.com/sdk/eclipse-adt.html#installing3. Update/install android sdk "eclipse > window > android sdk manager", install android version原创 2011-11-11 15:10:32 · 563 阅读 · 0 评论 -
Android/iOS Notification feature
notification有3种方案:轮询 (poll)长连接 (socket or http: comet)push notification (c2dm for android, apple notification server foriPhone, 2者的原理是一样的:push server -> apn -> iPhone -> app installed iniP原创 2012-03-07 17:17:37 · 2846 阅读 · 0 评论 -
Android UI: Listview & ListActivity
http://www.vogella.de/articles/AndroidListView/article.htmlhttp://chning2010.iteye.com/blog/605588http://w2davids.wordpress.com/android-listview-with-iconsimages-and-sharks-with-lasers/http:转载 2012-03-01 01:29:16 · 1054 阅读 · 0 评论 -
Android 对话框 (AlertDialog & ProgressDialog)
http://android.blog.51cto.com/268543/333769转载 2012-02-29 17:28:57 · 578 阅读 · 0 评论 -
android IntentFilter
http://www.cnblogs.com/hdjjun/archive/2010/06/02/1749864.htmlhttp://ozzysun.blogspot.com/2010/10/android-intent-filter-intent.html转载 2012-01-09 02:30:17 · 602 阅读 · 0 评论 -
android.net.wifi.p2p package API
ref links:api document: http://developer.android.com/reference/android/net/wifi/p2p/package-summary.htmldemo: http://developer.android.com/resources/samples/WiFiDirectDemo/index.htmlOverview原创 2012-01-09 17:54:36 · 7695 阅读 · 0 评论 -
how to avoid css and js cache in UIWebView
http://stackoverflow.com/questions/3549508/prevent-caching-of-css-files-in-uiwebview-loaded-from-disk转载 2013-11-12 15:41:47 · 1574 阅读 · 0 评论