android

Create dynamic view with android

Hi I'm stuck on a problem and if possible I will need help from the community. I'm not looking for a ready-made solution, but something which would help me to produce the result. I'm looking for a way to produce a dynamic activity based on a JSONArray object. Here an example of a JSONArray object: [ { "name": "my checkbox name", "...

Why is my searchable activity's Intent.getAction() null?

I've followed the SearchManager documentation yet am still having trouble making one of my app's activities searchable. From my activity, the Search dialog appears, I enter a query, hit search, my activity reopens, then I see this in the log: D/SearchDialog( 584): launching Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=c...

Android: Is it possible to dynamically change the border color of a EditText?

I would like to change the Orange border around a EditText. Like when the input is valid, I want it to become green. However I do not seem to find a method to do this. Is it possible? ...

Setting column width in Table View

I am having a hard time understanding how to change the width of columns when creating a table view. I know you can set the width in pixels of a column but that is not what I want to do. Say, for instance, I have 2 columns and want each column to take up half the screen. How do I do this without explicitly setting the pixels, so that m...

How do I start a service which is defined in a different package?

I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash. From com.gtosoft.dash I would like to start up the service which is defined in com.gtosoft.voyager... I think I need an intent, but what arg(s) would I pass to the intent before kicking it off with startService()? If they were in the same pac...

Android - phone number contact format

Hi In Android I can get phone numbers of all the contacts without any problem. Tha problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included. For example, if the user lives in US and he has 2 contacts: 1) John - 555-123-1234 (local) (starting 1 not showing) 2) ...

Turning a string into a Uri... (Android)

I have a string, 'songchoice' I want it to become a 'Uri' so I can use with MediaPlayer.create(context, Uri) Can someone help me to convert songchoice to the Uri? Thanks, James ...

how do i change android soft keyboard's default language?

Hi. I have made android app. my client ask me that change default language at soft keyboard case by case. one case, keyboard should be English keyboard, another, Korean keyboard. how can i do? thx. ...

Using an object in an if statement... (Android)

I have an object variable Object test = Spinner.getSelectedItem(); -It gets the selected item from the Spinner (called spinner) and names the item 'test' I want to do an if statement related to that object e.g: 'if (test = "hello") { //do something }' But it appears not to work.... Can someone give me some help? -Do I have to use a ...

Does android support playlists for video files?

I'm and android beginner, so go easy on me ;-) I'm trying to play a sequence of video files which I'm downloading from a server. The challenge is that I want to have a smooth transition from one file to another. My thought is to have two MediaPlayer instances each preparing and then playing in turn. It is not clear to me if they can bo...

Converting a string to an integer (Android)

I'm not 100% on how to do this so i'm asking... May seem stupid but... How do I convert a string into an integer? Background info: I have a textbox I have the user enter a number into... it then: EditText et = (EditText) findViewById(R.id.entry1); String hello = et.getText().toString(); gets the string 'hello' Now I wan...

Stopping a track (At a certain point) on Android...

I know you can 'seekto()' with Mediaplayer... (To start at a certain point) But does anyone know if there is a way to make a track (the audio playing)... Stop at a certain point? -or would an if statement on a timer loop have to be used? Please help... Thanks alot, James ...

ListView exception for Images + Text

I am trying to create a simple Icon+Text ListView but it does not work. I am using 2.1 Android SDK. My main class is very small slightly modified from the tutorial: public class Stuffs extends ListActivity { static final String[] COUNTRIES = new String[] {"A", "B","C"}; /** Called when the activity is first created. */ @Ov...

Recording sound, -and then using/saving it... (On android)

I want to add a feature into my app where you can record sound and then use it within the app (MediaPlayer) How can I do this? -First, how do I record sound? -Second, how do I get it into a Mediaplayer? -Does it have to be saved? or can it go from being recorded -> into app straight away... Please help, Thanks alot... James ...

AutoCompleteTextView / ArrayAdapter performance

Hi All! I have an AutoCompleteTextView which the user can enter a name of an airport. the suggestion strings looks like this (for example): John F. Kennedy (JFK) New York, United States I'm using an ArrayAdapter (following the examples in Android documentation) and when I construct it, I provide a List which have items of the sort of:...

Getting started with Android code samples - permissions error

New to android. Running Eclipse on Ubuntu 9.10 with Android SDK plugin installed and working. Trying to get some code samples from http://developer.android.com/resources/samples/get.html , and following its procedure to load said samples in Eclipse yields: Parent of resource: /home/user/android-sdk/platforms/android-4/samples/Notepad/.p...

What is crtbegin.o and crtbegin_dynamic.o?

When debugging a link error (undefined reference to _dso_handle) using the Android x86 toolchain, I noticed it's statically linking crtbegin_dynamic.o. What is the purpose of this file? There is another similar crtbegin.o in the toolchain install directory that contains the missing symbol (_dso_handle). What is the difference between crt...

Loading a Browser Page in the Background

I have a tabbed interface (one activity per tab) where one tab will be a browser view displaying a webpage. The application loads in a different activity / view, but I want it to begin to download the webpage in the background as soon as the app launches, before the user ever clicks on that tab and initiates that activity. How can I do ...

Random.nextInt(5) throws an IllegalArgumentException

EDIT: SORRY! Turns out that I'm an idiot. The exception was being thrown from another call to r.nextInt() which was taking an uninitialized variable as an argument! Foot is very much in mouth. I'm really not sure what else to say about this: Random r = new Random(); class SomeClass { public SomeClass(){ new SomeClass(r.next...

Notification doesn't play sound or show lights even though set to

In my android application I have the following code: Notification notification = new Notification(icon, tickerText, when); context = context.getApplicationContext(); CharSequence contentTitle = "UK Radio Guide"; CharSequence contentText = title + " on " + channel_id + " at " + start; Intent notificatio...