Time of Update: 2018-12-04
基本方法:void loadPictrue(){ try { byte[] data = GetImageForNet.getImage(path); String d = new String(data); int length = data.length; Bitmap bitMap = BitmapFactory.decodeByteArray(data, 0, length); imageView.setImageBitmap(bitMap);
Time of Update: 2018-12-04
首先需要 android 源碼檔案NeighboringCellInfo.aidl和ITelephony.aidl,建立檔案夾android.telephony(檔案名稱必須為這個名稱),將檔案NeighboringCellInfo.aidl拷貝到該檔案夾下,在建立另一個檔案夾com.android.internal.telephony(不必須名稱),將檔案ITelephony.aidl放入重新整理項目目錄,會看到在gen目錄下產生相應類代碼。項目目錄圖:詳細代碼如下:package
Time of Update: 2018-12-04
在android中橫向滾動可能經常會用到使用者體驗也不錯,最近整理了一下相關資料如下:方案一:通過繼承FrameLayout,或linearlayout布局重寫onInterceptTouchEvent(MotionEvent event),onTouchEvent(MotionEvent event)方法實現:主要代碼:package com.scroll.frame;import android.content.Context;import
Time of Update: 2018-12-04
總結一下Android開發中適配性的問題,首先對於控制項間距和大小最好使用螢幕密度dip去做,這樣可以避免太大的差異擷取螢幕密度方法;DisplayMetrics dm = new DisplayMetrics(); dm = getResources().getDisplayMetrics(); int screenWidth = dm.widthPixels; int screenHeight = dm.heightPixels; float density =
Time of Update: 2018-12-04
最近研究了一下在android端實現ftp server 功能,在網上搜了幾個,沒有能用的基本是各種抄襲,還是自己研究吧首先到 apache官網下載ftp server 相關jar和設定檔,最新的是Apache FtpServer 1.0.6 Release版本看一下:由於是apache已經將ftp server相關的實現封裝的很好了,所以實現起來就簡單多了匯入路徑\apache-ftpserver-1.0.6\common\lib下相關jar包主要的jar包檔案實現代碼:package
Time of Update: 2018-12-04
最近在狀態列上面添加了一些系統常用的按鍵,用的比較多的,Home, Menu,
Time of Update: 2018-12-04
最近想看看Android的JNI,然後又不想切換回Linux,所以只好選擇在Windows+cygwin+NDK這種方式了,開始安裝cygwin環境的時候一般不懂得怎麼安裝,就算安裝之後,才會發現很多包都沒有呢,,,好像網上說需要全部安裝devel這個類別下的包,,還好網上看了一篇文章,是安裝與更新cygwin的,轉載記錄一下,,,原文地址:http://www.ibm.com/developerworks/cn/aix/library/au-spunix_cygwin/ 如果您是本專欄的忠實
Time of Update: 2018-12-04
Android的通知事件,可以在狀態列上面顯示,滾動顯示通知突然內容以及表徵圖,可以設定在狀態列展開的時候,顯示通知項的標題和內容,以及點擊它所開啟的應用程式。。。 NotificationManager,通過getSystemService(Context.NOTIFICATION_SERVICE);來擷取系統的通知管理器 建立一個通知事件,Notification notification = new Notification(R.drawable.icon, “狀態列上滾動顯示的標題”,
Time of Update: 2018-12-04
Android中關於任務和進程的概念有點混淆,網上看到一篇說得很好的文章,摘過來記錄一下~~~http://bbs.sjtu.edu.cn/bbstcon,board,MobilePhone,reid,1288709685,file,M.1288709685.A.html 我的個人理解:首先你看到的不是進程(process),是任務(Task)。用終端,輸ps,可以看到真正的運行中的linux
Time of Update: 2018-12-04
Java代碼 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#c0000000" android:endColor="#c0000000" android:angle="90" /><!-
Time of Update: 2018-12-04
概要:mvc的基本介紹,web和android的mvc的對比。mvc:Model(模型):應用程式的主題部分。View(對象):應用程式中負責產生使用者介面的部分。Control(控制器):根據使用者的輸入,控制使用者介面資料顯示及更新Model對象狀態的部分。 總的來說,就是在開發中把商務邏輯,介面顯示,資料分離開來。mvc的優點:
Time of Update: 2018-12-04
預設AVD的路徑一般為系統使用者目錄下,WIN7下為C:\Users\Administrator\ 完整目錄為:C:\Users\Administrator\.android,即後為的.android目錄應該是安裝android-sdk的時候,預設建立的 修改的方法: 在系統內容變數上添加name為 ANDROID_SDK_HOME,value為你想設定的本地目錄,如D:\Android\local-avd (後面android-AVD manager
Time of Update: 2018-12-04
Android xml資源檔中@、@android:type、@*、?、@+引用寫法含義以及區別一.@代表引用資源1.引用自訂資源。格式:@[package:]type/nameandroid:text="@string/hello" 2.引用系統資源。格式:@android:type/name android:textColor="@android:color/opaque_red" 注意:其實@android:type/name是@[package:]type/name
Time of Update: 2018-12-04
All your favoriteAndroid appsnow on Windows PCA startup called BlueStacks has developed an Android runtime environment for the Windows operating system. It will enable users to run Android applications alongside conventional Windows software on
Time of Update: 2018-12-04
什麼是Android Application?簡單來說,一個apk檔案就是一個Application。任何一個Android Application基本上是由一些Activities組成,當使用者與應用程式互動時其所包含的部分Activities具有緊密的邏輯關係,或者各自獨立處理不同的響應。這些Activities捆綁在一起成為了一個處理特定需求的Application, 並且以“.apk”作為尾碼名存在於檔案系統中。Android平台預設下的應用程式
Time of Update: 2018-12-04
1.自訂字型android Typeface使用TTF字型檔設定字型我們可以在程式中放入ttf字型檔,在程式中使用Typeface設定字型。第一步,在assets目錄下建立fonts目錄,把ttf字型檔放到這。第二步,程式中調用:AssetManager mgr=getAssets();//得到AssetManagerTypeface tf=Typeface.createFromAsset(mgr, "fonts/ttf.ttf");//根據路徑得到Typefacetv.setTypeface(
Time of Update: 2018-12-04
細心的網友可能發現 Android的ROM中有很多odex檔案,相對於 APK中的dex檔案而言這個odex有什麼作用呢?
Time of Update: 2018-12-04
一、啟動android預設瀏覽器 Intent intent= new Intent(); intent.setAction("android.intent.action.VIEW"); Uri content_url = Uri.parse("http://www.cnblogs.com"); intent.setData(content_url);
Time of Update: 2018-12-04
通過包名判斷 public boolean checkBrowser(String packageName) { if (packageName == null || "".equals(packageName)) return false; try { ApplicationInfo info = getPackageManager().getApplicationInfo( p
Time of Update: 2018-12-04
暑假時我參加了Google(中國)舉辦的首屆Google暑期大學生部落格分享大賽-2010 Android篇,並且很幸運能夠獲得“Android 應用最佳開發經驗分享獎”,知道獎品是一部Android高端智能手機,就一直很期待,今天終於收到了Google寄來的獎品--HTC Desire手機(行貨)。圖1 HTC Desire HTC