[android-developers] Can't understand how to query ContentProvider - java.lang.IllegalArgumentException: Unknown URL

2009-08-16 Thread bw

I'm trying to figure out how to get data from another app's
ContentProvider.

From the docs for ContentProvider (http://developer.android.com/guide/
topics/providers/content-providers.html)
I got that the url format should be:
content://com.example.authority/table_name

I discovered the authority for the needed ContentProvider by going
throughgetPackageManager().queryContentProviders(null, 0, 0);
and then iterating to get the providerInfo.authority.

To get the table name, I found the needed database in the /data/data
folder, and did an sqlite3 .dump on it.

But when I do a query:
managedQuery(content://authority.for.app.i.want.to.access/
table_name, null, null, null, null);

I get the following Exception:

java.lang.IllegalArgumentException: Unknown URL

08-16 01:33:28.703: ERROR/DatabaseUtils(762):
java.lang.IllegalArgumentException: Unknown URL
content://authority.for.app.i.want.to.access/table_name
08-16 01:33:28.703: ERROR/DatabaseUtils(762): at
app.i.want.to.access.Provider.query(ThisAppsProvider.java:430)
08-16 01:33:28.703: ERROR/DatabaseUtils(762): at
android.content.ContentProvider$Transport.bulkQuery
(ContentProvider.java:112)
08-16 01:33:28.703: ERROR/DatabaseUtils(762): at
android.content.ContentProviderNative.onTransact
(ContentProviderNative.java:97)
08-16 01:33:28.703: ERROR/DatabaseUtils(762): at
android.os.Binder.execTransact(Binder.java:287)
08-16 01:33:28.703: ERROR/DatabaseUtils(762): at
dalvik.system.NativeStart.run(Native Method)


Does somebody know how I can fix this?

Thanks
-Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Associate app to open email attachments

2009-08-16 Thread Nivek

Any idea about how to get the real name of the attached file ?

Nivek

On 10 juil, 19:13, Alexey Krasnoriadtsev ale...@agilefusion.com
wrote:
 You are correct that you should use contentResolver.openInputStream
 (uri), to get the data from gmail attachments.

 Default Email app, is very dumb and is hardcoded to only open audio
 and image attachments.
 (disclaimer, that was the case 6 month ago, the last time i looked at
 it).

 On Jul 8, 10:16 am, Mirko Nasato mirko.nas...@gmail.com wrote:



  Hi all,

  I've written an app that can handle the VIEW action for a given
  mimeType, say application/foo. By adding the following to
  AndroidManifest.xml the Browser automatically uses my app to open
  downloads of that type:

    intent-filter
       action android:name=android.intent.action.VIEW/
       category android:name=android.intent.category.DEFAULT/
       data android:mimeType=application/foo/
    /intent-filter

  The GMail app also tries to use my app to Preview attachments of that
  type, but it's passing a URI with scheme gmail-ls:// rather than a
  file:// URI. I guess I need to use a ContentProvider to get the
  attachment data, I haven't looked into that yet.

  But the real mystery is the Email app... there just doesn't seem any
  way to make it open the attachments.

  Any pointers? Opening attachments is a very common requirement of
  course, and I would expect the Android platform to encourage
  developers to write apps to handle more mime types. Instead I couldn't
  find any answers:

   http://groups.google.com/group/android-developers/browse_thread/threa...
   http://groups.google.com/group/android-developers/browse_thread/threa...

  Thanks

  Mirko
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: install apk

2009-08-16 Thread Nivek

You may call the default apk installer by sending an ACTION_VIEW
intent on the apk file ?

File managers like Astro or OI File Manager seem to let users install
apks that way.

Nivek

On 15 août, 18:20, engin enginarsla...@gmail.com wrote:
 Hi, how can I install .apk file by using java code. that is , we can
 install .apk from cmd
 adb install program_name.apk I wonder that how can we install .apk
 file bu using another program. To summarize I will have button and
 when user click it another program(in sdcard) will be installed to
 phone. Thanks for reply.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Many Listviews problem

2009-08-16 Thread Aayush

Hi,

I want to show many listviews in one activity. Something like

Textview
Listview
TextView
Listview
..

Every listview has different type of adapter. For this, I made the
activity class like:-

public class ListTestActivity extends ListActivity {

public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.screen); // screen.xml file
setListAdapter(new CustomAdapter(this);
...
}


class CustomAdapter extends ArrayAdapter {
Activity context;

public View getView(int position, View convertView,  ViewGroup parent)
{
...
}

In screen.xml file if I define Listview like:-

ListView
android:id=@android:id/list

I can get one listview with the custom adapter in this kind of
arrangement.
But when I replace it by  android:id=@+id/list2 and use it as
R.id.list2, it throws nullpointer exception.

Any pointers for this problem??

Thanks,
Aayush

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Can't understand how to query ContentProvider - java.lang.IllegalArgumentException: Unknown URL

2009-08-16 Thread bw

Figured it out.
Making the url all lower-case letters made the error go away  ( even
though table name had capital letters in it ).



On Aug 16, 2:13 am, bw ben.weisb...@gmail.com wrote:
 I'm trying to figure out how to get data from another app's
 ContentProvider.

 From the docs for ContentProvider (http://developer.android.com/guide/
 topics/providers/content-providers.html)
 I got that the url format should be:
 content://com.example.authority/table_name

 I discovered the authority for the needed ContentProvider by going
 through    getPackageManager().queryContentProviders(null, 0, 0);
 and then iterating to get the providerInfo.authority.

 To get the table name, I found the needed database in the /data/data
 folder, and did an sqlite3 .dump on it.

 But when I do a query:
 managedQuery(content://authority.for.app.i.want.to.access/
 table_name, null, null, null, null);

 I get the following Exception:

 java.lang.IllegalArgumentException: Unknown URL

 08-16 01:33:28.703: ERROR/DatabaseUtils(762):
 java.lang.IllegalArgumentException: Unknown URL
 content://authority.for.app.i.want.to.access/table_name
 08-16 01:33:28.703: ERROR/DatabaseUtils(762):     at
 app.i.want.to.access.Provider.query(ThisAppsProvider.java:430)
 08-16 01:33:28.703: ERROR/DatabaseUtils(762):     at
 android.content.ContentProvider$Transport.bulkQuery
 (ContentProvider.java:112)
 08-16 01:33:28.703: ERROR/DatabaseUtils(762):     at
 android.content.ContentProviderNative.onTransact
 (ContentProviderNative.java:97)
 08-16 01:33:28.703: ERROR/DatabaseUtils(762):     at
 android.os.Binder.execTransact(Binder.java:287)
 08-16 01:33:28.703: ERROR/DatabaseUtils(762):     at
 dalvik.system.NativeStart.run(Native Method)

 Does somebody know how I can fix this?

 Thanks
 -Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Struggling -- SearchSuggestionSampleProvider issues

2009-08-16 Thread Dianne Hackborn
Just pick a name that is in your own namespace.  It is the global name for
your provider.  It MUST be unique, and in a namespace you own.

On Sat, Aug 15, 2009 at 10:47 PM, venkat chowdhary nit.ve...@gmail.comwrote:


 Many Thanks Jeff ...

 Sorry for asking too basic things ...

 I am uninstalled the ApiDemos/searchInvoke example. Now my application
 is launching.
 After launching, globla search is working but Type-to-search
 (basically local seacrh) is not working.

 Btw, What is
 android:authorities=com.example.android.apis.SuggestionProvider ?

 I don't see any class with name SuggestionProvider in the Android
 examples ApiDemos, and what is the purpose of this class?

 If i need to prepare my own android:authorities, can you please please
 help me how to prepare?

 Thanks  Regards

 On 8/16/09, Jeff Sharkey jshar...@android.com wrote:
 
  The installation error (INSTALL_FAILED_CONFLICTING_PROVIDER) told you
  what was wrong.  You gave your provider the authority
  com.example.android.apis.SuggestionProvider which was already being
  used by another app on the system.
 
  Choose another authority so it doesn't conflict.  Usually one that
  lives inside of your package space works best.
 
  j
 
  On Sat, Aug 15, 2009 at 6:00 AM, Venkatnit.ve...@gmail.com wrote:
 
  Hi
 
  Please help me.
  I am adding search suggestion in my application. When i ran only
  AoiDemos/searchInvoke application, its worked fine. But when i am
  added the same code in my application its giving below error when
  starting application.
 
  009-08-15 13:12:26 - MyApplication] Installing MyApplication.apk...
  [2009-08-15 13:12:38 - MyApplication] Application already exists.
  Attempting to re-install instead...
  [2009-08-15 13:12:54 - MyApplication] Installation error:
  INSTALL_FAILED_CONFLICTING_PROVIDER
  [2009-08-15 13:12:54 - MyApplication] Please check logcat output for
  more details.
  [2009-08-15 13:12:55 - MyApplication] Launch canceled!
 
  When i remove the below code from AndroidManifest.xml, application is
  lannching fine.
 
  provider android:name=.search.SearchSuggestionSampleProvider
  an.droid:authorities=com.example.android.apis.SuggestionProvider /
 
  Can someone please help me how to resolve this issue?
  Thanks in advance.
 
  Thanks  Regards
  Venkat
  
 
 
 
 
  --
  Jeff Sharkey
  jshar...@android.com
 
  
 

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google Dev Phone unavavailable! will they extend ADC II deadline..who to ask?!

2009-08-16 Thread alex

Just get an unlocked G1 on ebay and then root it. No big deal.

On Aug 15, 7:22 am, -v- vishal.changr...@gmail.com wrote:
 Hi,
 I wanted to test my app that I plan to submit for ADC II. But the dev
 phone from google is unavailable till sept first week! How are we
 suppose to test it?! I dont want to sign a contract with T Mobile just
 to test my app.
 There is no contact email on ADC II !!
 Will they extend ADC II deadline?
 This contest is very poorly managed by Google standards if u ask me!
 -v-
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] SQL Server Connection

2009-08-16 Thread engin

Hi, I am tryıing to connect remote ms sql server 2005  and tried
something but I could'nt. Does any of you know to connect sql server?
I searched and I realize that Driver must be loaded. Do you know how
can we do this?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: sharing database across applications

2009-08-16 Thread Kenny

How to make a custom content provider? Can you give me an example?

Now I am trying to extend ContactsProvider, because it can't give me
the approach to the last modified contact record. So I wonder if I can
create a custom contact provider.

Or anyone knows how to find out the last modified contact?

On Aug 11, 2:01 pm, Sujay Krishna Suresh sujay.coold...@gmail.com
wrote:
 My suggestion'd be to go for the custom content provider.
 That'd make things much easier for u...
 But thats me. It depends on ur application  its current architecture.





 On Tue, Aug 11, 2009 at 10:43 AM, Acchao blazin...@gmail.com wrote:

  What's the most convenient way to share a database across
  applications?
  For example, I want my application's dbadapter to query the android's
  native contact database so when a contact on the phone is deleted,
  similarly that contact is removed from my application.

  Should i use an attach statement to attach the table? Or would the
  better/more secure approach be to create a custom contentprovider
  query onCreate of my app to verify all contacts in my application
  still reside on the Contacts.db ?

  Any help or suggestions would be appreciated. Thanks in advance.

  Best,
  Acchao

 --
 Regards,
 Sujay
 Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html
 - Computers are useless. They can only give you answers.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] get version from apk

2009-08-16 Thread engin

Hi, can I get version from .apk file. I tried to open
androidmanifest.xml but I realized that xml files are destructed when
apk created.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: AndroidAPI App

2009-08-16 Thread Steve

Great idea!

How much space does it need?


On Aug 14, 11:34 am, Andrei gml...@gmail.com wrote:
 I wrote my first Hello World App for Android: AndroidAPI

 It should be useful for Android developers

 Actually it provides full Android Java API on your Android phone and
 does not require connection

 Search for AndroidAPI in Market
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] launching m3u playlist with intent

2009-08-16 Thread Seb

Hi,

Is there a way to launch a playlist whith intent?

I can retrieve the path of the m3u playlist with:
Cursor cursor = context.getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
null);
cursor.getString(cursor.getColumnIndex
(MediaStore.Audio.Playlists.DATA));

But, I can't launch this m3u file neither with Intent nor with
MediaPlayer.

Is there a way to do this?

Thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to make phone silent?

2009-08-16 Thread Teo

Hi,

has anyone made the phone silent from code? Is there any permission
needed? I am using this method, but it's doing nothing:

((AudioManager) context.getSystemService(Context.AUDIO_SERVICE))
.setMode(AudioManager.RINGER_MODE_SILENT);

Thanks,
Teo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google Dev Phone unavavailable! will they extend ADC II deadline..who to ask?!

2009-08-16 Thread Maps.Huge.Info (Maps API Guru)

You don't need a rooted phone to test an app.

-John Coryat
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Disabling title on the WebView:

2009-08-16 Thread Mark Murphy

Kumaravel Kandasami wrote:
 Being that we are constraint with screen space, I would like to hide the
 title bar on the WebView component?

Add android:theme=@android:style/Theme.NoTitleBar to the activity in
the manifest.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] GPS ,accuracy of the GPS receiver

2009-08-16 Thread Lorenz

How much accurate are the coordinates received by the GPS antenna in
the reality?I'm using the emulator but it doesn't work well with
coordinates too much close...is there nobody that have tested an
application based on the package Location in a real device(I don't
have a real one yet..) and knows how to answer me?..
Lorenz

thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SQL Server Connection

2009-08-16 Thread Mark Murphy

engin wrote:
 Hi, I am tryıing to connect remote ms sql server 2005  and tried
 something but I could'nt. Does any of you know to connect sql server?
 I searched and I realize that Driver must be loaded. Do you know how
 can we do this?

Write a Web service that runs on the Web server that performs the
operations you need. Then, access the Web service via HttpURLConnection
or HttpClient from Android.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Many Listviews problem

2009-08-16 Thread Mark Murphy

Aayush wrote:
 Hi,
 
 I want to show many listviews in one activity. Something like
 
 Textview
 Listview
 TextView
 Listview
 ..
 
 Every listview has different type of adapter. For this, I made the
 activity class like:-
 
 public class ListTestActivity extends ListActivity {
 
 public void onCreate(Bundle savedInstanceState){
   super.onCreate(savedInstanceState);
   setContentView(R.layout.screen); // screen.xml file
 setListAdapter(new CustomAdapter(this);
 ...
 }
 
 
 class CustomAdapter extends ArrayAdapter {
   Activity context;
 
 public View getView(int position, View convertView,  ViewGroup parent)
 {
 ...
 }
 
 In screen.xml file if I define Listview like:-
 
 ListView
   android:id=@android:id/list
 
 I can get one listview with the custom adapter in this kind of
 arrangement.
 But when I replace it by  android:id=@+id/list2 and use it as
 R.id.list2, it throws nullpointer exception.
 
 Any pointers for this problem??

ListView thisIsYourSecondList=(ListView)findViewById(R.id.list2);

thisIsYourSecondList.setAdapter(ohSomeAdapterGoesHere);

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Arbitrary shape ImageView

2009-08-16 Thread Long

Thanks for your advice.
I need to calculate whether the event happens
inside my shape in onTouch or onClick, right?

Or the framework can do that according to the alpha panel of the
background image?

Anyway, I will do some experiments.



Cheers.
Long

On Aug 15, 1:20 am, Balwinder Kaur (T-Mobile USA) balwinder.k...@t-
mobile.com wrote:
 You can do that by setting the appropriate listeners.

 ImageView iv = (ImageView)findViewById(R.id.ImageView01);
 iv.setBackgroundResource(android.R.drawable.ic_delete); // You can set
 your arbitrary image here.
 iv.setOnTouchListener(new OnTouchListener(){
                 public boolean onTouch(View v, MotionEvent event){

                         //...
                 }
         });
 iv.setOnClickListener(new OnClickListener () {
                 public void onClick(View v){
                         //
                 }

         });
 Balwinder Kaur
 Open Source Development Center
 ·T· · ·Mobile· stick together

 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.

 On Aug 14, 1:56 am, Long long...@gmail.com wrote:

  Hi guys,
     I need some arbitrary shape imageView that can respond events.
     How can I do that?

     Thanks.
  Cheers.
  Long


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Custom component rare exception: Parser is not a BridgeXmlBlockParser!

2009-08-16 Thread ff

Hi! I've created custom compound component and observe very strange
exception (google says nothing about it).
It is very simple:

public class MyTabber extends LinearLayout {
..
public MyTabber(Context context) {
super(context);
Init(context);
}
..+2 overloads
Button x = null;
public void Init(Context context)
{
x = new Button(getContext());
addView(x); // exception seems to be here
}

The layout where I use the component is also simple and has the
following occurense:
com.roma.second.MyTabber xmlns:android=http://schemas.android.com/
apk/res/android
id=@+id/yes
android:layout_width=fill_parent
android:layout_height=fill_parent
/

When I try to edit layout (in visual representation) - I get:

[2009-08-16 17:59:48 - main.xml] Parser is not a BridgeXmlBlockParser!
java.lang.NullPointerException
at android.view.ViewGroup.addView(ViewGroup.java:1661)
at android.view.ViewGroup.addView(ViewGroup.java:1648)
at com.roma.second.MyTabber.Init(MyTabber.java:49)
at com.roma.second.MyTabber.init(MyTabber.java:31)

Please advice...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] GmapActivity Only marker Touch Listener

2009-08-16 Thread rizwan

Hi All ,

I have extended a MapActivity and add a marker over it like
this ..

 MapView mapView = (MapView) findViewById(R.id.mapView);

mapOverlays =mapView.getOverlays();
drawable = this.getResources().getDrawable
(R.drawable.androidmarker);
itemizedOverlay = new SimpleOutItemizedOverlay(drawable,this);


GeoPoint point = new GeoPoint(1924,-9912);
OverlayItem overlayitem = new OverlayItem(point, , );

itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);



 mapView.setBuiltInZoomControls(true);

in my SimpleOutItemizedOverlay class which inherits from
ItemizedOverlay I only want to Listen only when particular marker
(place on map ) is touched or clicked .
  @Override
 public boolean onTouchEvent(MotionEvent event, MapView mapView)

Listen on whole Map . I just want to listen on a particular markers
touched or Clicked Event. let me know how can I setListener on that
Event.

Thanks
Rizwan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Google Maps kills process with oom_adj=7

2009-08-16 Thread Klaus Kartou
Hi all!

I have an application where I start Google Maps with an intent like this:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));

The thing is that I can see that my app gets killed when I use the map,
especially when I go to street view.
I use: adb shell dumpsys activity to inspect the running processes and my
app has oom_adj=7.Why does this happen and is there anything I can do to
make my app have a higher priority, thereby preventing it from getting
killed so easily?

Cheers!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Alternative Android Markets

2009-08-16 Thread droidin.net

Sorry reposting here. It seems that I'm not able to post to Android
Discuss r my posts are getting ignored

I have 2 apps (DroidIn) on Market for some time now. Lately I start
getting offers from Taiwanese/Chinese mobile leaders companies
offering to host and resell the app. They are offering to help with
translation and provide links to some Chinese-language sites like
this http://android.sj.91.com/. I followed up with one of the offers
and got bunch of documents and generally my cut would be 40% before
taxes. Now, 40% to 2 billion people is not such a bad deal but I'm
wondering if someone already has similar experience and is this
possible some sort of scam?

I'm not implying anything these may be legit offers, but one cannot be
too careful these days
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] how to dial voicemail?

2009-08-16 Thread Flying Coder


According to the docs, the following should work:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_DIAL);
intent.setData(Uri.parse(voicemail:));

startActivity(intent);

But this just brings up the dialer without a number showing.

Anyone know how to launch the dialer with the voicemail number (or
otherwise lookup the voicemail number)?

Thanks :-)

Steve

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Retrieving List type from remote service

2009-08-16 Thread D

This seems to be the fix.

oneway interface IRemoteServiceCallback {
 /**
  * Called when the service has a new value for you.
  */
 void valueChanged(int value);
 void valueChangedList(in List values);
 void valueString(String value);

}

On Aug 15, 12:44 am, D donnie.h@gmail.com wrote:
 Hi,

 I am having trouble passing a List type from a remote service to the
 UI activity.
 Here is a modified version of RemoteService example from the APIDemo.
 (only included where its modified)

 PROBLEM: The call back function (for List) is called successfully, but
 the List returned is empty...

 It works fine when the service does not run in a remote process.
 (w/o android:process=:remote in the manifest file)

 Why is this happening...?

 Also, when I tried Map type, it didn't even successfully generate a
 IRemoteServiceCallback.java file
 it tries to do new Map() and complains that its an abstract
 class..
 (FYI, List instantiates by new ArrayList())

 1. in IRemoteServiceCallback.java

 oneway interface IRemoteServiceCallback {
     /**
      * Called when the service has a new value for you.
      */
     void valueChanged(int value);
     void valueChangedList(out List values);
     void valueString(String value);

 }

 2. In RemoteServiceBinding.java
   /**
      * This implementation is used to receive callbacks from the
 remote
      * service.
      */
     private IRemoteServiceCallback mCallback = new
 IRemoteServiceCallback.Stub() {
         /**
          * This is called by the remote service regularly to tell us
 about
          * new values.  Note that IPC calls are dispatched through a
 thread
          * pool running in each process, so the code executing here
 will
          * NOT be running in our main thread like most other things --
 so,
          * to update the UI, we need to use a Handler to hop over
 there.
          */
         public void valueChanged(int value) {
                 Log.d(ee, valuechanged= + value);
                 mHandler.sendMessage(mHandler.obtainMessage(BUMP_MSG, value,
 0));
         }

                                 public void valueChangedList(List values) 
 throws RemoteException {
                                         // TODO Auto-generated method stub
                                         Log.d(ee, valuechangedlist= + 
 values.toString());
                                         
 mHandler.sendMessage(mHandler.obtainMessage(LIST_MSG, values));
                                 }

                                 public void valueString(String value) throws 
 RemoteException {
                                         Log.d(ee, valueString= + value);
                                 }
     };

 3. In RemoteService.java

    private final Handler mHandler = new Handler() {
         @Override public void handleMessage(Message msg) {
             switch (msg.what) {

                 // It is time to bump the value!
                 case REPORT_MSG: {
                     // Up it goes.
                     int value = ++mValue;

                     // Broadcast to all clients the new value.
                     final int N = mCallbacks.beginBroadcast();
                     for (int i=0; iN; i++) {
                         try {
                             mCallbacks.getBroadcastItem(i).valueChanged
 (value);
                                         ListString values = new 
 ArrayListString
 ();
                                         values.add(Hello, Mars);
                                         mCallbacks.getBroadcastItem
 (i).valueChangedList(values);
                                         
 mCallbacks.getBroadcastItem(i).valueString
 (HEEE);
                         } catch (RemoteException e) {
                             // The RemoteCallbackList will take care
 of removing
                             // the dead object for us.
                         }
                     }
                     mCallbacks.finishBroadcast();

                     // Repeat every 1 second.
                     sendMessageDelayed(obtainMessage(REPORT_MSG),
 1*1000);
                 } break;
                 default:
                     super.handleMessage(msg);
             }
         }
     };
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: launching m3u playlist with intent

2009-08-16 Thread Marco Nelissen

On Sun, Aug 16, 2009 at 6:11 AM, Sebsxercav...@gmail.com wrote:

 Hi,

 Is there a way to launch a playlist whith intent?

No.

 I can retrieve the path of the m3u playlist with:
 Cursor cursor = context.getContentResolver().query
 (MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
 null);
 cursor.getString(cursor.getColumnIndex
 (MediaStore.Audio.Playlists.DATA));

 But, I can't launch this m3u file neither with Intent nor with
 MediaPlayer.

 Is there a way to do this?

 Thanks in advance


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: launching m3u playlist with intent

2009-08-16 Thread Marco Nelissen

Well, OK, that's not entirely true. While you can't play an arbitrary
m3u file, you can play playlists that are in the database (which may
have come from m3u files originally, in which case there path is in
the _data column).
To see how, you can look at what happens when you put a shortcut to a
playlist on the home screen and then launch it.


On Sun, Aug 16, 2009 at 12:21 PM, Marco Nelissenmarc...@android.com wrote:
 On Sun, Aug 16, 2009 at 6:11 AM, Sebsxercav...@gmail.com wrote:

 Hi,

 Is there a way to launch a playlist whith intent?

 No.

 I can retrieve the path of the m3u playlist with:
 Cursor cursor = context.getContentResolver().query
 (MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
 null);
 cursor.getString(cursor.getColumnIndex
 (MediaStore.Audio.Playlists.DATA));

 But, I can't launch this m3u file neither with Intent nor with
 MediaPlayer.

 Is there a way to do this?

 Thanks in advance


 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android : Data Traffic switing between Radio and Wifi link

2009-08-16 Thread Kartick Vaddadi

Don't you need something like SCTP to transparently failover a
connection from interface to another? I thought TCP does't support
that.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Contact Picker doesn't work on Hero

2009-08-16 Thread zimmbi

I've some problems with the contact picker on a htc hero. Code looks
like this:

Intent i = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);
startActivityForResult(i, PICK_CONTACT_FROM_LIST);

In the emulator it works just fine, but on the htc hero i can't search
the list. If I just insert 1 letter in the search bar, all contacts in
the list disappear.

Any ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] raw pcm

2009-08-16 Thread Vignesh2972

Hello,
I need to implement an audio buffer of 2mins duration. which remmebers
only the past 2 mins of audio from the mic. I understand that this is
possible with AudioRecord, but then would it be possivble to conver
this raw PCM data to 3GPP?
Pls help.
Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Master Clear From Code does not work

2009-08-16 Thread amit

hi,

I am writing an application in which I need to call Master Clear under
a specifi condition.
But I am getting permission error.

My Code:
===

AndroidManifest.xml
-
  uses-permission android:name=android.permission.MASTER_CLEAR /



Calling Master Clear Code (similar to code present in Settings of
Android)
-

ICheckinService service =
ICheckinService.Stub.asInterface(ServiceManager.getService
(checkin));
if (service != null) {
try {
service.masterClear();
} catch (android.os.RemoteException e) {
Log.e(MasterClear, Some Error Here !!);
}
}

Observation / Error / Output (in DDMS)
---
PermissionDenial : can't invoke masterClear from PID=965, uid = 10019



When I go to menu==settings==Application Settings==Manage
Applications == my app == permissions, I dont see any permissions
assigned to my app which means the app does not have the permissions.
But I have set the permission for master clear ( uses-permission
android:name=android.permission.MASTER_CLEAR /) in the
AndroidManifest.xml but it does not seem to work. Can anyone help.

Thanks,
Amit

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to get other applications touch screen x,y values when application running in the background?

2009-08-16 Thread Tsung-Ming

I want to use an AP running in the background, and can get the other
AP touch screen x,y values.
Beacause i use the View class the ontouchevent, but this seems to get
current AP running touch event.
Which the class or function can meet the needs of this.

Can provide the program or books to reference.

Thanks,

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: adc2 submission site

2009-08-16 Thread siuying

Glad to hear that I'm not the only one having this question!

On 8月15日, 下午12時36分, sleith raysle...@gmail.com wrote:
 Hi, i've just purchased to be an android developer
 when i visithttp://market.android.com/publish, i don't see anything
 about publish for adc 2
 how to submit app for adc 2 ?
 thank you

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Click on Status bar notification switch to task in current state?

2009-08-16 Thread Gustav Mauer

My applications carries on processing when the user presses the home 
key, and generates status bar notifications if something happens the 
user requested to be notified about.

If a user holds the home key and then selects the application, it is 
restored in its correct state with the activity on top that showed when 
the user left.

However, since the intent that is associated with the status bar 
notification is FLAG_ACTIVITY_NEW_TASK and I put in the class name of 
the activity that launched the application (I assume this is what I must 
do?), the launcher activity is started when the notification is 
clicked. I can then switch the application back to the current 
activity by starting that active activity again, but then I seem to 
have two instances of the activity in memory, since I have to press back 
twice to leave it. And I suspect my activity stack is then messed up as 
well.

I have set the launcher activity to be singleTask, but that only helped 
a bit. From my reading I thought this would just give the task focus if 
the launcher activity is not on top, but instead it gives the launcher 
activity the focus.

Is there a way for a notification click to work more like the task 
switcher provided by long pressing the home button? Thank you in advance 
for any advice.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Doing something every second

2009-08-16 Thread Rexxars

Hi,

I'm trying to create a remote control for a media player
(communicating with a TCP socket over Wifi).
When it retrieves information about the current song being played, it
gets the current position and total duration of the song.
Obviously, what I want is a MM:SS display of the current position.
What is the best way to achieve this?
I could use a thread which sleeps, but that's not very accurate. What
is the proper way of making it update every second?

Thanks in advance!

- Rexxars

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SQL Server Connection

2009-08-16 Thread engin

I did not understan what you mean :( Can you give a detail and code if
possible

On Aug 16, 5:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 engin wrote:
  Hi, I am tryıing to connect remote ms sql server 2005  and tried
  something but I could'nt. Does any of you know to connect sql server?
  I searched and I realize that Driver must be loaded. Do you know how
  can we do this?

 Write a Web service that runs on the Web server that performs the
 operations you need. Then, access the Web service via HttpURLConnection
 or HttpClient from Android.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Looking for Android opportunities?http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ScrollView vs. android:scrollbarAlwaysDrawVerticalTrack

2009-08-16 Thread Flo

Hi,

maybe this is a beginners question, but its not about SDK setup, so in
this group.
I'm developing since Months, and now - finetuning the app, I am stuck
with scrolling.
However.

If you know a good howto about scrolling , post it and your're done ;)
If not please read below.

The class View has multiple scrolling-related properties, so each
subclass is actually aware of scrolling.
So - in theory - there should be no need to introduce special Views
like HorizontalScollView and ScrollView, right? Besides convenience,
of course.
LinearLayout
   some fixed size Views
   ViewFlipper
   RelativeLayout   -- not necessarilty, any working thing
would do.
   my Child, extending View/  -- may be large in x and
y (sizing also at runtime dynamically, as will change the size for
zooming)
   /RelativeLayout
   /ViewFlipper
/LinearLayout



My Question is very simple:
How can I put a large child into a smaller parent, exceeding X and Y
without cutting the child?*)



Which attributes have to be set how?

I am currently using ScrollView inside a  HorizontalScrollView, which
does not support xy scrolling at the same time.

I'd expect the built-in scroll features to be activated, when a child
view gets larger, than the parent allows.
But where do the attributes have to be set?
On the most-inner scroller or the most-outer scrollee?

Are the scroll related drawables a must to be used, or just in case I
want special-looking scroll bars?

Very-most attempts failed to show scrollbars at all, only using the
dedicated classes worked.
Is the build-in scrolling related to layout_width and layout_height
attribute values fill_parent and wrap_content?

Does it matter for a common application (no widget) that the classes
reside in the widget subpackage? It works, but is it intended to be
used that way?

Thanks  best regards,
Flo

*) good to know that software guys understand this sentence different
than the rest of the world

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to register for SMS database changes

2009-08-16 Thread n179911

Hi,

How can I register for SMS database changes?

I tried:
mCursor = mActivity.getContentResolver().query(Sms.CONTENT_URI, new String[] {
Sms.ADDRESS
}, null, null, null);


 mCursor.registerDataSetObserver(mydataSetObserver);

where mydataSetObserver is implemented like this:
  private class MyDataSetObserver extends DataSetObserver {
public void onChanged() {
System.out.println (1);
}
public void onInvalidated() {
 System.out.println (2);
}
}

But when I tried sending a SMS message in the emulator,
MyDataSetObserver never get called.

Can you please tell me why?

Thank you.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to make phone silent?

2009-08-16 Thread Michael Leung
try the premission:
   
MODIFY_AUDIO_SETTINGShttp://developer.android.com/reference/android/Manifest.permission.html#MODIFY_AUDIO_SETTINGS
Allows
an application to modify global audio settings
MODIFY_PHONE_STATEhttp://developer.android.com/reference/android/Manifest.permission.html#MODIFY_PHONE_STATE
Allows
modification of the telephony state - power on, mmi, etc.
your code seems to need the premission to audio and phone state


On Sun, Aug 16, 2009 at 11:23 PM, Teo teomina...@gmail.com wrote:


 Hi,

 has anyone made the phone silent from code? Is there any permission
 needed? I am using this method, but it's doing nothing:

 ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE))
.setMode(AudioManager.RINGER_MODE_SILENT);

 Thanks,
 Teo
 



-- 
Regards,
Michael Leung
http://www.itblogs.info
http://www.michaelleung.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android : Data Traffic switing between Radio and Wifi link

2009-08-16 Thread Roman ( T-Mobile USA)

For being able to switch radio interfaces you have to make sure what a
platform can support. These are the following possibilities

1. only one radio at the same time. Browsing, instant messaging type
of data connection can be supported. User is not necessarily  impacted
by switching the radio

2. only one data connection but multiple radios can be up at the same
time. Radios can be switched with keeping a Voip connection alive but
with a small interruption (break before make, which means that the
Voip connection is interrupted for a short time)

3. multiple radios at the same time. With usage of protocols like SCTP
and mobile IP connections can be seamlessly switched (make before
break approach).

Android right now allows only one radio at the same time. But it is
possible to modify the platform to support 2. and 3.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Aug 15, 9:04 pm, Kartick Vaddadi kartik@gmail.com wrote:
 Don't you need something like SCTP to transparently failover a
 connection from interface to another? I thought TCP does't support
 that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Parse or not to parse?

2009-08-16 Thread droidin.net

I guess to definitely answer this, one needs to run some benchmarks
but I'll ask anyway. In you opinion/experience what would work faster
after initial HTML is grabbed from the remote source. (The HTML is
group of one or two level nested OL or UL within body tag and some
DIVs)

1. Using WebView/JS/CSS to customize and render HTML into list-like UI
2. Parse HTML into ListAdapter and then use ListView to render it

My experience with #1 shows that it is actually pretty slow. Weird
thing is - once rendered - JS works quite well and fast it's really
initial parsing and loading that produces the delay
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Parse or not to parse?

2009-08-16 Thread Mark Murphy

droidin.net wrote:
 I guess to definitely answer this, one needs to run some benchmarks
 but I'll ask anyway. In you opinion/experience what would work faster
 after initial HTML is grabbed from the remote source. (The HTML is
 group of one or two level nested OL or UL within body tag and some
 DIVs)
 
 1. Using WebView/JS/CSS to customize and render HTML into list-like UI
 2. Parse HTML into ListAdapter and then use ListView to render it
 
 My experience with #1 shows that it is actually pretty slow. Weird
 thing is - once rendered - JS works quite well and fast it's really
 initial parsing and loading that produces the delay

#2 will be limited by how clean your HTML is, unless you use TagSoup or
something to parse it, and I have no idea if TagSoup or kin run on Android.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Parse or not to parse?

2009-08-16 Thread droidin.net

Say it's clean enough to write a SAX handler with few possible
exception handling lines. I really don't want 3rd party jars. With
that aside - will it be faster to use ListView?

Bo

On Aug 16, 4:58 pm, Mark Murphy mmur...@commonsware.com wrote:
 droidin.net wrote:
  I guess to definitely answer this, one needs to run some benchmarks
  but I'll ask anyway. In you opinion/experience what would work faster
  after initial HTML is grabbed from the remote source. (The HTML is
  group of one or two level nested OL or UL within body tag and some
  DIVs)

  1. Using WebView/JS/CSS to customize and render HTML into list-like UI
  2. Parse HTML into ListAdapter and then use ListView to render it

  My experience with #1 shows that it is actually pretty slow. Weird
  thing is - once rendered - JS works quite well and fast it's really
  initial parsing and loading that produces the delay

 #2 will be limited by how clean your HTML is, unless you use TagSoup or
 something to parse it, and I have no idea if TagSoup or kin run on Android.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Development Wiki:http://wiki.andmob.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Parse or not to parse?

2009-08-16 Thread Mark Murphy

droidin.net wrote:
 Say it's clean enough to write a SAX handler with few possible
 exception handling lines. I really don't want 3rd party jars. With
 that aside - will it be faster to use ListView?

That's really impossible to say in the abstract, as you suggested in
your OP.

I can tell you that SAX parsing on big data sets is slow. I've had to
parse some 100K-and-up XML files and it is not speedy.

On the other hand, I've found that WebView has a startup penalty the
first time you fire one up in a process. After that, for the second and
subsequent times you create one, it's not bad.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How do I use FileObservor ?

2009-08-16 Thread Mapara,Harshit Nitinkumar

Hi All,

I want to observ file changes, and I found FileObservor class in
android.os package, but I could not find any of it tutorial on the
internet nor in android reference documents.

I tried it but could not succeed.
Can you please explain me using a simple example how do I use it? Any
link if you know, please let me know.

Thanks
Harshit
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How do I use FileObservor ?

2009-08-16 Thread Barry Wei

maybe this FileObservor class is empty. i found many of these class
empty in Android sdk.

my advice is ,my friend,u should download android source and javac
them for urself. that may helps.

On Aug 17, 8:50 am, Mapara,Harshit Nitinkumar hnmap...@gmail.com
wrote:
 Hi All,

 I want to observ file changes, and I found FileObservor class in
 android.os package, but I could not find any of it tutorial on the
 internet nor in android reference documents.

 I tried it but could not succeed.
 Can you please explain me using a simple example how do I use it? Any
 link if you know, please let me know.

 Thanks
 Harshit
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Determine what's the active package or activity running?

2009-08-16 Thread Don Tran

I want my background service to determine the active package or
activity running.  Is this possible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Does cupcake support Webview with Gears ?

2009-08-16 Thread Kumar

I had to manually write code to mimic the Gears feature.
Being that Gears will not be supported by WebView, I am curious when
HTML5 standard will be supported in the WebView component?

So we could reuse code in between iPhone/Android.

Thanks,
Kumar

On Aug 14, 5:44 am, Samuel Michelot samuel.miche...@gmail.com wrote:
 On 13 août, 18:08, String sterling.ud...@googlemail.com wrote:

  Have you looked at PhoneGap?http://phonegap.com

  I'm not certain about the maturity of their Android support, but I
  know there's at least a foundation, and would give you a real head
  start on this.

 Yes, I know phonegap, but it currently doesn't support DB because of
 this problem...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] how to send motion event to activity?

2009-08-16 Thread gguoling

Hi all,
I am developing an  input method with full screen size views, How can
I send a grabbed motion event to the client applications?

Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding a new xml attribute in framewrok

2009-08-16 Thread gopu

To add in com.android.internal.R what id(int value) i have to
use?.It should be auto generated right?.


On Aug 16, 4:22 am, Romain Guy romain...@google.com wrote:
 Do not add it to public.xml, it's an incompatible change. Use
 com.android.internal.R instead.

 On Aug 15, 2009 1:51 PM, Jeff Sharkey jshar...@android.com wrote:

 You also need to assign it a specific value in public.xml, otherwise
 it remains internal.

 j

 On Sat, Aug 15, 2009 at 12:05 AM, GPUgopuraj...@gmail.com wrote:   Hi ,
Can anyone tell ,...

 Jeff Sharkey
 jshar...@android.com

 --~--~-~--~~~---~--~~ You received this
 message because you are sub...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to use CheckBox as children in ExpandableList?

2009-08-16 Thread frankjoshua

Has anyone tried this yet. I am getting strange results. When I click
on one of the check boxes a second one will sometimes become checked
also.

On Aug 3, 1:04 am, powerbyte powerb...@gmail.com wrote:
 Hello Kostmo
 use the following code to toggle check box

 �...@override
  public boolean onChildClick(ExpandableListView parent, View v, int
 groupPosition, int childPosition, long id)
  {
         CheckedTextView tempView = (CheckedTextView)v.findViewById
 (android.R.id.text1);
         tempView.setChecked(!tempView.isChecked());
         return super.onChildClick(parent, v, groupPosition,
 childPosition, id);
  }

 On Jul 21, 11:16 am, anki_dai...@yahoo.com aatish.f...@gmail.com
 wrote:

  You are using

  final ListView listView = getExpandableListView();
          listView.setItemsCanFocus(false);
          listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

  but you are extending ExpandableListActivity, not ListActivity. To use
  chekboxes properly you have to use mAdapter variable..

  On Jul 14, 5:35 am, kostmo kos...@gmail.com wrote:

   I would like to haveexpandabletext categories which reveal children
   that are checkable entries.
   I've used the simple_list_item_multiple_choice layout for the
   childLayout argument ofSimpleExpandableListAdapter.

   The activity shows up correctly, but when a child item is clicked, the
   check box will not toggle.

   I haven taken code from List11.java and ExpandableList3.java from the
   ApiDemos project.

   
   package com.kostmo.android.test;

   import java.util.ArrayList;
   import java.util.HashMap;
   import java.util.List;
   import java.util.Map;

   import android.app.ExpandableListActivity;
   import android.os.Bundle;
   import android.widget.ExpandableListAdapter;
   import android.widget.ListView;
   import android.widget.SimpleExpandableListAdapter;

   public class ExpandableFeatureSelector extends ExpandableListActivity
   {
       private static final String NAME = NAME;

       private ExpandableListAdapter mAdapter;

       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);

          ListMapString, String groupData = new
   ArrayListMapString, String();
          ListListMapString, String childData = new
   ArrayListListMapString, String();

           for (String database_name : AvailableCategories) {
               MapString, String curGroupMap = new HashMapString,
   String();
               groupData.add(curGroupMap);
               curGroupMap.put(NAME, database_name);

              ListMapString, String children = new
   ArrayListMapString, String();
               for (String download_option : AvailableFeatures) {
                   MapString, String curChildMap = new HashMapString,
   String();
                   children.add(curChildMap);
                   curChildMap.put(NAME, download_option);
               }
               childData.add(children);
           }

           mAdapter = newSimpleExpandableListAdapter(
                   this,
                   groupData,
                   android.R.layout.simple_expandable_list_item_1,
                   new String[] { NAME },
                   new int[] { android.R.id.text1 },
                   childData,
                   android.R.layout.simple_list_item_multiple_choice,
                   new String[] { NAME },
                   new int[] { android.R.id.text1 }
                   );
           setListAdapter(mAdapter);

           final ListView listView = getExpandableListView();
           listView.setItemsCanFocus(false);
           listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
       }

       private static final String[] AvailableCategories = new String[] {
           Books, Clothes, Cars
       };

       private static final String[] AvailableFeatures = new String[] {
           Damaged, Used
       };

   }

   - Hide quoted text -

  - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Assets not copying to device/emulator (Eclipse)

2009-08-16 Thread Gareth

I have a test project with a WebView that displays a html page
(demo.html) stored in the assets folder.  I've stored images and
databases in the assets folder before without any problem, but for
some reason now that assets aren't being seen.  The code I'm using is
as follows;

WebView webStep = (WebView)findViewById(R.id.webview);
webStep.loadUrl(file:data//data//com.test//assets//demo.html);

When I run this the UI displays the WebView displays page not found.
What am I doing wrong?

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Taking Control of Phone Events from App

2009-08-16 Thread mike

Hi,

My requirement  is to take control of control phone events such as
(incoming calls,new message) from my application. My application will
be decide whether to bring the incoming call window on fore ground and
notify user or not.

I would like know if its possible on Android.

Regards
Sunil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Screen width and height

2009-08-16 Thread Aanderson144

I am trying to make my display routine reactive to the size of the
screen in pixels my question is does android.view.Display.getHeight()
return the displays total size or will it return different values in
fullscreen and normal views?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding a new xml attribute in framewrok

2009-08-16 Thread Romain Guy

You don't have to modify com.android.internal.R, just add your
attribute in attrs.xml and it will be generated in
com.android.internal.R.

On Sun, Aug 16, 2009 at 9:11 PM, gopugopuraj...@gmail.com wrote:

 To add in com.android.internal.R what id(int value) i have to
 use?.It should be auto generated right?.


 On Aug 16, 4:22 am, Romain Guy romain...@google.com wrote:
 Do not add it to public.xml, it's an incompatible change. Use
 com.android.internal.R instead.

 On Aug 15, 2009 1:51 PM, Jeff Sharkey jshar...@android.com wrote:

 You also need to assign it a specific value in public.xml, otherwise
 it remains internal.

 j

 On Sat, Aug 15, 2009 at 12:05 AM, GPUgopuraj...@gmail.com wrote:   Hi ,
Can anyone tell ,...

 Jeff Sharkey
 jshar...@android.com

 




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Parse or not to parse?

2009-08-16 Thread siuying

I were doing this with #2, which is slower than I expected ... I have
yet to profile it, but with HTML file well under 10k it still take
significant time (10s seconds up).

You may try my app Wand 
http://blog.wandhub.com/2009/08/wand-is-available-in-android-market.html
and install the cheatsheet, it will loads a page, parse it, and
display list of hundreds of items.

On Aug 17, 8:09 am, droidin.net bost...@gmail.com wrote:
 Say it's clean enough to write a SAX handler with few possible
 exception handling lines. I really don't want 3rd party jars. With
 that aside - will it be faster to use ListView?

 Bo

 On Aug 16, 4:58 pm, Mark Murphy mmur...@commonsware.com wrote:

  droidin.net wrote:
   I guess to definitely answer this, one needs to run some benchmarks
   but I'll ask anyway. In you opinion/experience what would work faster
   after initial HTML is grabbed from the remote source. (The HTML is
   group of one or two level nested OL or UL within body tag and some
   DIVs)

   1. Using WebView/JS/CSS to customize and render HTML into list-like UI
   2. Parse HTML into ListAdapter and then use ListView to render it

   My experience with #1 shows that it is actually pretty slow. Weird
   thing is - once rendered - JS works quite well and fast it's really
   initial parsing and loading that produces the delay

  #2 will be limited by how clean your HTML is, unless you use TagSoup or
  something to parse it, and I have no idea if TagSoup or kin run on Android.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  Android Development Wiki:http://wiki.andmob.org


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Doing something every second

2009-08-16 Thread Roman ( T-Mobile USA)

I assume that you have all the needed information about the streams
which you are going to play which means you have also the length
information of the stream. When you start the stream start also a
timer on your mobile device and run it down. If you pause the stream,
try to retrieve the actual position from your player where the stream
is stopped.

I would avoid sending any information about current  position
information over Wifi because in worse case you won't be accurate. You
should consider that your TCP connection is only from type BEST and
your Wifi channel might get congested).

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.


On Aug 16, 1:29 pm, Rexxars rexx...@gmail.com wrote:
 Hi,

 I'm trying to create a remote control for a media player
 (communicating with a TCP socket over Wifi).
 When it retrieves information about the current song being played, it
 gets the current position and total duration of the song.
 Obviously, what I want is a MM:SS display of the current position.
 What is the best way to achieve this?
 I could use a thread which sleeps, but that's not very accurate. What
 is the proper way of making it update every second?

 Thanks in advance!

 - Rexxars
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is it possible to change text color of all child TextViews

2009-08-16 Thread Atif

just refreshing my request

On Aug 13, 2:49 pm, Atif Gulzar atif.gul...@gmail.com wrote:
 Is it possible to change text color of all child TextViews? Actually I want
 to change text color of all columns(TextViews) of a TableRow when it is
 clicked.

 --
 Best Regards,
 Atif Gulzar

 I  Unicode, ɹɐzlnƃ ɟıʇɐ
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen width and height

2009-08-16 Thread Dianne Hackborn
It is strongly recommended that you not do anything based on the raw screen
dimensions, but use layout managers to adjust for the screen size.  You can
easily write your own layout manager (deriving from VIewGroup) to have your
code run every time it gets a new size.

On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144 aanderson...@gmail.comwrote:


 I am trying to make my display routine reactive to the size of the
 screen in pixels my question is does android.view.Display.getHeight()
 return the displays total size or will it return different values in
 fullscreen and normal views?

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to send motion event to activity?

2009-08-16 Thread Dianne Hackborn
Hi, there isn't really a way to do this, sorry.

On Sun, Aug 16, 2009 at 9:01 PM, gguoling gguol...@gmail.com wrote:


 Hi all,
 I am developing an  input method with full screen size views, How can
 I send a grabbed motion event to the client applications?

 Thank you.
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to use CheckBox as children in ExpandableList?

2009-08-16 Thread Somasekhar
It is woking fine for me.
paste onCreate code here to analyze your problem better.

On Mon, Aug 17, 2009 at 5:06 AM, frankjoshua frankjos...@gmail.com wrote:


 Has anyone tried this yet. I am getting strange results. When I click
 on one of the check boxes a second one will sometimes become checked
 also.

 On Aug 3, 1:04 am, powerbyte powerb...@gmail.com wrote:
  Hello Kostmo
  use the following code to toggle check box
 
   @Override
   public boolean onChildClick(ExpandableListView parent, View v, int
  groupPosition, int childPosition, long id)
   {
  CheckedTextView tempView = (CheckedTextView)v.findViewById
  (android.R.id.text1);
  tempView.setChecked(!tempView.isChecked());
  return super.onChildClick(parent, v, groupPosition,
  childPosition, id);
   }
 
  On Jul 21, 11:16 am, anki_dai...@yahoo.com aatish.f...@gmail.com
  wrote:
 
   You are using
 
   final ListView listView = getExpandableListView();
   listView.setItemsCanFocus(false);
   listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
 
   but you are extending ExpandableListActivity, not ListActivity. To use
   chekboxes properly you have to use mAdapter variable..
 
   On Jul 14, 5:35 am, kostmo kos...@gmail.com wrote:
 
I would like to haveexpandabletext categories which reveal children
that are checkable entries.
I've used the simple_list_item_multiple_choice layout for the
childLayout argument ofSimpleExpandableListAdapter.
 
The activity shows up correctly, but when a child item is clicked,
 the
check box will not toggle.
 
I haven taken code from List11.java and ExpandableList3.java from the
ApiDemos project.
 

package com.kostmo.android.test;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import android.app.ExpandableListActivity;
import android.os.Bundle;
import android.widget.ExpandableListAdapter;
import android.widget.ListView;
import android.widget.SimpleExpandableListAdapter;
 
public class ExpandableFeatureSelector extends ExpandableListActivity
{
private static final String NAME = NAME;
 
private ExpandableListAdapter mAdapter;
 
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
   ListMapString, String groupData = new
ArrayListMapString, String();
   ListListMapString, String childData = new
ArrayListListMapString, String();
 
for (String database_name : AvailableCategories) {
MapString, String curGroupMap = new HashMapString,
String();
groupData.add(curGroupMap);
curGroupMap.put(NAME, database_name);
 
   ListMapString, String children = new
ArrayListMapString, String();
for (String download_option : AvailableFeatures) {
MapString, String curChildMap = new HashMapString,
String();
children.add(curChildMap);
curChildMap.put(NAME, download_option);
}
childData.add(children);
}
 
mAdapter = newSimpleExpandableListAdapter(
this,
groupData,
android.R.layout.simple_expandable_list_item_1,
new String[] { NAME },
new int[] { android.R.id.text1 },
childData,
android.R.layout.simple_list_item_multiple_choice,
new String[] { NAME },
new int[] { android.R.id.text1 }
);
setListAdapter(mAdapter);
 
final ListView listView = getExpandableListView();
listView.setItemsCanFocus(false);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
 
private static final String[] AvailableCategories = new String[]
 {
Books, Clothes, Cars
};
 
private static final String[] AvailableFeatures = new String[] {
Damaged, Used
};
 
}
 
- Hide quoted
 text -
 
   - Show quoted text -

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---