android

How to use only my access point

Hi! Is there a way to force all my requests to be made through my APN and not through wifi, without having to disable wifi? I want to know if it is possible for my application to use exclusively the network access point. I'm already able to set the default network APN and to use it but for this I have to disable the Wifi first. T...

Are all .class files in my Java application loaded into memory after appliaction start?

I am making an app for Android, in my Activity I need to load an array of about 10000 strings. Loading it from database was slow, so I decided to put it directly into one .java file (as a private field). I have about 20 of these classes containing string arrays and my question is, are all the classes loaded into memory after my applicati...

Android: Changing an ImageView src depending on database field data

Hi All, I'm quite new to Android development (started 2 days ago) and have been through a number of tutorials already. I'm building a test app from the NotePad exercise (Link to tutorial) in the Android SDK and as part of the list of notes I want to display a different image depending on the contents of a database field i've called "no...

Android AudioRecord and AudioTrack codec options?

I currently use the AudioTrack and AudioRecord classes in Android. I use the pure PCM data but I was wondering what my options are for other codecs? From this page it seems I can only encode and decode using AMR narrowband? I currently set up the Audio classes as follows: arec = new AudioRecord(MediaRecorder.AudioSource.MIC, ...

How to I make TableView Cells spanning over multiple rows?

Hi there, is there a way to create a tableview in which a cell may span over more than one row. As the two "X" here? 1 2 3 4 5 2 1 X 1 2 1 2 X 4 5 ...

android.settings.INPUT_METHOD_SETTINGS doesn't work with HTC hero

My application has a button that sends the user to the locale setting. I do this with this code: startActivity(new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS)); This works fine with some devices, but with the HTC Hero I get: 02-03 13:59:27.501: INFO/ActivityManager(69): Starting activity: Intent { action=android.se...

Enable or disable the PatternLock screen from code

Hi. I try to find a way to disable the PatternLock screen temporary. I don't want the lock to be disabled completely, but the user should not need to re-enter his pattern all the time. My idea is to write a service which disables the pattern after some user activity and re-enables it after a while. (and even more) There are apps on th...

Using EditTextPreference with 2 user input fields

Hi! I would like to use EditTextPreference to show 2 input fields instead of 1. For instance, a username and password field should be shown. I don't want to use a dialog for each one. How can this be done? In the WiFi settings there is one that does this, when you want connect to a protected network, a dialog shows to set a password fo...

Is there a way to determine android physical screen height in cm or inches?

I need to know exactly how big the screen is on the device in real units of length so I can calculate the acceleration due to gravity in pixels per millisecond. Is there a method somewhere in the Android API for this? ...

Adding directories to resources folders in Android.

If I have a large project with many resources, is there anyway to organise them using directories? I tired adding directories to drawable/ but it didn't work. ...

Is there a simple way to check if an incoming caller is a contact in Android?

When an Android phone receives a call it automatically checks if the call exists in its own contact database. I was wondering if there is a simple way to access that information. I have a PhoneStateListener that performs certain actions during a ringing state, and I want to check if the incoming caller is in the contacts list. Is there ...

Picasa access in android: PicasaUploadActivity

I am new to Android, and I'm struggling to figure out exactly what tools are available to me. I am developing for android 2.0.1 for now, just because that is what my device runs. Specifically, I am writing an app that I would like to upload images to a picasa album. I am almost sure this is supported; for example, the built in (google?...

How can I specify the scheme specific part in a data tag for an intent-filter?

I want to set up a BroadcastReceiver to handle PACKAGE_REPLACED, but I only want to be notified when my package is replaced. It works fine if I specify a data tag with scheme="package" but then I get notified when any application is reinstalled or upgraded. I can't figure out how I'm supposed to specify the package name which is in the...

Why button is not centered vertically in LinearLayout?

I have a LinearLayout, which only contains one button. I want this button to be centered vertically and aligned to the right. I tried many ways, but I couldn't make this button centered vertically. It is always aligned to the top. I also tried to put a button in RelativeLayout, the button can not be centered vertically either. The XML ...

"Debug certificate expired" error in eclipse android plugins

I am using eclipse android plugins to build a project, But i am getting this error in the console window: [2010-02-03 10:31:14 - androidVNC]Error generating final archive: Debug certificate expired on 1/30/10 2:35 PM! Does anyone know how to fix it? ...

Never got full 480*800 when using 2D orthogonal projection in opengl-es

I am doing a little experiment with OpenGL ES on Nexus One. Got a problem about the full screen resolution. It seems like I can never get the real full resolution of Nexus One, which is 480*800. I am using an orthogonal projection and just want to draw a simple triangle with identity model view matrix: @Override public void sizeChange...

Android SDK and AVD Manager where is Settings menu?

I am dealing with a problem discussed on many forums but they all say go to the "settings" menu on the "Android SDK and AVD Manager" screen. Yet I have installed in on multiple machines and do not see a Settings menu. Where is the menu? I have it installed on Windows XP and Vista. Thanx Julian ...

JSON `date(...)` to `java.Util.Date` using `org.json`

Hey all. I'm learning Java and writing an android app that consumes a JSON object that is passed by the server. I have it all working except the dates. I get one of these back 'SomeKey':'\/Date(1263798000000)\/' I am using org.json.JSONObject. How do i convert SomeKey into a java.Util.Date? ...

Problem using ProgressDialog with onCreateDialog / onPrepareDialog.

I'm using the following code to create a ProgressDialog (inside my Activity): @Override protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_LOOKUP: return new ProgressDialog(this, ProgressDialog.STYLE_SPINNER); } return null; } @Override protected void onPrepareDialog(int id, Dialog dialo...

Android: Animating View position

I'm trying to do something which seems simple. I want to have a map view, with a menu that slides up from the bottom of the screen where settings (for overlay) can be adjusted. However when I use a TranslateAnimation to affect the y position of the LinearLayout (which holds the menu), the buttons in the LinearLayout move, but there "hi...