android

Complex example about accessing multiples SQLite tables from Android

Hello. I'm developing an Android application that access many tables from a SQLite database. I need an example to see how implement a database framework to access multiples tables. I've been looking for and I only find examples with one table. UPDATE: With one table I found only one class DBAdpater with object SQLiteDatabase and a cl...

Android - v.getId() in Context Menu returning 'false'

I have a context menu. The function v.getId() is supposed to return the id, but does not - instead it returns 'false'. Here is my code: @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Options"); menu.add(0, v...

How to keep android device from sleeping while plugged in

I'd like to keep the screen on whenever one of my Activities are running and the phone is plugged in to a power source. I know that Wakelocks are tricky, so I'm looking for an example or some documentation on how to accomplish this specific goal. ...

License source code of app

Hello, I have an Android app and some company is interested in using part of it and rebranding it for its customers. One of the options would involve licensing the code to them for use in this specific case. Would you recommend doing that as a good option? What is the cost of licensing code in comparison to the cost of the original dev...

How to extending "android.speech.RecognizerIntent" for new language support

Hi... I'd like to ask to generous people. Is it possible to extend RecognizerIntent class for extending a new language support such as Bahasa Indonesia? The ideas that came into my mind: 1. Extend it 2. Take sample of voice, if it is a predetermined of Bahasa Indonesia then send the sample voice through web service on the server that h...

What programming languages can one use to develop Android applications?

Possible Duplicates: Which programming languages can I use on Android Dalvik? Which programming languages can be used to develop in Android? What programming languages can one use to develop Android applications? Also are there plans in the future to expand the amount of programming languages that Android will support? UPD...

Passing a cursor to an activity?

Is this possible? I am trying to open a SQLite database cursor in one activity, and pass it to another activity. ...

Custom ListView Adapter [Android]

Hello, I've been stuck on a little bug trying to implement a custom listview in Java for an Android application. I'm trying to list a bunch words (typically, 100 < n < 500) and highlight a subset of those rows by changing the text color. The both sets of words (global and subset) are listed in a collection (currently an ArrayList) The...

Problem with getting GPS data when using CameraPreview

Hi, I tried to write some AR app. For now I wrote some code that display camera prewiew and gets data from sensors on the device (acceleromentr, compas, gps reciver). When I run the code in separate app (like camera preview as one app and application that gets gps data as a second) everything is OK. But when I try to integrate this two...

Android can't see devices on ".local" domain

I'm having an annoying issue with Android development. I have a webserver (Tomcat) running on my Macbook which is connected to the local network via wifi. I have my Sprint EVO connected to the same network using wifi. The only way I can connect to the Tomcat instance is by raw IP address. If I use the Macbook name with or without the ".l...

Interactivity Coordination: onStop and onResume

I have two activities. One loads all rows from a database, and the other saves to the database. When I have the second save in onStop and the first repull the data in onResume, they do it out of order (the first resumes and then the second saves). I managed to fix this by putting the saving data in onPause, but why was this happening? Wa...

How to prevent OnItemClickListener work when long click performed ?

I have a gridview and i want its items to act different if user performs click or long click that is why i am using OnItemClickListener and OnItemLongClickListener but when long click happens both listeners react.I want to perform only OnItemLongClickListener. ...

Custom locale in Android

Hi, the Android phones in Slovakia have a custom locale - en_SK and cs_SK. Language is either Czech or English, location is Slovakia. Now I would like to have strings that target these locales. The default approach is to create a folder "values-CountryCode", for Czech Republic it's values-cs. But I get a build error if I add a folder ...

Is there another class in android that can replace the activity call throught which I can access SharedPreferences?

I'm have a User Class in my Android application that pulls out information from SharedPreferences I find myself instantiating the class within an Android Activity User currentUser = new User(this); I then go on to use the context to get the preferences. userName = context.getSharedPreferences("UserName", Context.MODE_PRIVATE); I ha...

Android: provide own implementations of java.* classes for jar

I have a .jar in my Android project which has many references and uses of the java.awt.* classes and other classes not available on Android. How can I provide my own implementations of these classes so that I can embed the unmodified .jar file (the only modification is being ran through dx) in my Android application and it will use my ow...

"IllegalStateException: database not open" - on screen orientation change

Hi, I have "java.lang.IllegalStateException: database not open" - when I change the screen orientation when upgrading database is in progress. When version of my database changes, onCreate() of my SQLiteOpenHelper subclass is called. In this method I'm simply dropping previous tables, creating new ones and populating them with data. Data...

how drawables resources stored on device

guys, I wonder if you put images for each density type (low/medium/high) and there are quite a few of them, won't it increase the size of application footprint on internal memory? I would hope that android will put only needed resource file from apk to the actual application folder. Can somebody confirm that? ...

Bad sound quality when recording/playing sounds - Android SDK

Hey, I have a problem with andriod programing when I try to record and then play the file that was just recored. I can both record and play the sound but the quality stinks. Its not just bad is really hard to listen to and sound abit like its a computer generated voice... I use the andriod SDK-emulator. The code that sets up the recordin...

HashMap - correct usage?

i am trying to process an MMS message with multiple attachments. For that I'm creating a HashMap as following (this is not the complete implementation but only the relevant part): HashMap<String, Integer> hashAttachments = new HashMap<String, Integer>(); int c = 0; if(atts != null) { for(Attachment a : atts){ ...

Using many images in Android project

I have 24 .png images and a ImageView. On user touch I change the ImageView to be one of the 24 images. I'm currently doing setImageResource(R.drawable.hour_1);, but there is a slight delay after I touch the screen and the ImageView actually changes. I figure the delay is the resource being loaded, but I can't find a better way to do thi...