android

onKeyDown() functionality issue

Hi, I was trying to override the back button functionality where I wanted to call the default functionality in case a boolean is set false public boolean onKeyDown(int keyCode, KeyEvent event) { boolean temp = false; if (event.KEYCODE_BACK == keyCode) { System.out.println("Back pressed"); if (isT...

How to enforce activity if app is running?

I start an Activity from my Widget, which should start a special view. But if the app is already running (not left with back button), Android instead activates the activity that was last shown. Is there any flag or other way to avoid this behaviour? Closing the previous activity wouldn't be a problem in my app, there's no user input that...

Android SMS App

How difficult would it be to build an android app that responds to all SMS from a certain number. Given a certain regexp on those SMS responds with an answer to a certain number. Example input: "HelloWorld 12345" Example regexp: "([0-9]{5})" Example output confif: "Purchase $2" Should give "Purchase 12345" Is this possible to build...

WindowManager is unable to show Window View on screen even though it's visibility property is true

Hi, My application shows UI based on events received in various BroacastReceiver . Since I need to generate view directly from BroadcastReceiver I use code like this : mWindowManager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); WindowManager.LayoutParams lp = new WindowManager.LayoutParams( La...

Set ORIENTATION_LANDSCAPE not working Android

@Override public void onConfigurationChanged(Configuration _newConfig) { if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { Toast toast = Toast.makeText(this, "test orientation_landscape", Toast.LENGTH_LONG); toast.show(); setContentView(R.layout.proceed); } if (...

Replace current activity

I need to replace the current activity with a new one. That is, I want to start a new activity and remove the current activity from the task stack. Based on the documentation, it seems the best way would be to start the activity using Activity.startActivity as per usual, and then call Activity.finish immediately to close the current act...

How to display HTML in TextView?

Hi, I have simple HTML <h2>Title</h2><br> <p>description here</p> I want to display it in TextView. How to do this??? Any help would be appreciated. ...

Logging to a file on Android

Is there any way of retrieving log messages from an Android handset. I'm building an application which uses the GPS of my HTC Hero. I can run and debug the application from eclipse but this isn't a good use case of GPS, sat at my desk. When I fire the app up when I am walking around, I get an intermittent exception. Is there anyway I c...

Android: Start activity from a MenuItem

Hi, Im new on Android, and im trying to start an Activity from a MenuItem choose of the user. Actually, im building my menu (and is working ok) from my main activity class using a MenuInflater: @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); //the Menu Inflater clas...

Make android app icon available to other applications

I would like my application icon to be available to other applications. I understand this is a bit unclear so will try explain: Applications such as Astros program manager lists applications with their icon. For all apps this is the correct icon as on the launcher, except mine which is displaying the standard android icon. I have set...

Looking for an Android development podcast

I have read http://stackoverflow.com/questions/1644/what-good-technology-podcasts-are-out-there, and other related questions, but I have not found anything Android-specific. Does anybody listen to any such podcast? Want to recommend it? Thanks ...

Relative Layout and a Button to the left of a TextView - Squishing problem

In a RelativeLayout I have a Button to the right of a TextView. The problem is that the text view gets squished to the left of the screen. I want the Button to be squished to the right and the TextView take up all the remaining space. I can't use 'Fill Layout' on the TextView because the button then gets removed from the View complete...

Creating java.util.Map in Android

Hi All, I want to create a java.util.map in android from a resource. I want to do this because I have a lot of entries to populate into the java.util.map and I want to store the values in the res folder of the project in xml format. Is there an effecient way to do this in android? My map will have around 2500 entries so I want to do th...

WARN/SoundPool sample 2 not READY

SoundPool works properly on Android 1.6 but when I run on 2.1 in the Emulator I am getting a "sample 2 not READY" error message everytime I try to play a sound. How do I fix this? ...

textNoSuggestions is ignored by 2.0.1 emulator

textNoSuggestions is ignored by 2.0.1 emulator...am I doing something wrong? I am using the stock settings which has a 12 key softkeyboard. ...

Developing for Android on Windows 7 using Eclipse

I have followed all the necessary installation and setup steps for Eclipse 3.4 + ADT + Android SDK on Windows 7. I followed the Hello, Android tutorial in Eclipse and code-completion also works like a charm. No errors shown. unfortunately the emulator never shows up. When I run the project. I have fullfilled the same steps in a virtual ...

Displaying dates in localized format on Android

I'm currently building my first app for Android. What I'm having trouble with is the storage and localized display of dates in connection with a SimpleCursorAdapter. I have a class that encapsulates access to an SQLite DB with three tables. This class takes care of storing all dates in ISO format ("yyyy-MM-dd"). When the date values are ...

Theme/Style is not applied when inflater used with ApplicationContext.

I have theme that specifies textColor for TextView as red. I am using LayoutInflater to instantiate TextView. The problem is that styles are not applied to TextView when inflater created using ApplicationContext - the color is not red. All works fine when LayoutInflater created using activity. Why this happens, and how can be fixed? /...

Can't debug Android: This device cannot start. (Code 10)

I have a brand new Nexus One. I'm trying to follow the directions for installing the USB driver. When I plug in the device, it doesn't start the New Hardware Wizard, as the documentation suggests. I can run hdwwiz.exe to launch it and manually install the driver, but when I do, Device Manager says: "This device cannot start. (Code 10)...

Windows file permission error (IO Error 13) with Android SDK (and Titanium) and git - help needed

Running Titanium Appcelerator 0.8.1 on a Windows XP Virtual Machine, with Android SDK 2.1 When running build/install app, getting the following error: [TRACE] f = open(os.path.join(dest, dest_file), "w") [TRACE] IOError: [Errno 13] Permission denied: 'C:\\Documents and Settings\\firstname.surname\\Desktop\\MyApp\\build\\android\\.class...