2012年2月10日

【Android】Signing Your Applications

在寫好Android app時,若要將它上架至Market上,要先使用正確的Keystore將
APK sign好才能上架,通常在開發app跑在avd所用的都是debug.keystore,不能用
於正式上架的APK。

1。generate Keystore


  • Use JDK tool - keytool  to generate private key
  • keytool -genkey -v -keystore key-file.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 365
  • keytool要求輸入密碼與其它資訊,365為有效期限,可以設大一點,如:Insyde market就需要20年的有效期限。


2。use eclipse to sign android app
     在Package Explorer上點選Project
      File-->Export-->Android/Export Android Application
      再依照wizard進行輸入Private key 密碼。


Reference:
Android Dev: Signing Application
Android Dev: Signing Your Application            

2012年2月8日

【Android】Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE


When running android application on AVD, the error shows that

[2012-02-08 22:18:15 - ShowPhotos] Installing ShowPhotos.apk...
[2012-02-08 22:18:17 - ShowPhotos] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2012-02-08 22:18:17 - ShowPhotos] Please check logcat output for more details.
[2012-02-08 22:18:17 - ShowPhotos] Launch canceled!

Solution:ON AVD->Settings->Applications->Manage applications->remove the app->Run again