android-2.2-froyo

ContentProvider without SQL

爷,独闯天下 提交于 2019-12-04 04:28:28
I have two pieces of data that need to be accessed from outside applications and stored. According to documentation ContentProviders are the only possible way, but it also mentions external storage. ContentProviders implement a database-like "interface" and using a database would be extremely unnecessary for two pieces of data. I would rather save them to a file, but using a ContentProvider by implementing the abstract methods is problematic because the methods are structured as database queries. I know that there is nothing specifying that ContentProviders must use a database underneath to

Which Android API to use?

北战南征 提交于 2019-12-04 04:24:55
I'm planning on developing Android Apps. I downloaded the SDK and AVD manager, and about to download the SDK platforms. My question is, I want to develop apps for 2.x platform. Do I need to download API 7-10? Which one to target? Also, if you have tips regarding this, please mention them. Thank you. It is not necessary to download all the platforms, just download the latest SDK and make your application compatible with other SDK. For that you just need to define android:minSDKVersion and android:maxSDKVersion, android:targetSDKVersion. <uses-sdk android:maxSdkVersion="12" android:minSdkVersion

show multiple images animation

南笙酒味 提交于 2019-12-03 20:43:27
I want to show a background image and multiple images moving down just like "snowfall" scene so how can I do that?Background image should not move, only small images over it should be falling down.How can i do this???? Update--> I have displayed images on screen but they all are coming at the same time but I want to show images coming at different time how can I do this?hey please suggest some way.is this the right way or if not please suggest me the correct way .... Here is my code: public class AnimationActivity extends Activity implements AnimationListener { /** Called when the activity is

Global declaration of variable in android

浪子不回头ぞ 提交于 2019-12-03 16:10:35
I am new to android development, I am parsing a xml file through SAX parser and storing the parsed data into a string.Now i need to use that string in another class, so i need to know how to call that parser in the new class. thanks in advance I always make a class that contains all of my globals and call it "Constants.java" final public class Constants//final to prevent instantiation { public static final String SOME_STRING = "0.04"; public static final int SOME_NUMBER = 5; public static final float METERS_PER_MILE = 1609.344f; //private constructor to prevent instantiation/inheritance

Voice recognition APIs, will Google Voice do this?

蓝咒 提交于 2019-12-03 15:03:22
问题 I've got an idea for an android app, I want to be able to say commands and have the application listen out for these and perform some action. For example, I want my app to sit idle and listen for my voice, when it hears me say "start", the app will start doing something until I say "stop". The idea is to lay the phone down and not have to physically touch it in order to control my app. Would this be possible with any current APIs? If so which ones should I look into? 回答1: You can take a look

Local service or remote service?

混江龙づ霸主 提交于 2019-12-03 14:46:46
问题 I have a background Service which must run permanently. The service just has to interact with my Activity. How to i check on activity resume if the service is still running? Is there a better possibility than a static variable in the service class? Is it of advantage to use a remote service in a separate process(to extend service life time) so that when the activity process gets killed the service is still alive? 回答1: I have a background service which must run permanently. This is not

Android MediaPlayer - Downloading and Streaming at same time revisited

只谈情不闲聊 提交于 2019-12-03 13:54:07
This question has been asked before, but now with the newer versions of Android (up to Jelly Bean), I was wondering if there's been any progress on downloading AND streaming a file at the same time. From the API, it doesn't look like it's inherently possible, as these are the available setDataSource methods: void setDataSource(String path) Sets the data source (file-path or http/rtsp URL) to use. void setDataSource(Context context, Uri uri, Map<String, String> headers) Sets the data source as a content Uri. void setDataSource(Context context, Uri uri) Sets the data source as a content Uri.

ListView setOnItemClickListener and setOnItemSelectedListener to store the Selected Item Index

心已入冬 提交于 2019-12-03 13:34:58
I have read on this site that it is necessary to customize the setOnItemSelectedListener and setOnItemClickListener of a ListView if we want to know the Index of the SelectedItem (.getSelectedItemPosition()). So that is what I do but it does not stores the position of the SekectedItem, instead i have always -1... What I want to do is just to give the user a way to delete items from a list by selected and Item and Clicking a button. See the code below : listViewPeople.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int i,

Android 2.2 - How do I detect if I am installed on the SDCard or not?

旧巷老猫 提交于 2019-12-03 12:25:41
I am writing an android app that stores a lot of media files. They are not the type (and are far too many) to clutter up the users notification or other media directories, but they also must be user-updatable, so I can't put them in the resources. I can use getExternalFilesDir to get a path on the sdcard, but I only want to do that if the app itself is installed on the sdcard. If the app is installed internally, I want to put the media in the internal memory. So how can I determine if my app is running in internal or external memory? Charlie Collins You could use PackageManager to get the

Correct event registration in the 'PhoneGap + jQuery Mobile' application

偶尔善良 提交于 2019-12-03 10:32:41
I am trying to define the correct way to register both initialization events (jQuery-style) for PhoneGap and jQuery Mobile in an Android application. After studying the documentation, I came up with the following: $('#index-page').live('pageinit', function () { // <-- fires $(document).bind('deviceready', function () { // <-- !fires // ... }); }); The "outer" event ( pageinit ) fires and the "inner" ( deviceready ) does not... Although, this type of event registration works perfectly: window.addEventListener('load', function () { document.addEventListener('deviceready', function () { // ... },