android

Android: HTTP communication should use "Accept-Encoding: gzip"

I've a HTTP communication to a webserver requesting JSON data. I'd like compress this data stream with Content-Encoding: gzip. Is there a way I can set Accept-Encoding: gzip in my HttpClient? The search for gzip in the Android References doesn't show up anything related to HTTP, as you can see here. ...

How to fix android.os.DeadObjectException android X

When android unbind a service I created (service.MyService), I see the following DeadObjectException. Can you please tell me how what does this mean and can I fix this exception? W/ActivityManager( 583): Exception when unbinding service com.mycompany/.service.MyService W/ActivityManager( 583): android.os.DeadObjectException W/Activi...

Android:NPE while trying to activityForResult with ACTION_APPWIDGET_PICK intent

Hi all, I have a problem then trying to put an intent with AppWidgetManager.ACTION_APPWIDGET_PICK there is a problem somethere inside of android AppWidget ecosystem as I can see from the logs. So that I doing wrong? See sample code and stack trace below public class NPEDemoActivity extends Activity { private final static int HOST_C...

playback video full screen

I am trying to play a video in my app. It has to be embedded. I went through the "Play Video Files in Android" thread. I am able to play my video using VideoView as mentioned in this discussion. But there are a few problems. I need full screen video, how do I stretch VideoView to full screen? Will that stretch the video too? I d...

Using SDL on Android: can't compile because of missing "GLES_CM"

Hi. I'm trying to use OpenGL on Android using C. I'm following this excellent tutorial, but I've hit a wall. I'm using an ARM compiler (arm-none-linux-gnueabi-ld) on Linux Mint 7 (Ubuntu 9.04 branch). I can copy the compiled binary to the Android emulator just fine, it runs. But when I try to make it myself, I get the following error:...

Porting java apps to Android platform

I know Java apps can be run in Android. But what I want to know is this: I have a perfectly normal Java app and I want to port it to an android platform. What changes would I need to do to my app in terms of GUI and other code to make it usable in Android? I know Android uses XML file to control the look and feel of its app. So would I n...

Request View and View Updates from Another Application

I am looking to create an app with plugin functionality. What I want is to allow a separate plugin "app" to provide me with the view, and take care of the updating of the view that I will use in my list adapter. Essentially, I want the separate app to take care of the bindView and newView methods of my adapter. I am looking at RemoteVie...

How do you skip parts of an Activity stack when returning results in Android?

I'm making an app which has a flow roughly as below: User starts on the main screen with an empty list, hits menu, and goes to "add item." (Activity A) User is given a new activity which allows them to specify search criteria, then hits "go" to do a search. (Activity B) User gets a list of results, and can click on one of them to vie...

Android RadioButton return a constant?

I am trying to perform a rating system, where with the choices to select from returns a constant number so I can insert a value into a database. My intentions are to have 3 choices, 'Great', 'Mediocre' and 'Bad'. I would like Great to be a constant for '3', Mediocre to have a constant '2' and Bad to have a constant for '1'. I would like ...

ServiceConnection::onServiceConnected not called even though Context::bindService returns true?

I've been trying to bind a service that was started on boot from an activity. The code for starting on boot was mostly taken from the instant messenger. This is the AndroidManifest.xml definition for the 3 main components: <!-- Receiver --> <receiver android:name=".receiver.LifestylePPAutoStarter" android:process="android.process.l...

Android: change TextView textColor when parent is focused

I have a TextView inside a LinearLayout. The LinearLayout is able to receive focus, and I want the textColor of the TextView to change when it does. I thought using a ColorStateList would work, but it would seem that the TextView does not receive focus when the LinearLayout does. I know that, because I have tried this code: mTextView.se...

How to scroll "infinitely" wide view in Android?

I am pondering the alternatives on how to scroll an "infinite", scale-like, control in android. The simple idea is to redraw the entire view on each scroll movement, but somehow it doesn't seem like the proper way. It is possible to draw the contents before-hand, but I have no clue how wide I should make the view in the first place, and ...

i want to see the dialog in Top of layout. How to move it?

All, 1.) I have a Dialog showing on my application. Right now it is showing in the center of the device. But i want to see that dialog in Top of layout. How to move it? 2.) How to add an image in a Dialog box? EDIT: I added an image in background of Button. I want to move this button into right corner of Pop up Dialog. How to do that...

Android Emulator Alarm Clock Crashes

I am using the Android Emulator to debug my application, first off it is ridiculously slow, I mean like 15mins to load slow and on top of it, my Alarm Clock application fails? Am I the only one, or do other people experience this? Is there a fix or will I just have to go cook steaks while the emulator is booting? EDIT: I am running it ...

android app search button

I've been trying to make my app implement the built in quick search, similar to how it is done in ApiDemos' "app/search/invoke search". I have tried everything from trying to follow different examples, to copying the code exactly as it is in ApiDemos. All I've found for the former have been concerned with older versions of the SDK, and ...

Broadcast Intents Android

How Good are broadcast intents in terms of say I wanted to fire broadcast intents 10times a second for half hour. Right now i have a service doing this and it runs perfectly well until the user rotates the screen, and then it gets all messed up and stupid and gives errors. However broadcast intents are short live objects and so how would...

OutofMemoryError: bitmap size exceeds VM budget (Android)

Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening) ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budget ERROR/AndroidRuntime(7906): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295) My code is pretty...

Android - configure Spinner to use array

I declare my Spinner in the following manner (it's very static so I have 2 string arrays in array.xml for titles and values) <Spinner android:id="@+id/searchCriteria" android:entries="@array/ searchBy" android:entryValues="@array/searchByValues"> </Spinner> I expect spinner.getSelectedItem() to return an array [title, value] but in fa...

Android - String concatenate - how to keep the spaces at the end and/or beginning of String ?

I have to concatenate these two strings from my resource/value files: <string name="Toast_Memory_GameWon_part1">you found ALL PAIRS ! on </string> <string name="Toast_Memory_GameWon_part2"> flips !</string> I do it this way : String message_all_pairs_found = getString(R.string.Toast_Memory_GameWon_part1)+total_flips+getString(R.strin...

Android: Very strange layout controls binding problem

Hi, I created a layout with two buttons: btnMode and btnAction. There are clickListeners set for each: btnMode.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { onModeButton(); } }); btnAction.setOnClickListener(new View.OnClickListener() { ...