
Mobile
文章平均质量分 51
totogogo
@CityU of HK
展开
-
如何把utf8的html text变成plain text
access following linkhttp://maps.google.com/maps/api/directions/json?origin=shatin,hk&destination=mongkok,hk&sensor=false你会看到在"html_instruction" tag里有类似下列的字样走\u003cb\u003e沙田坳道\u003c/b\u003e原创 2012-01-06 02:56:02 · 2062 阅读 · 0 评论 -
indoor google map
http://googlemobile.blogspot.com/2011/11/go-indoors-with-google-maps-60-for.htmlhttp://www.youtube.com/watch?v=XZmjryh9glEhttp://googleblog.blogspot.com/2011/11/new-frontier-for-google-maps-mapp原创 2012-03-21 10:10:43 · 1295 阅读 · 0 评论 -
iOS: resource file folder in xCode 4
http://stackoverflow.com/questions/5789223/how-do-i-get-the-resources-folder-back-in-xcode-4转载 2012-04-24 09:59:04 · 1111 阅读 · 0 评论 -
iOS: label如果支持多行
在storyboard选中label控件,在属性窗口里设置"lines"属性为2,然后在"Text"属性里输入string,换行时按ctrl + enter原创 2012-04-24 10:17:10 · 3501 阅读 · 0 评论 -
iOS: Detecting which UIButton was pressed in a UITableView
http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview转载 2012-04-24 09:55:12 · 714 阅读 · 0 评论 -
Android: 详细的对话框AlertDialog.Builder使用方法
http://www.cnblogs.com/Gaojiecai/archive/2011/12/10/2283156.html转载 2012-04-15 02:16:49 · 631 阅读 · 0 评论 -
iOS: delegate机制
一句话:iOS里的 viewComponent.delegate = self;相当于java里的button.addActionListener(this);delegate examplehttp://blog.youkuaiyun.com/zhanglei5415/article/details/6133852原创 2012-03-29 22:49:56 · 983 阅读 · 0 评论 -
iOS: App的生命周期
app生命周期的官方文档 http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.htmlViewController的生命转载 2012-03-29 22:38:04 · 590 阅读 · 0 评论 -
iOS: How to use "Block"
"Block"是很有用的东东,它实际上就是一个Closure,类似于javascript的closure, java中的匿名listener等。参看http://blog.sina.com.cn/s/blog_67419c420100vl8b.htmlhttp://hechien.posterous.com/block-in-objective-c-20http:/转载 2012-03-27 10:04:42 · 743 阅读 · 0 评论 -
iOS app官方开发,调试,发布流程
http://developer.apple.com/library/ios/#DOCUMENTATION/Xcode/Conceptual/ios_development_workflow/00-About_the_iOS_Application_Development_Workflow/introduction.html#//apple_ref/doc/uid/TP40007959-CH1-S原创 2012-03-26 12:22:26 · 1002 阅读 · 0 评论 -
iOS: install App via OTA
下面是把app放到web site,让其他人通过Over the Air (OTA)下载安装的步骤。前提: 能安装app的device需要被包含在你的provisioning profile里Environment: iOS 5.0 + xcode 4.3ref link: https://help.apple.com/iosdeployment-apps/?lang=原创 2012-03-25 01:45:21 · 12108 阅读 · 1 评论 -
iOS: NSString应该用initWithFormat? 还是 stringWithFormat?
注意:对于iOS 5的ARC特性来说,两个方法是等价的,不会有memory leak的问题!(ref link: http://stackoverflow.com/questions/7960912/stringwithformat-vs-initwithformat-under-arc)下面文字的参看文档:http://www.cnblogs.com/yjmyzz/archive转载 2012-03-09 00:00:36 · 4112 阅读 · 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 评论 -
iOS: Convert NSData to NSString
NSString* str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];原创 2012-03-07 00:03:57 · 2307 阅读 · 0 评论 -
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 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 评论 -
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 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 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: 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 评论 -
iOS: #define
typedef与#define的区别。http://www.sf.org.cn/article/base/200608/18988.html#define 是宏定义,所谓的宏定义,就是将某段代码、地址、字符串等一串的文字,用一个宏来代替。#define是一种预处理。#define与typedef功能类似,但它除了定义数据类型外,还可以定义给变量、语句等等定义,还可以包含参数转载 2012-03-27 11:50:48 · 9950 阅读 · 1 评论 -
iOS: network reachability
https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.htmlhttp://www.raddonline.com/blogs/geek-journal/iphone-sdk-testing-network-reachability/http://ww转载 2012-03-26 17:26:20 · 828 阅读 · 0 评论 -
iOS: 设置全局变量
有几种方法some developers recommend use singleton patter (ref link http://blog.youkuaiyun.com/kmyhy/article/details/7026511)方法1:使用静态变量 (不推荐)方法2: 使用singleton pattern (ref link: http://nice.iteye.com/blog/原创 2012-03-14 23:41:37 · 12989 阅读 · 0 评论 -
iOS: some notes
* 如何添加 a new file to your project? 首先highlight the group you want to add the file to (usually the project code group),然后点击Xcode左下角的 + button* 如果添加一个existing file to your project? 只需要drag existing fi翻译 2012-03-14 18:01:22 · 1169 阅读 · 0 评论 -
iOS: Storyboard
Storyboard tutorialhttp://maniacdev.com/ios-5-sdk-tutorial-and-guide/xcode-4-storyboard/http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1http://www.raywenderlich.co原创 2012-03-09 01:39:07 · 2629 阅读 · 0 评论 -
iOS: 如何调试程序
2种方法:方法1:使用NSLog,相当于system.out.println,运行时输出信息会出现在console里http://xubenyang.me/413http://xubenyang.me/416不过要注意:NSLog是很耗系统资源的,因此我们必须保证在debug mode时使用NSLog,而在正式发布时能够屏蔽它。方案如下http://www.cocoac原创 2012-03-05 15:49:26 · 1857 阅读 · 0 评论 -
Android 对话框 (AlertDialog & ProgressDialog)
http://android.blog.51cto.com/268543/333769转载 2012-02-29 17:28:57 · 578 阅读 · 0 评论 -
Objective C 基本知识
*XCode、Objective-C、Cocoa是什么?XCode:IDE, 象eclipse, visual studio.Objective-C:编程语言.Cocoa:是一大堆函数库,就好像MFC、.NET、Swing这类玩意,人家已经写好了一堆现成的东西,你只要知道怎么用就可以了。*Objective-C的一些语法的注意点注意点一:我在程序中看到大原创 2012-02-27 01:45:31 · 2448 阅读 · 1 评论 -
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 评论 -
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 评论 -
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 评论 -
申請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 评论 -
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 评论 -
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 评论 -
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: 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 评论 -
iOS: json的处理
json的介绍和格式参看 http://blog.youkuaiyun.com/totogogo/article/details/3766163iOS 5之前是使用open source lib: JSONKit (https://github.com/johnezang/JSONKit)iOS 5提供了NSJSONSerialization。NSJSONSerializa原创 2012-03-28 15:02:41 · 11943 阅读 · 0 评论 -
iOS: Objective C "Selector" 用法
官方文档http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocStaticBehavior.html#//apple_ref/doc/uid/TP30001163-CH16-SW1其他文档http://edwardinaction.blogspot转载 2012-03-28 14:09:14 · 1057 阅读 · 0 评论 -
iOS: 在navigation controller里切换到UIViewController的view时黑屏
environment: Xcode 4.3 + iOS 5.0在navigation controller后添加table view controller (UITableViewController),切换到该view时正常,但如果添加的是view controller (UIViewController),那么切换到它时会黑屏。这是xcode 里 view controlle原创 2012-03-20 14:56:02 · 5189 阅读 · 1 评论