android-sdk-2.1

How to exit from an android app?

醉酒当歌 提交于 2019-12-10 21:08:20
问题 I've just read that you can exit an android application by simply calling: finish(); However this is not the case! When I do this I get the following errors: PackageInstallationReciever Remove /data/local/tmp/com._____.apk Fail! AndroidRuntime Uncaught handler: thread main exiting due to uncaught exception AndroidRuntime java.lang.NullPointerException AndroidRuntime at android..... dalvikvm Unable to open stack trace file '/data/anr/traces.txt': Permission denied So what is the proper way to

Get path of song from SD card in android

前提是你 提交于 2019-12-09 07:03:32
问题 In my android application I want to fetch song from SD card but I am not able to get the path of that particular file.I am using android api level 7 which doesn't support following method. Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_MUSIC); I have also tried following code : path = Environment.getExternalStorageDirectory(); but I don't know how to specify path of music file.Please suggest some solution.Thanx. 回答1: Get path and song Name from SD Card. You can find the

Android: Camera Preview Orientation on HTC EVO (Android 2.1 or 2.2)

六眼飞鱼酱① 提交于 2019-12-08 18:40:29
I am developing an Android application that relies on the camera API, using an HTC EVO as my testing device. No matter what I've tried so far, the only time the camera preview looks right is in landscape mode (90 degrees rotation, to be specific). It seems as though there is no way to orient the preview correctly when in portrait mode (0 degrees rotation). The default camera application on the device (for HTC Sense) allows for any kind of rotation without any problem, so I know that there is no hardware limitation. I even downloaded some source code from HTC's developer site , but it's all in

use External database in android

雨燕双飞 提交于 2019-12-08 08:20:34
I have created database AddressBookMaster.db using Sqlite Browser and also create table AddressBook in mentioned database. But now problem is that I want to use this .db file in my application so where should I put this db file and how to fetch in application? Is there any example or tutorial which can help to me? The information contained in Using your own SQLite database in Android applications should have exactly what you are looking for. You should note that while this is not really difficult it is not just a set of trivial commands that would be done outside of your application. You can

use External database in android

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:42:40
问题 I have created database AddressBookMaster.db using Sqlite Browser and also create table AddressBook in mentioned database. But now problem is that I want to use this .db file in my application so where should I put this db file and how to fetch in application? Is there any example or tutorial which can help to me? 回答1: The information contained in Using your own SQLite database in Android applications should have exactly what you are looking for. You should note that while this is not really

Showing Live Wallpaper in a 1.6 target app by detecting if it's a 2.1 device?

六月ゝ 毕业季﹏ 提交于 2019-12-07 19:28:25
问题 We're building an Android app with target SDK 1.6, so it will run on 1.6 devices and higher. We'd like to support Live Wallpapers, which we know is 2.1+ only. Is there a way to build one app with 1.6 SDK as the target, but detect if the device it's running on is 2.1, and only in that scenario call the live wallpaper API. We're trying to avoid having to build a separate 1.6 and 2.1 versions, and would like to be able to support Live Wallpapers for only 2.1 devices. So to be clear- 1 app, that

installing android offline is hard[obsolete]

家住魔仙堡 提交于 2019-12-07 09:40:02
问题 i am a student in africa and in our land, there actually exist slow and expensive internet connections, which is why we tremble in fear whenever we hear the word "online repository" method of installing software. Damn, that usually means you have to look elsewhere. The problem.(i cant install android without connecting eclipse to the internet) It is possible to manually download individual components as .zip files but there is no way of installing them into android eg i have managed to

Showing Live Wallpaper in a 1.6 target app by detecting if it's a 2.1 device?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 07:22:17
We're building an Android app with target SDK 1.6, so it will run on 1.6 devices and higher. We'd like to support Live Wallpapers, which we know is 2.1+ only. Is there a way to build one app with 1.6 SDK as the target, but detect if the device it's running on is 2.1, and only in that scenario call the live wallpaper API. We're trying to avoid having to build a separate 1.6 and 2.1 versions, and would like to be able to support Live Wallpapers for only 2.1 devices. So to be clear- 1 app, that can support 1.6 and higher, and support live wallpapers for 2.1 devices. Any way of doing this? Maybe.

Java Model Exception: Java Model Status [gen [in MyApp] does not exist] after Eclipse Android project Clean

╄→гoц情女王★ 提交于 2019-12-06 04:29:05
问题 After performing a Menubar> Project> Clean... I get the following error in the errorlog: Java Model Exception: Java Model Status [gen [in MyApp] does not exist] at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252) at org

Viewflipper Receiver not registered error while orientation change in 2.1 and 2.2

夙愿已清 提交于 2019-12-05 18:00:41
I am using viewflipper for fling gesture recognition everything works fine for 2.0 and prior but in 2.2 and 2.1 it throws exception as "java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper" below is full debug trace. java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@452f8398 09-19 11:33:06.825: ERROR/AndroidRuntime(393): at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:793) 09-19 11:33:06.825: ERROR/AndroidRuntime(393): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java