Android Development

A place to discuss Android Development, Eclipes, the SDK, Java, xml and souch issues.

SimpleCursorAdapter Issue

Hi,

Selected data from SQLite database is placed in a cursor.

I have autocomplete textview in which I want to show only certain columns from cursor (e.g. first and last name).

I've managed to do that, but when I select an item from drop down list from autocomplete textview, it's not showing first and last name as a string (in a autocomplete textbox) but this:

android.database.sqlite.SQLiteCursor@43767ab8.

  1. .....
  2.  
  3. Cursor cursor = db.query("tblUsers", null, null, null, null, null, null);
  4.        
  5.          
  6. String[] from = new String[] { "name", "lastname" };
  7. int[] to = new int[] { android.R.id.text1, android.R.id.text2};
  8.  
  9. textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_users);
  10.            
  11. adapter = new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, cursor, from, to);
  12.            
  13.            
  14. textView.setAdapter(adapter);
  15.  
  16. .....

How to solve this? Please help.

Thanks in advance!

Problems signing a application for android market.

Hi.
I have a ready application that I wish to sign and put on android market. To do so I need to sign the application. From Command I am trying to generate key pair but it fails. I follows the instructions from the developer.android.com/guides but it still dont work. I have set the JAVA_HOME to
C:\Program Files (x86)\Java\jdk1.6.0_24 where it is placed. I also tried to download a new version of jdk today but still doesnt work.
This is what I have been doing. Can anyone please help me what I am doing wrong."

c:\Program Files (x86)\Java\jre6\bin>keytool -genkey -v -keystore micke-release-
key.keystore -alias micke_name -keyalg RSA -keysize 2048 -validity 10000
Type keystore-password: mickesPassword
Type the new password again: mickesPassword
What is your first and last name
[Unknown]: www.micke1977.comule.com/index.html
What is your position in your organisation?

SyncAdapter

In the example SampleSyncAdapter the syncadapter gets a list of users and their statuses by using synchronous calls to the server.

What about if I want to receive the updates asynchronously and accordingly update the native contact application?

I need to do something similar to skype, updating the presence of the contacts periodically.

When is onPerformSync called? How can I inform the synch manager that I have an update and perform the synchronisation?

Should/Can I access the ContactsContract directly without waiting for the onPerformSync to get called?

Eclipse, DigitalClock class not found

Hi everyone/forum,

I was just trying to do my first hello world, when I get into problems.

I'm having some troubles inserting a DigitalClock in my main.xml layout.
I tried with a widget and a "classic" application with the same result.

As said in the subject I'm using eclipse:
Version: Helios Service Release 1
Build id: 20100917-0705

with:
android-sdk_r09-linux_x86.tgz
same results with
android-sdk_r08-linux_86.tgz

the message is:
The following classes could not be found:
- DigitalClock

but, if I write into main.java

  1. DigitalClock foo;  

doesn't throws any error, until I run it, saying:
"Problem loading widget"

If I insert in my layout "" by hand, it doesn't throw an error,
BUT, if i run it, same error message:
"Problem loading widget"

using grep, I can found some results with digitalclock, so I suppose its available.

I'm usin android 2.2, with minsdkversion=8

Unable to run MapActivity!

I followed the tutorial at this address:
http://mobiforge.com/developing/story/using-google-maps-android

However I failed to start this project on my machine. (I updated my MapAPI)
And I have also tried the Hellow Map tutorial on android developer and other similar tutorial, they all gave me the same error message, here is the log:

02-06 02:34:30.777: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.learning.map/.MapsActivity }
02-06 02:34:30.957: INFO/ActivityManager(59): Start proc com.learning.map for activity com.learning.map/.MapsActivity: pid=335 uid=10028 gids={3003, 1015}
02-06 02:34:31.367: DEBUG/ddm-heap(335): Got feature list request
02-06 02:34:31.797: INFO/ARMAssembler(59): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x356798:0x35683c] in 904159 ns
02-06 02:34:31.917: DEBUG/AndroidRuntime(335): Shutting down VM

Unable to run MapActivity!

I followed the tutorial at this address:
http://mobiforge.com/developing/story/using-google-maps-android

However I failed to start this project on my machine. (I updated my MapAPI)
And I have also tried the Hellow Map tutorial on android developer and other similar tutorial, they all gave me the same error message, here is the log:

02-06 02:34:30.777: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.learning.map/.MapsActivity }
02-06 02:34:30.957: INFO/ActivityManager(59): Start proc com.learning.map for activity com.learning.map/.MapsActivity: pid=335 uid=10028 gids={3003, 1015}
02-06 02:34:31.367: DEBUG/ddm-heap(335): Got feature list request
02-06 02:34:31.797: INFO/ARMAssembler(59): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x356798:0x35683c] in 904159 ns
02-06 02:34:31.917: DEBUG/AndroidRuntime(335): Shutting down VM

DJ Skee Presents "Me & My Android"

Have you seen this new commercial for android featuring DJ Skee. This is a good, one check it out now

http://tinyurl.com/4vp24lp

How to make one scroll over three ListView?

I currently have a three ListViews - Photo, Movies and Audio.
Each of these Lists have several items.

ListView is category and it has several items.
Each of these categories have scroll. It is not right for me.

How to made one big scroll over all categories and items?

I am sorry for my eng..

Code:

  1. private SimpleAdapter mPhotoList;
  2.                
  3.         @Override
  4.         public void onCreate(Bundle savedInstanceState) {
  5.                 super.onCreate(savedInstanceState);
  6.                 setContentView(R.layout.tab_media);    
  7.                 ListView photosList = (ListView) findViewById(R.id.photoslist);
  8.                 ListView moviesList = (ListView) findViewById(R.id.movieslist);
  9.                 ListView audioList = (ListView) findViewById(R.id.audiolist);
  10.                
  11.                
  12.                 ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
  13.                 for(int i = 0; i < 10; i++){
  14.                         HashMap<String, String> map = new HashMap<String, String>();
  15.                         map.put("from", "username" + i);
  16.                         map.put("date", "6:30 AM");
  17.                         list.add(map);

Looking for a developer to make an app (paid)

Hi there.

My company recently invested in some Samsung Galaxy tabs, to use on a coming project. However, after many attempts, we have yet managed to train anyone to use succsesfully develop the correct app for us. For this reason we're posting our needs online, and seeing if anyone can help us. We're willing to pay, if anyone is interested, please post your price as well.

The app must-

First present you with a login screen, which can have multiple logins available
Then present them with the option of two different forms, a ?mileage? button, and an ?installation? button. (we may want to add more to this in the future.)

FORM 1 (MILEAGE)
When the Mileage button is pressed, it presents a form with- A name entry text input. A date entry input. A Vehicle reg input. A mileage input, a daily checks completed radio button, and an ?additional comments? input. There must then be a Submit button at the bottom of the screen.

retrieve actual activity layout

Hi,

I'm trying to find out how to retrieve the actual layout of an activity.

Thanks

Syndicate content