随笔分类 -  Andriod

Andriod相关问题整理学习
[转]: 两分钟彻底让你明白Android Activity生命周期(图文)!
摘要:转自:http://blog.csdn.net/android_tutor/article/details/5772285大家好,今天给大家详解一下Android中Activity的生命周期,我在前面也曾经讲过这方面的内容,但是像网上大多数文章一样,基本都是翻译Android API,过于笼统,相信... 阅读全文
posted @ 2014-04-15 15:04 higirle 阅读(2851) 评论(0) 推荐(0)
How to set the WIFI configuration
摘要:1. Settings -> Wireless & netWorks ->Wi-Fi Settings ->(Root Menu)Advance, then you are able to set the wifi configuration. 阅读全文
posted @ 2012-04-06 09:20 higirle 阅读(267) 评论(0) 推荐(0)
如何导出Android中的文件(把Android当做U盘)
摘要:方法一:1. 连接USB,插入电脑2.用手在手机上方往下滑动,会出现几个菜单,其中有一个"choose a connection type". 选择 Disk Drive.你看到的也许是,Charge only, 点击切换到Disk Drive.3.这时你的电脑上就会出现USB标志的盘符,点开即可看到。方法二:对有些Android有些不同:1). 连接USB,插入电脑 2). 用手在手机上方往下滑动,会出现几个菜单,其中有一个"USB Connection". 其中通常有四个选项,我们选择USB Mass Storage.3). 这时你的电脑上就会出现U 阅读全文
posted @ 2012-03-29 17:29 higirle 阅读(2521) 评论(0) 推荐(0)
Android: 解析Html code
摘要:1. 利用Jsope来解析html code :Documentdoc=Jsoup.parse(htmlCode);Elementslinks=doc.select("script");Stringtext2="";for(Elementlink:links){text2=link.toString();text2=text2.replaceAll(":",":");text2=text2.replaceAll("@","@");text2=t 阅读全文
posted @ 2012-03-16 11:46 higirle 阅读(307) 评论(0) 推荐(0)
(原创)如何获取网页URL的source code (Android)
摘要:1.对于常规的网址如: http开头的:URLoracle=newURL(url);Stringtest=oracle.toExternalForm();Stringtest1=oracle.toString();URIoracle1=null;try{oracle1=oracle.toURI();}catch(URISyntaxExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}BufferedReaderin=newBufferedReader(newInputStreamReader(oracle.openStr. 阅读全文
posted @ 2012-03-15 11:41 higirle 阅读(1444) 评论(0) 推荐(0)
Android 工程设置说明
摘要:1. Android sdk(是指要在什么版本的sdk 系统上运行该程序)。2. Java compiler(default set 1.6).因为程序是用java写的,需要java的编译器。Enable project specific setttings (false),则采用Preference 中指定的. (windows ->preference ->Java->Compiler(1.6)). 阅读全文
posted @ 2012-03-13 14:45 higirle 阅读(172) 评论(0) 推荐(0)
[Android]:Setting up a Library Project and how to use the library (工程引用和dll引用)
摘要:1. (Project reference)http://developer.android.com/guide/developing/projects/projects-eclipse.html 2. Dll reference:Property -> Java build path ->Libraries->Add External JARs. 阅读全文
posted @ 2012-03-13 09:29 higirle 阅读(268) 评论(0) 推荐(0)
Launch custom android application from android browser
摘要:1. http://stackoverflow.com/questions/2958701/launch-custom-android-application-from-android-browser 2. http://stackoverflow.com/questions/3038958/launch-app-with-url有一点要注意:Main action: android.intent.action.MAIN,这个主要的action比较特殊,即使你对他加了data, category也不起作用。像下面的例子中,即使将Test action中的属性 data, category加到. 阅读全文
posted @ 2012-03-12 15:58 higirle 阅读(525) 评论(0) 推荐(0)
(收藏)Android 的各种listener and states event
摘要:1. Android Listeners:http://developer.android.com/reference/android/view/View.html 2. States event:1). http://stackoverflow.com/questions/8411418/android-button-states-programmatically-in-java-not-xml2). http://stackoverflow.com/questions/5092649/android-how-to-update-the-selectorstatelistdrawable-. 阅读全文
posted @ 2012-02-24 11:12 higirle 阅读(237) 评论(0) 推荐(0)
(转)Android 、BlackBerry 文本对齐方式对比
摘要:http://tech.cncms.com/shouji/android/77024_2.htmlAndroid和BlackBerry文本对齐方式的写法不一样。首先Android文本对齐有相对的概念,也就是说当使用文本对齐,你还需要设定相对哪个坐标点才能进行,否则的话就不能达到想要的效果,而BlackBerry则不需要,只要设置对齐方式,就会相对于所画区域的大小自动对齐。Android是使用Paint和Canvas共同控制绘图,而BlackBerry只要Graphics就可以了。请看Android的代码:Java代码intimageWidth=200;intimageHeight=200;B. 阅读全文
posted @ 2012-02-22 17:44 higirle 阅读(950) 评论(0) 推荐(0)
(转)androd之绘制文本(FontMetrics)
摘要:转:http://fonter.iteye.com/blog/474526Canvas 作为绘制文本时,使用FontMetrics对象,计算位置的坐标。 它的思路和java.awt.FontMetrics的基本相同。 FontMetrics对象它以四个基本坐标为基准,分别为:・FontMetrics.top・FontMetrics.ascent・FontMetrics.descent・FontMetrics.bottom 该图片将如下 PainttextPaint=newPaint(Paint.ANTI_ALIAS_FLAG);textPaint.setTextSize(35);textPa. 阅读全文
posted @ 2012-02-21 17:00 higirle 阅读(402) 评论(0) 推荐(0)
(转)Android中尺寸单位杂谈
摘要:转: http://blog.csdn.net/muyu114/article/details/6393295 http://blog.csdn.net/zhangqijie001/article/details/5894872讲解一在android系统中单位DP也就是DIP:device independent pixels(设备独立像素). dip : device independent pixels(设备独立像素). 不同设备有不同的显示效果,这个和设备硬件有关,一般我们为了支持WVGA、HVGA和 QVGA 推荐使用这个,不依赖像素。 px : pixels(像素). 不同... 阅读全文
posted @ 2012-02-21 16:54 higirle 阅读(285) 评论(0) 推荐(0)
Android文字居中
摘要:在宽width高height的画布上画一字符串,使字符串水平竖直居中:水平居中很简单,paint.setTextAlign(Align.CENTER);然后drawText的x坐标设置为width / 2即可,竖直居中稍显麻烦,可以使用FontMetrics对象计算文字高度,然后计算baseline,使文字垂直居中,代码如下:Paint paint = new Paint();paint.setColor(Color.BLUE);paint.setTextSize(18);paint.setTextAlign(Align.CENTER);FontMetrics fontMetrics = p. 阅读全文
posted @ 2012-02-21 16:50 higirle 阅读(655) 评论(0) 推荐(0)
Setting Text to Image On Android and Adjudt the text font size based on the android resolution
摘要:1. Setting Text to Image On Android2. Adjudt the text font size based on the android resolution3. 文字居中: paint.setTextAlign(Align.CENTER);然后drawText的x坐标设置为width / 2即可privatefloattoPixel(Resourcesres,intdip){floatpx=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,dip,res.getDisplayMetrics());re. 阅读全文
posted @ 2012-02-21 16:47 higirle 阅读(364) 评论(0) 推荐(0)
How to get the android resolution
摘要:1.方法一Displaydisplay=getWindowManager().getDefaultDisplay();Config.screenWidth=display.getWidth();Config.screenHeight=display.getHeight();2. 方法二:DisplayMetricsmetrics=newDisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(metrics);intscreenWidth=metrics.widthPixels;intscreenHeight=met. 阅读全文
posted @ 2012-02-21 16:42 higirle 阅读(304) 评论(0) 推荐(0)
Image
摘要:<Button android:id ="@+id/Image_Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_launcher" android:drawablePadding="-40px" android:text="OK" />One lightweight way of do 阅读全文
posted @ 2012-02-17 18:04 higirle 阅读(147) 评论(0) 推荐(0)
How to import sample Android projects to Eclipse
摘要:Technical ResourcesFilter: Showing technical resources tagged with Sample:http://developer.android.com/resources/browser.html?tag=sampleHow to import sample Android projects to Eclipse For those beginners like me these are the steps we need to follow:1- In Eclipse->Window->Preferences->Andr 阅读全文
posted @ 2012-02-17 09:30 higirle 阅读(486) 评论(0) 推荐(0)
Android Localization
摘要:1. Localization:http://developer.android.com/guide/topics/resources/localization.html2. demo: http://developer.android.com/resources/tutorials/localization/index.html3. For testing, just need to set the Settings ->Language & keyBoard ->select language(the language is combined both the lang 阅读全文
posted @ 2012-02-16 15:09 higirle 阅读(236) 评论(0) 推荐(0)
主要的智能手机商店
摘要:https://market.android.com/appsIpone :app store WP7: Market placeBlackBerry App World 阅读全文
posted @ 2012-02-10 15:26 higirle 阅读(158) 评论(0) 推荐(0)
How to access the folder of Android
摘要:1. download the 豌豆荚2. install it and search the "Root Explorer" (or OI File Manager")3. Click the IO.., you can explorer the folder you are using. 阅读全文
posted @ 2012-02-09 14:09 higirle 阅读(244) 评论(0) 推荐(0)