顯示具有 Android 標籤的文章。 顯示所有文章
顯示具有 Android 標籤的文章。 顯示所有文章

2014年1月28日 星期二

開發Android藍芽程式 出現閃退

發現是執行到mBluetoothAdapter.startDiscovery();出現閃退現象

利用logcat的Error Log level發現以下錯誤

com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:571)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.SecurityException: Need BLUETOOTH_ADMIN permission: Neither user 10148 nor current process has android.permission.BLUETOOTH_ADMIN.
            at android.os.Parcel.readException(Parcel.java:1425)
            at android.os.Parcel.readException(Parcel.java:1379)
            at android.bluetooth.IBluetooth$Stub$Proxy.startDiscovery(IBluetooth.java:1966)
            at android.bluetooth.BluetoothAdapter.startDiscovery(BluetoothAdapter.java:795)
            at com.nelson.app.FullscreenActivity.CommunicationWithBtDevice(FullscreenActivity.java:248)
            at com.nelson.app.FullscreenActivity.onActivityResult(FullscreenActivity.java:214)
            at android.app.Activity.dispatchActivityResult(Activity.java:5274)
            at android.app.ActivityThread.deliverResults(ActivityThread.java:3158)
            at android.app.ActivityThread.handleSendResult(ActivityThread.java:3205)
            at android.app.ActivityThread.access$1100(ActivityThread.java:136)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1249)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4881)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:571)
            at dalvik.system.NativeStart.main(Native Method)
01-28 23:06:03.001      522-676/? E/InputDispatcher﹕ channel '42ec6e68 com.nelson.app/com.nelson.app.FullscreenActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-28 23:06:03.462     830-1318/? E/ExternalAccountType﹕ Unsupported attribute readOnly


解決方法:
打開AndroidManifest.xml
加上
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>

就不會出現閃退現象嚕

透過Facebook分享

2013年12月3日 星期二

2013年3月20日 星期三

eclipse無法識別小米2

這篇提供解決方法

1. 安裝驅動程式 (按照小米手機內建教學就可以正確安裝)
2. 撥號介面下輸入以下密碼 *#*#717717#*#*

就可以識別到xiaomi手機



透過Facebook分享

2011年5月19日 星期四

Build Android-x86 - live cdrom image

Follow 

Build Android-x86 - live usb image

這次要build一個cdrom image


有比較快ㄝ
我想應該是因為之前有build live usb image 的關係

build出來的檔案可以在以下path找到
~/android-x86/out/target/product/

以下是我build出來目錄的資料


下一步就是要在acer aspire one上測試嚕

透過Facebook分享

2011年5月9日 星期一

想辦法架設android gps 開發環境

最近苦於沒有android gps開發環境

導致一些網路詢問有關android gps問題時

無法即時回應問題

歡迎大家推薦適合的平台給我作為參考

希望可以盡早把環境的架設好

透過Facebook分享

2011年4月18日 星期一

Android GPS porting

今天從9.1 porting to 9.4

紀錄一下修改過哪些東西


1. uart2gps 要放到/system/bin
主要用來設定baudrate - 38400

2. imx5x/init.rc
./device/fsl/imx5x/init.rc

+    //For Gps
+    chmod 777 /dev/ttymxc1
+    symlink /dev/ttymxc1 /gpspipe

+service uart2gps /system/bin/uart2gps
+    oneshot 

3. glgps.c
implement 真實接收gps nmea的地方

4.
kernel_imx/arch/arm/mach-mx5/mx51_babbage.c
啟動uart
kernel_imx/arch/arm/plat-mxc/include/mach/iomux-mx51.h
設定uart參數

5.
kernel_imx/arch/arm/mach-mx5/serial.c

-              .dma_enabled = UART2_DMA_ENABLE,
+              //.dma_enabled = UART2_DMA_ENABLE,

需要build出
uramdisk.img, uImage, system.img

使用GPSDemo測試ok

要記得接上GPS天線

透過Facebook分享

2011年3月31日 星期四

Android AP version

可以在專案的AndroidManifest.xml內找android:versionName

後面接著版本別

透過Facebook分享

2011年3月30日 星期三

Run Animatedtiles (qt examples) to android

繼

Run Qt examples fail on android

Ministro

Run Qt examples - Animatetiles on android

build qt examples - animatedtiles fail (Need to install g++)


四篇文章

得知之前失敗是因為網路的關係導致lib無法下載成功到正確的位置

Ministro就這樣被設計出來

是用來check QT ap需要哪些qt lib for android然後替你下載

如果你網路有問題(跟我一樣)

你可以上官網下載






或者從此處下載

將lib放到/data/data/eu.licentia.necessitas.ministro/files/qt/lib

這邊有我編譯好的Animatedtiles 以及官網提供的Ministro


使用adb install安裝

去執行Animatedtiles

就ok嚕


適用於Android 2.2 (SDK 8)

透過Facebook分享

Android GPS porting HAL code pdf

非常感謝Collect Countries網友將心得做成pdf分享給大家

可以從此處下載
http://dl.dropbox.com/u/12275050/Android_GPS_HAL.pdf 

以下是Collect Countries網友在原文章所回應的內容

Collect Countries 已針對您的文章「Android GPS porting HAL code」留下新意見: 

不好意思來晚了
這是我們整理的心得
http://dl.dropbox.com/u/12275050/Android_GPS_HAL.pdf 

透過Facebook分享

安裝apk位於sd的路徑

位於機器的/data/data

apk檔案會放在/data/app下

透過Facebook分享

2011年3月29日 星期二

myandroid9.1 code release tar

build 完
du -h
8.9G

切換到build目錄下

make clean

du -h
5.2G

find . -type f -name "*.o" -print0 | xargs -0 rm
du -h
5.1G

find . -type f -name "*.so" -print0 | xargs -0 rm
du -h
5.1G

find . -type f -name "*.img" -print0 | xargs -0 rm
du -h
5.1G

find . -type d -name generic -print0 | xargs -0 rm -rf
du -h
5.1G

find . -type d -name "\.git" -print0 | xargs -0 rm -rf
du -sh
4.6G

rm -rf .repo
du -sh
3.0G

find . -type f -name "*.patch" -print0 | xargs -0 rm
du -sh
3.0G

tar zcf myandroid9.1-CV7000-after1.0.0.3.tar.gz myandroid9.1-CV7000-after1.0.0.3/

-rw-r--r-- 1 nelsonchung nelsonchung 916M 2011-03-29 22:51 myandroid9.1-CV7000-after1.0.0.3.tar.gz

壓縮完剩916MB

透過Facebook分享

清楚了解 android.os 源碼中的Looper,Handler,Message,MessageQueue « Milochen's Blog for hacking

清楚了解 android.os 源碼中的Looper,Handler,Message,MessageQueue « Milochen's Blog for hacking: "- 已使用 Google 工具列寄出"


Callback function機制

透過Facebook分享

build Ministro jni ok

把Ministro的jni內容放到myandroid9.1下

可以使用git下載Ministro的source

git clone git://git.code.sf.net/p/necessitas/ministro/git necessitas.ministro

choosecombo
mm

有以下error


改了一下Android.mk內容
請從此處下載

再重新mm一次
ok


透過Facebook分享

2011年3月25日 星期五

Run Qt examples - Animatetiles on android

繼

Run Qt examples fail on android


出現
"This application requires Ministro, Qt libaries for Android. Would you like to install it?"

adb install Ministro-1.0.apk
769 KB/s (31031 bytes in 0.039s)
pkg: /data/local/tmp/Ministro-1.0.apk
Success

執行
Animatedtiles needs extra libraries to run.
Do you want to download them now?

按下yes

出現Sorry dialog
The application Animatediles (process eu.licentia.necessitas.industrius.examples.animatedtiles) has stopped unexpectedly. Please try again.


logcat message


看來跟網路連線有關系



20110328使用Denny手機執行
可以出現下載xxx套件的安裝資料
看來需要trace Ministro source code

透過Facebook分享

Ministro

繼

Run Qt examples fail on android



發現可以在Android Market下載
https://market.android.com/details?id=eu.licentia.necessitas.ministro
or 可以從sourceforge-minostro下載
http://sourceforge.net/projects/ministro.necessitas.p/files/Ministro-1.0.apk/download

會幫你安裝qt for android所需要的qt libraries

透過Facebook分享

Run Qt examples fail on android

繼

Install necessitas


居然跑範例程式發現有這個問題

"This application requires Ministro, Qt libaries for Android. Would you like to install it?"

press yes button.

Got following error message.

"Can't find Ministro service.
The application can't start."

透過Facebook分享

Install necessitas

上次介紹necessitas

Qt on Android - getting started



安裝步驟

1. install qt-creator

chmod +x qt-creator-linux-x86-opensource-2.1.0.bin

./qt-creator-linux-x86-opensource-2.1.0.bin

About 10 mins for waiting installation completely.

2. install sdk

tar zxvf android-sdk_r10-linux_x86.tgz

download sdk


3. install ndk

tar jxvf android-ndk-r5b-linux-x86.tar.bz2

4. install necessitas

chmod +x necessitas-0.1.1-Linux-x86-Install

sudo ./necessitas-0.1.1-Linux-x86-Install

About 10 mins for waiting installation completely.


設定

執行necessitas(or . runnecessitas.sh)
runnecessitas.sh的內容如下
cd /opt/necessitas/QtCreator/bin/
./necessitas


到Tools -> Options -> Android

設定

SDK, NDK, NDK toolchain and ant path

再到

Tools -> Options -> Qt4

新增(qmake)

/opt/necessitas/Android/4.7.60/bin/qmake

press ok button.

接下來你可以試著run qt application.


透過Facebook分享

2011年3月23日 星期三

[Android] launch Android Sound settings

如果你的程式需要呼叫Android sound settings
你可以參考以下代碼


透過Facebook分享

2011年3月21日 星期一

Fix: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] - part2

參考此篇

修改android package name

發生

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

這一篇與

Fix: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

稍微不同

這一次我的project裡面有兩個Activity
所以在修改package name的時候
DVDFullScreenAp">
會變成
DVDAp.DVDFullScreenAp">
build的時候不會特別警告你有問題
用eclipse會有下列錯誤訊息

[2011-03-21 16:46:53 - DVDAp] Android Launch!
[2011-03-21 16:46:53 - DVDAp] adb is running normally.
[2011-03-21 16:46:53 - DVDAp] Performing application.rtk.DVDAp.DVDAp activity launch
[2011-03-21 16:46:53 - DVDAp] Automatic Target Mode: using device '0123456789ABCDEF'
[2011-03-21 16:46:53 - DVDAp] Uploading DVDAp.apk onto device '0123456789ABCDEF'
[2011-03-21 16:46:53 - DVDAp] Installing DVDAp.apk...
[2011-03-21 16:46:54 - DVDAp] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2011-03-21 16:46:54 - DVDAp] Please check logcat output for more details.
[2011-03-21 16:46:54 - DVDAp] Launch canceled!

手動調整
將
DVDAp.DVDFullScreenAp">
改成
DVDFullScreenAp">
就可以正常執行嚕

透過Facebook分享

Fix: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

參考此篇修改package path

修改android package name

卻還是發生下篇文章的事情

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]


Eclipse上看到

[2011-03-21 15:42:22 - DVDAp] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2011-03-21 15:42:22 - DVDAp] Please check logcat output for more details.
[2011-03-21 15:42:22 - DVDAp] Launch canceled!


跟Package有關系
發現錯誤在AndroidManifest.xml
package接在android:versionName之後
build出來的apk會有問題

會有上述問題的代碼


package接在xmlns:android之後
package接在android:versionCode之前
就無上述問題

無上述問題的代碼


只要編譯成功後

再恢復成有問題的代碼
也會變成沒問題

透過Facebook分享