android-2.2-froyo

SchemaFactory doesn't support W3C XML Schema in platform level 8?

二次信任 提交于 2019-11-27 09:11:20
With the Android SDK, the following code in a plain empty Activity fails: @Override protected void onStart() { super.onStart(); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); } The 2.2 emulator logcat shows this exception: 06-28 05:38:06.107: WARN/dalvikvm(495): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 06-28 05:38:06.128: ERROR/AndroidRuntime(495): FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.HelloWorldActivity}: java.lang.IllegalArgumentException: http

Binary XML file line #2: Error inflating class android.widget.LinearLayout

╄→尐↘猪︶ㄣ 提交于 2019-11-27 07:19:47
问题 I am completely lost with this one. My app works perfectly on API 2.1 on my handset and through the emulator. I have just run it through a 2.2 emulator and I am getting a crash and this error: 04-27 20:29:41.293: ERROR/AndroidRuntime(341): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ebp/com.ebp.ebpMainMenu}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.LinearLayout 04-27 20:29:41.293: ERROR/AndroidRuntime(341): at

How to delete entire contents of sdcard programmatically in Android 2.2

二次信任 提交于 2019-11-27 06:25:30
问题 I wish to delete the users entire SDcard programmatically in Android 2.2. What is the easiest way to do this? Will it require root rights? Can I just do an "rm -rf /mnt/sdcard" or do I have to make a recursive loop? 回答1: You can delete directories with Java. You have to do it recursively if they are not empty: http://www.exampledepot.com/egs/java.io/DeleteDir.html No. All applications have full RW access to external storage. Yes you can execute shell commands (but you'll have to check if "rm"

Can I get data from shared preferences inside a service?

白昼怎懂夜的黑 提交于 2019-11-27 03:01:34
问题 I'm developing an android application. I'm using android 2.2 In my application I am capturing GPS data and sending it to service with the 1 hour time interval. If user exits from application it's also working (it is required). I'm using 2 services (User defined), one for capturing GPS data and other for sending to the server. Here my doubt In service, can we use shared preferences. If we store any data in shared preferences in any activity of the application, will we be able to use that data

How to obfuscate my android project in eclipse IDE?

泪湿孤枕 提交于 2019-11-27 02:19:50
问题 I want minimize my app size as well as avoid the app from reverse-engineering. Can anybody help with simple answer? 回答1: Proguard is part of the android eclipse plugin, so you do not have to invoke it manually. You just need to activate it on your build. To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the proguard.config property in the <project_root>/project.properties file. The path can be an absolute path or a path relative to the project's root. For some

Why can't one add/remove items from an ArrayAdapter?

故事扮演 提交于 2019-11-27 01:39:11
I am using an ArrayAdapter<CharSequence> to populate the items to list in a android.widget.Spinner . That works all fine. But now I want to keep the list of items dynamic, i.e. I want to be able to add/remove items from the selection list at runtime. However, when I call adapter.add(item) or adapter.remove(item) I always get a UnsupportedOperationException , even though the Javadocs of the ArrayAdapter class describe these two methods as to be usable for exactly that intended purpose. Is this a bug, really not implemented or what am I missing here? You probably initialized the adapter with a

Uninstall old Android SDK versions

北城以北 提交于 2019-11-27 01:28:07
问题 I installed Android SDK and it's taking almost 7 GB on my (relatively small) SSD. When I open Android SDK Manager I can see that everything is installed even older API versions. Same thing for the Extras : Can I safely un-install all the versions and only keep the latest one (API 17 in my case) ? I use Andoid SDK Tools to develop Android Apps with eclipse. Thank you. 回答1: Just delete the packages you want to uninstall. You may still want to retain some of the older SDK's so as to try your

Android SDK Manager gives “Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml” error when selecting repository

安稳与你 提交于 2019-11-27 01:23:46
I'm trying to install a platform but when I open Android Manager then I click Available Software then select the https://dl-ssl.google.com/android/repository/repository.xml repository I get this error: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml I have also tried downloading by clicking on force "http:" for all "https:" downloads on settings panel but it still doesn't help. I'm working on Windows Vista. If you enter the URL in a browser and then look at the source code of the page you will see that an XML document is returned. The reason why that URL would

No Activity found to handle Intent : android.intent.action.VIEW

*爱你&永不变心* 提交于 2019-11-27 00:24:18
This is my code to play the recorded audio 3gp file Intent intent = new Intent(android.content.Intent.ACTION_VIEW); Uri data = Uri.parse(path); intent.setDataAndType(data, "audio/mp3"); startActivity(intent); But while running it in my HTC device (Android 2.2 Froyo) shows an exception: 05-04 16:37:37.597: WARN/System.err(4065): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=/mnt/sdcard/mnt/sdcard/audio-android.3gp typ=audio/mp3 } 05-04 16:37:37.597: WARN/System.err(4065): at android.app.Instrumentation.checkStartActivityResult

Android; Geocoder, why do I get “the service is not available”?

佐手、 提交于 2019-11-26 22:58:34
I want to use the Geocoder in an android application, I've got the following piece of code to sample it : public class LocatorGeo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Geocoder geo = new Geocoder(getApplicationContext()); List<Address> myAddrs = new ArrayList<Address>(); try { myAddrs = geo.getFromLocationName("CO100AR", 1); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } I get the following stack