android

How to read Contacts from Android 1.5 emulator?

Hi I created one application to read all the contacts stored in android 2.0 emulator.I want to do the same thing for android 1.5 emulator, but the same code is not working for android 1.5.I don't know how to do it.If any body knows please help me. ...

Android JUnit tests on a non Android Project

I have separated most of my android game code into a separate reusable 'Java Project'. The 'Android project' basically starts a surface View and then loads a new thread containing necessary object from my external 'Java Project'. How could I run JUnit tests on this considering the external 'Java Project' needs an application context. ...

Android: Tabs at the BOTTOM

Hi, I've seen some chatter about this, but nothing definite. Is there a way to put the tabs in a TabWidget to the bottom of the screen? If so, how? I've tried the following, but didn't work: a) setting the tabwidget below the framelayout b) setting the tabwidget's gravity to "bottom" Thanks! llappall ...

How to Programmatically Add Views to Views

Let's say I have a LinearLayout, and I want to add a View to it, in my program from the Java code. What method is used for this? I'm not asking how it's done in XML, which I do know, but rather, how can I do something along the lines of (One View).add(Another View) Like one can do in Swing. Thanks in advance. ...

Need a Horizontal Scroll on Table layout

I am having a Table layout which has 3 columns defined. But due to large Text in the second column, the content is going off the screen. So i was trying to place a horizontal Scrollbar. But was unable to do. I am using Android 1.5 as target. XML code of the table layout <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android...

PreferenceScreen android:summary update !

In my android application I have a PreferenceScreen parent that has 3 CheckBoxPreferences as children. When I click the parent preferenceScreen, and the 3 checkboxes are displayed, I select one of them, and in the Preference.OnPreferenceChangeListener asociated with the checkboxes I set the parent's preferenceScreen summary with: Paren...

Catching onScroll-Events of a ListView created through an IconicAdapter

Hi, I have a ListView stitched together by an IconicAdapter. I want to call a function addNextTenEntries() (which in itself is already working) when the user has scrolled to the bottom of the list, similar to what the Market does (dynamic loading of further entries). I have tried to implement OnGestureListener to catch the Scroll and ...

Android and JUnit: Create a JUnit Project or a test source folder

There is an option to create an Android JUnit Project. As far as I am aware the other way is to create a folder in the same project called test which contains the same package name as the existing project. What are the differences between these two methods. ...

Drawing numbers into a panel?

I was wondering if there was already a component available which the user could use the touchscreen to draw numbers into. If not, I was considering an openGL panel which their input would draw onto, and then I'd need some algorithm to interpret the drawing and parse it to a number. Obviously, I'd prefer a component already exist, but am...

What's the best way to store and access XML in Android?

While I realize resources themselves are defined in XML files, if I have an XML file of my own type that I wish to use, should I be storing them in "res/xml"? Is there a better way to do this such as using assets and then loading them as binary to be parsed by another XML library? ...

Download and upload of data (eg. serialized objects) from a phone to a webserver

I'll be very simple: I want to be able to store Java objects from the phone to a webserver. Then, I want to be able to retrieve them later. What could be a good combination of tools/webservers/languages to achieve this? I have done that before with a serialization of objects through a LAMP server. Example [java object on the android ...

How to bind my activity when a contact entry data, such as birthday is clicked?

How can I bind my application so, when the Birthday entry is clicked on a Contact Entry, it will open up my activity? ...

What is the fieldname to store a birthday for a contact entry?

As you can know, you can store data against a contact on Android phones. I am wondering if there is a standard name to store a birthday against a contact? ...

MockContext() not working in JUnit Test

I am creating a mock context like this: private MockContext context = new MockContext(); But I get the error below when I run as a JUnit Test at the line above. java.lang.RuntimeException: Stub! ...

ListView in AlertDialog

I am using a ListView in an AlertDialog to display a list of items. When the user clicks on one of the items, I want the dialog to close. I would not have any action buttons on the dialog. Any ideas on how I would accomplish this? thanks patrick ...

Problem using setEmptyView on a ListActivity

I have the following setup, and the empty view text doesn't show up... protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getListView().setEmptyView(findViewById(R.id.empty)); getListView().setTextFilterEnabled(true); setListAdapter(null);// to have empty list } The layout...

Basic Java/Eclipse problem: standard libraries cannot be imported in Android project

Hi there, I'm new to Java/Eclipse/Android, so this is probably an easy (if not stupid) question: After creating a new Android project, I want to import some (what I think are standard) java libraries. However, some import statements throw an error: HelloAndroid.java: import java.awt.Color; (The import java.awt.Color cannot be resol...

How do I make an Android library for static linking that includes resources?

I am successfully linking some of my code stored in a .jar-based library to my Android app. The .jar code references Android library content just fine. The problem is I need to include 'res' resources in the library but can't work out how to do this. Any suggestions? ...

Voice Recognition Connection problem

I,m trying to work through and test a Voice Recognition example based on the VoiceRecognition.java example at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html but when click on the button to create the activity, I get a dialog that says Connection problem. My Manifest file is...

Android: parameters in strings.xml possible?

Hello Folks In my android app i'am going to implement my strings with Internationalization. So currently i got a problem with the grammar and the way sentences build in different languages. For example: "5 minutes ago" - english "vor 5 Minuten" - german So my first question is, can i do smth like this in strings.xml: <stri...