[android-developers] Re: offsetLeftAndRight() not working

2009-11-11 Thread Nithin
"Layout pass" means... I dont know what "layout pass" means..

where i have to put the offsetLeftAndRight()...

On Nov 12, 12:54 pm, Romain Guy  wrote:
> Because like I said, it has to happen after the layout pass.
>
>
>
> On Wed, Nov 11, 2009 at 11:52 PM, Nithin  wrote:
> > Hi Romain Guy,
>
> > Actually, I didnt get what you say, I am trying in this way..
>
> > layout = new LinearLayout(this);
> > layout.setOrientation(LinearLayout.VERTICAL);
> > TevtView tv = new TextView(this);
> > tv.offsetLeftAndRight(50);
> > layout.addView(tv, LayoutParams.WRAP_CONTENT);
> > setContentView(layout);
>
> > I am trying this way, but no effect... then, i also tried
>
> > setContentView(layout);
> > tv.offsetLeftAndRight(50);
>
> > still its not moving..
>
> > On Nov 12, 12:35 pm, Romain Guy  wrote:
> >> You must call this *after* a layout. Also, this will be reset by the
> >> next layout pass.
>
> >> On Wed, Nov 11, 2009 at 11:34 PM, Nithin  wrote:
> >> > Hi,
>
> >> > I created textview in java and trying  offsetLeftAndRight(int), but
> >> > the textview is not moving at all. I am using linear layout.
>
> >> > the code is,
>
> >> > layout = new LinearLayout(this);
> >> > layout.setOrientation(LinearLayout.VERTICAL);
> >> > TevtView tv = new TextView(this);
> >> > tv.offsetLeftAndRight(50);
>
> >> > but the textview is not moving either horizontally or vertically..
>
> >> > Any idea please..
>
> >> > Thanks
> >> > Nithin
>
> >> > --
> >> > 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
>
> >> --
> >> 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
>
> --
> 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


Re: [android-developers] Re: offsetLeftAndRight() not working

2009-11-11 Thread Romain Guy
Because like I said, it has to happen after the layout pass.

On Wed, Nov 11, 2009 at 11:52 PM, Nithin  wrote:
> Hi Romain Guy,
>
> Actually, I didnt get what you say, I am trying in this way..
>
> layout = new LinearLayout(this);
> layout.setOrientation(LinearLayout.VERTICAL);
> TevtView tv = new TextView(this);
> tv.offsetLeftAndRight(50);
> layout.addView(tv, LayoutParams.WRAP_CONTENT);
> setContentView(layout);
>
> I am trying this way, but no effect... then, i also tried
>
> setContentView(layout);
> tv.offsetLeftAndRight(50);
>
> still its not moving..
>
>
>
> On Nov 12, 12:35 pm, Romain Guy  wrote:
>> You must call this *after* a layout. Also, this will be reset by the
>> next layout pass.
>>
>>
>>
>> On Wed, Nov 11, 2009 at 11:34 PM, Nithin  wrote:
>> > Hi,
>>
>> > I created textview in java and trying  offsetLeftAndRight(int), but
>> > the textview is not moving at all. I am using linear layout.
>>
>> > the code is,
>>
>> > layout = new LinearLayout(this);
>> > layout.setOrientation(LinearLayout.VERTICAL);
>> > TevtView tv = new TextView(this);
>> > tv.offsetLeftAndRight(50);
>>
>> > but the textview is not moving either horizontally or vertically..
>>
>> > Any idea please..
>>
>> > Thanks
>> > Nithin
>>
>> > --
>> > 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
>>
>> --
>> 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
>



-- 
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: offsetLeftAndRight() not working

2009-11-11 Thread Nithin
Hi Romain Guy,

Actually, I didnt get what you say, I am trying in this way..

layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
TevtView tv = new TextView(this);
tv.offsetLeftAndRight(50);
layout.addView(tv, LayoutParams.WRAP_CONTENT);
setContentView(layout);

I am trying this way, but no effect... then, i also tried

setContentView(layout);
tv.offsetLeftAndRight(50);

still its not moving..



On Nov 12, 12:35 pm, Romain Guy  wrote:
> You must call this *after* a layout. Also, this will be reset by the
> next layout pass.
>
>
>
> On Wed, Nov 11, 2009 at 11:34 PM, Nithin  wrote:
> > Hi,
>
> > I created textview in java and trying  offsetLeftAndRight(int), but
> > the textview is not moving at all. I am using linear layout.
>
> > the code is,
>
> > layout = new LinearLayout(this);
> > layout.setOrientation(LinearLayout.VERTICAL);
> > TevtView tv = new TextView(this);
> > tv.offsetLeftAndRight(50);
>
> > but the textview is not moving either horizontally or vertically..
>
> > Any idea please..
>
> > Thanks
> > Nithin
>
> > --
> > 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
>
> --
> 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: Why activity Icon is not removed from launcher

2009-11-11 Thread Andrew Ding

We do not want to upgrade our product from Cupcake to Eclaire. Can
you kindly help me know how many files were changed for this issue and
the names of the files so that I can only upgrade these special files?
Is the upgrade acceptable for Google?

On Nov 12, 3:24 pm, Romain Guy  wrote:
> Yes, but it should be fixed in Donut too.
>
>
>
>
>
> On Wed, Nov 11, 2009 at 11:21 PM, Andrew Ding  wrote:
>
> > Thanks, Romain.
>
> > Has it been fixed in Eclaire?
>
> > On Nov 12, 2:52 pm, Romain Guy  wrote:
> >> It was a bug in Cupcake.
>
> >> On Wed, Nov 11, 2009 at 10:27 PM, Andrew Ding  wrote:
> >> > Hi, Dianne and all,
>
> >> >    I have a requirement whish is same as that of Shaz. In
> >> > chooseractivity, it can show all the activities who can perform an
> >> > ACTION.
>
> >> >    Now I want to disable one activity so taht the activity will not
> >> > be shown in the ChooserActivity. So I use the API of
>
> >> > setComponentEnabledSetting() too. It does not work at all, though no
> >> > exception is thrown out. I tried it without DONT_KILL_APP.
>
> >> >   Do you have any other good suggestion? Do I make something wrong?
>
> >> > BR,
> >> > Andrew
>
> >> > On Nov 12, 12:01 pm, Dianne Hackborn  wrote:
> >> >> Try it without DONT_KILL_APP.  There may be a bug in the delayed 
> >> >> broadcast
> >> >> that happens as a result of not killing the activity, which I was 
> >> >> actually
> >> >> just looking at. :)
>
> >> >> On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad 
> >> >> wrote:
>
> >> >> > hi,
> >> >> >    I'm trying to remove activity icon from launcher panel. I'm using
> >> >> > firmware 1.5. But nothing seems to work. I'm not receiving any error 
> >> >> > but
> >> >> > activity icon is not removed. Following is the code
>
> >> >> > public class HelloActivity extends Activity {
>
> >> >> > public void onCreate(Bundle savedInstanceState) {
> >> >> >         super.onCreate(savedInstanceState);
> >> >> >        setContentView(R.layout.hello_activity);
> >> >> > }
>
> >> >> >     public void onDestroy() {
> >> >> >         super.onDestroy();
> >> >> >         disbaleActivity();
> >> >> > }
>
> >> >> >     private void disbaleActivity(){
> >> >> >         ComponentName receiver = new
> >> >> > ComponentName(getApplicationContext(),
> >> >> >         "HelloActivity.class");
> >> >> >         PackageManager pm = getPackageManager();
> >> >> >         pm.setComponentEnabledSetting(receiver,
> >> >> > PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
> >> >> >                     PackageManager.DONT_KILL_APP);
>
> >> >> >     }
> >> >> > }
>
> >> >> > I've set following permission in manifest file
> >> >> >  >> >> > android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>
> >> >> > and following is portion of activity in manifest file
>
> >> >> >       
> >> >> >             
> >> >> >                 
> >> >> >                  >> >> > android:name="android.intent.category.LAUNCHER"/>
> >> >> >             
> >> >> >         
>
> >> >> > Please help me to resolve the issue. According to documentation it 
> >> >> > should
> >> >> > work but it doesn't. I've tried calling disbaleActivity() even from
> >> >> > OnCreate() method but no success :-(
>
> >> >> > Regards,
> >> >> > shaz
>
> >> >> >  --
> >> >> > 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
>
> >> >> --
> >> >> 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.- 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
>
> >> --
> >> 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- Hide quoted 
> >> text -
>
> >> - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "A

[android-developers] Re: get device manufacturer or USB device id...

2009-11-11 Thread sdphil
this wound up well.

http://groups.google.com/group/android-developers/browse_thread/thread/2fd3d3b08e0612bb/047604485af1543c#047604485af1543c

On Nov 11, 8:49 am, sdphil  wrote:
> ah...  i had the API-3 filter set, so it was gray and dim and I didn't
> see it -- thanks.
>
> however, what do I do for 1.5?  just sol?
>
> On Nov 11, 8:37 am, Lance Nanek  wrote:
>
> > I see a manufacturer here at 
> > least:http://developer.android.com/intl/fr/reference/android/os/Build.html
>
> > On Nov 11, 9:30 am, sdphil  wrote:
>
> > > thanks, but i meant programmatically - from the phone.
>
> > > On Nov 10, 11:44 pm, ko5tik  wrote:
>
> > > > If you connect to linux box,  lsusb and messages log will tell you
> > > > everything
>
>

-- 
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


Re: [android-developers] offsetLeftAndRight() not working

2009-11-11 Thread Romain Guy
You must call this *after* a layout. Also, this will be reset by the
next layout pass.

On Wed, Nov 11, 2009 at 11:34 PM, Nithin  wrote:
> Hi,
>
> I created textview in java and trying  offsetLeftAndRight(int), but
> the textview is not moving at all. I am using linear layout.
>
> the code is,
>
> layout = new LinearLayout(this);
> layout.setOrientation(LinearLayout.VERTICAL);
> TevtView tv = new TextView(this);
> tv.offsetLeftAndRight(50);
>
> but the textview is not moving either horizontally or vertically..
>
> Any idea please..
>
> Thanks
> Nithin
>
> --
> 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
>



-- 
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] offsetLeftAndRight() not working

2009-11-11 Thread Nithin
Hi,

I created textview in java and trying  offsetLeftAndRight(int), but
the textview is not moving at all. I am using linear layout.

the code is,

layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
TevtView tv = new TextView(this);
tv.offsetLeftAndRight(50);

but the textview is not moving either horizontally or vertically..

Any idea please..

Thanks
Nithin

-- 
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] Problem with playing rtsp link using video view

2009-11-11 Thread manoj
Hi friends,

I have written a simple video player. I have given a rtsp link. It
played for 1 minute and suddently stopped.
>From the log I got the following statements.

E/PlayerDriver(   35): Command PLAYER_RESET completed with an error or
info PVMFFailure

E/MediaPlayer(  463): reset() failed with return code (-2147483648)

E/MediaPlayer(  463): error (-2147483648, 0)


can any one please help me to solve this?

Thanks,
Manoj.

-- 
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: SoundPool problem

2009-11-11 Thread ayanir
thank you Nikolay,

It worked after the the format change.

On Nov 11, 7:49 pm, Nikolay Ananiev  wrote:
> Just the long one.
>
> On Wed, Nov 11, 2009 at 10:05 AM, ayanir  wrote:
> > It is very annoying that this problem stared with the 2.0 version
> > (hope that the framework developers see that remark) while in the 1.6
> > and 1.5 it worked fine.
> > The workaround for this problem, besides of changing the files format
> > is using MediaPlayer and handle the sound low level (which I really
> > don't want to do).
> > BTW, my all sounds are not even close to the 1 MB limit so the problem
> > is not that.
>
> > Nikolay, I didn't understand, did you have to encode the sound to mono
> > for all of the souds or just for the long one(7 sec)?
>
> > Thanks
>
> > On Nov 11, 7:26 am, Nightwolf  wrote:
> > > It seems that SoundPool can't allocate more than 1 MB.
> > > SoundPool stores uncompressed audio. Does anyone know is it possible
> > > to control uncompressed audio characteristics? That would allow
> > > storing relatively lengthy sounds.
>
> > > On 10 ноя, 22:18, Nikolay Ananiev  wrote:
>
> > > > I had the same problem. All my sounds were in .mp3 and they didn't play
> > in
> > > > 2.0.
> > > > I had to reencode them in .ogg and everything started working again.
> > But
> > > > then I had a
> > > > problem with one of the longer sounds (7 secs). Only 6 seconds were
> > loaded,
> > > > because
> > > > there was some stack overflow at the end of the loading. I had to
> > remove the
> > > > stereo and encode it as a mono. It worked well.
>
> > > > On Tue, Nov 10, 2009 at 6:17 PM, ayanir  wrote:
> > > > > Hello,
>
> > > > > I'm using a SoundPool for playing my game sound effects.
> > > > > It all worked fine until I checked it on the new SDK 2.0.
> > > > > the sounds are not played and I'm getting in my log:
> > > > > "SoundPool Sample channel count (0) out of range"
> > > > > right after the playerPool.load (see the code).
>
> > > > > does any one encountered with this problem?
> > > > > here is my code:
>
> > > > > package j2ab.android.rpcapp.utils;
>
> > > > > import android.content.Context;
> > > > > import android.media.AudioManager;
> > > > > import android.media.SoundPool;
>
> > > > > import j2ab.android.rpcapp.R;
>
> > > > > public class SoundManager
> > > > > {
> > > > >        private static boolean isSoundEnabled = true;
>
> > > > >        private static final int[] PLAYERS_RES_IDS = {R.raw.snd1,
> > > > > R.raw.snd2,R.raw.snd3};
>
> > > > >        /**
> > > > >         * Player priority in case of ONE_PLAYER. the highest priority
> > is 0.
> > > > >         */
> > > > >        private static final int[] PLAYERS_PRIORITY = {1, 1, 1};
>
> > > > >        private int[] idToStream;
>
> > > > >        private SoundPool playerPool;
>
> > > > >        public SoundManager(Context context, int maxStreams) {
>
> > > > >                playerPool = new SoundPool(maxStreams,
> > > > > AudioManager.STREAM_MUSIC,
> > > > > 0);
> > > > >                idToStream = new int[PLAYERS_RES_IDS.length];
>
> > > > >                for (int i = 0; i < idToStream.length; i++){
> > > > >                        idToStream[i] = playerPool.load(context,
> > > > > PLAYERS_RES_IDS[i],
> > > > > PLAYERS_PRIORITY[i]);
> > > > >                }
> > > > >        }
>
> > > > >        public int play(int playerId, boolean interrupt) {
> > > > >                if(isSoundEnabled){
> > > > >                        int status =
> > playerPool.play(idToStream[playerId],
> > > > > 0.99f, 0.99f, 0,
> > > > > 0, 1);
> > > > >                        if(status == 0)
> > > > >                                MyLog.printLog("", "cant play a sound
> > > > >  " + playerId);
> > > > >                        return status;
> > > > >                }
> > > > >                return 0;
> > > > >        }
>
> > > > >        public void stopPlayer(int playerId, boolean resetMediaTime) {
> > > > >                if(resetMediaTime){
> > > > >                        playerPool.stop(idToStream[playerId]);
> > > > >                }
> > > > >                else{
> > > > >                        playerPool.pause(idToStream[playerId]);
> > > > >                }
> > > > >        }
>
> > > > >        public void onDispose() {
> > > > >                playerPool.release();
> > > > >        }
> > > > > }
>
> > > > > BTW
> > > > > the emulator managed to play sound using MediaPlayer, but I don't
> > want
> > > > > to use a low level sound management.
>
> > > > > Tanks
> > > > > Yanir
>
> > > > > --
> > > > > 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
>
> > --
> > You received thi

Re: [android-developers] Re: Why activity Icon is not removed from launcher

2009-11-11 Thread Romain Guy
Yes, but it should be fixed in Donut too.

On Wed, Nov 11, 2009 at 11:21 PM, Andrew Ding  wrote:
>
> Thanks, Romain.
>
> Has it been fixed in Eclaire?
>
> On Nov 12, 2:52 pm, Romain Guy  wrote:
>> It was a bug in Cupcake.
>>
>>
>>
>>
>>
>> On Wed, Nov 11, 2009 at 10:27 PM, Andrew Ding  wrote:
>> > Hi, Dianne and all,
>>
>> >    I have a requirement whish is same as that of Shaz. In
>> > chooseractivity, it can show all the activities who can perform an
>> > ACTION.
>>
>> >    Now I want to disable one activity so taht the activity will not
>> > be shown in the ChooserActivity. So I use the API of
>>
>> > setComponentEnabledSetting() too. It does not work at all, though no
>> > exception is thrown out. I tried it without DONT_KILL_APP.
>>
>> >   Do you have any other good suggestion? Do I make something wrong?
>>
>> > BR,
>> > Andrew
>>
>> > On Nov 12, 12:01 pm, Dianne Hackborn  wrote:
>> >> Try it without DONT_KILL_APP.  There may be a bug in the delayed broadcast
>> >> that happens as a result of not killing the activity, which I was actually
>> >> just looking at. :)
>>
>> >> On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad 
>> >> wrote:
>>
>> >> > hi,
>> >> >    I'm trying to remove activity icon from launcher panel. I'm using
>> >> > firmware 1.5. But nothing seems to work. I'm not receiving any error but
>> >> > activity icon is not removed. Following is the code
>>
>> >> > public class HelloActivity extends Activity {
>>
>> >> > public void onCreate(Bundle savedInstanceState) {
>> >> >         super.onCreate(savedInstanceState);
>> >> >        setContentView(R.layout.hello_activity);
>> >> > }
>>
>> >> >     public void onDestroy() {
>> >> >         super.onDestroy();
>> >> >         disbaleActivity();
>> >> > }
>>
>> >> >     private void disbaleActivity(){
>> >> >         ComponentName receiver = new
>> >> > ComponentName(getApplicationContext(),
>> >> >         "HelloActivity.class");
>> >> >         PackageManager pm = getPackageManager();
>> >> >         pm.setComponentEnabledSetting(receiver,
>> >> > PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
>> >> >                     PackageManager.DONT_KILL_APP);
>>
>> >> >     }
>> >> > }
>>
>> >> > I've set following permission in manifest file
>> >> > > >> > android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>>
>> >> > and following is portion of activity in manifest file
>>
>> >> >       
>> >> >             
>> >> >                 
>> >> >                 > >> > android:name="android.intent.category.LAUNCHER"/>
>> >> >             
>> >> >         
>>
>> >> > Please help me to resolve the issue. According to documentation it 
>> >> > should
>> >> > work but it doesn't. I've tried calling disbaleActivity() even from
>> >> > OnCreate() method but no success :-(
>>
>> >> > Regards,
>> >> > shaz
>>
>> >> >  --
>> >> > 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
>>
>> >> --
>> >> 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.- 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
>>
>> --
>> 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- 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
>



-- 
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
publi

[android-developers] Re: Why activity Icon is not removed from launcher

2009-11-11 Thread Andrew Ding

Thanks, Romain.

Has it been fixed in Eclaire?

On Nov 12, 2:52 pm, Romain Guy  wrote:
> It was a bug in Cupcake.
>
>
>
>
>
> On Wed, Nov 11, 2009 at 10:27 PM, Andrew Ding  wrote:
> > Hi, Dianne and all,
>
> >    I have a requirement whish is same as that of Shaz. In
> > chooseractivity, it can show all the activities who can perform an
> > ACTION.
>
> >    Now I want to disable one activity so taht the activity will not
> > be shown in the ChooserActivity. So I use the API of
>
> > setComponentEnabledSetting() too. It does not work at all, though no
> > exception is thrown out. I tried it without DONT_KILL_APP.
>
> >   Do you have any other good suggestion? Do I make something wrong?
>
> > BR,
> > Andrew
>
> > On Nov 12, 12:01 pm, Dianne Hackborn  wrote:
> >> Try it without DONT_KILL_APP.  There may be a bug in the delayed broadcast
> >> that happens as a result of not killing the activity, which I was actually
> >> just looking at. :)
>
> >> On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad 
> >> wrote:
>
> >> > hi,
> >> >    I'm trying to remove activity icon from launcher panel. I'm using
> >> > firmware 1.5. But nothing seems to work. I'm not receiving any error but
> >> > activity icon is not removed. Following is the code
>
> >> > public class HelloActivity extends Activity {
>
> >> > public void onCreate(Bundle savedInstanceState) {
> >> >         super.onCreate(savedInstanceState);
> >> >        setContentView(R.layout.hello_activity);
> >> > }
>
> >> >     public void onDestroy() {
> >> >         super.onDestroy();
> >> >         disbaleActivity();
> >> > }
>
> >> >     private void disbaleActivity(){
> >> >         ComponentName receiver = new
> >> > ComponentName(getApplicationContext(),
> >> >         "HelloActivity.class");
> >> >         PackageManager pm = getPackageManager();
> >> >         pm.setComponentEnabledSetting(receiver,
> >> > PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
> >> >                     PackageManager.DONT_KILL_APP);
>
> >> >     }
> >> > }
>
> >> > I've set following permission in manifest file
> >> >  >> > android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>
> >> > and following is portion of activity in manifest file
>
> >> >       
> >> >             
> >> >                 
> >> >                  >> > android:name="android.intent.category.LAUNCHER"/>
> >> >             
> >> >         
>
> >> > Please help me to resolve the issue. According to documentation it should
> >> > work but it doesn't. I've tried calling disbaleActivity() even from
> >> > OnCreate() method but no success :-(
>
> >> > Regards,
> >> > shaz
>
> >> >  --
> >> > 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
>
> >> --
> >> 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.- 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
>
> --
> 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- 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] How to create and acquire a Wifi Lock in WIFI_MODE_SCAN_ONLY mode

2009-11-11 Thread Mathieu
Hi,

I've been trying in different ways to create and acquire a Wifi lock
in WIFI_MODE_SCAN_ONLY mode. The final aim is to develop a wifi
connection manager app, which should allow a user to scan for wifi
networks, connect to a given SSID, or disconnect from it.

Here's an excerpt of the code i'm using at the moment, which seems to
be creating a wifi lock correctly, but still, if i disconnect from a
SSID, 3 seconds later a scan is automatically initiated and the wifi
connects to the first known (remembered) SSID.

private TrustiveWifi(Context context) {
Log.d(TAG, "Created TrustiveWifi");
this.context = context;
wm = (WifiManager) context.getSystemService
(context.WIFI_SERVICE);

..

// create a wifi lock to prevent the wifi from shutting down
// the mode will be WIFI_MODE_SCAN_ONLY until a connection is
explicitely required
createWifiLock(false);

..

}

public static TrustiveWifi getInstance(Context context) { //
singleton
if (INSTANCE == null) {
INSTANCE = new TrustiveWifi(context);
}
return INSTANCE;
}

public void finalize() throws Throwable {
Log.d(TAG, "Finalizing");
try {
releaseWifiLock();

..

} catch(Exception e) {
} finally {
super.finalize();
}
}

public void createWifiLock(boolean wifi_mode_full) {
releaseWifiLock();
Log.d(TAG, "createWifiLock with full mode=" + wifi_mode_full);
wifiLock = wm.createWifiLock(wifi_mode_full ?
wm.WIFI_MODE_FULL : wm.WIFI_MODE_SCAN_ONLY, "TrustiveWifi wifilock");
wifiLock.setReferenceCounted(false);
wifiLock.acquire();
Log.d(TAG, "created a wifi lock: " + wifiLock.toString());
}

public void releaseWifiLock() {
if (wifiLock != null && wifiLock.isHeld()) {
Log.d(TAG, "Release wifi lock");
wifiLock.release();
}
}

public void disconnect() {
Log.d(TAG, "disconnecting");
createWifiLock(false);
wm.disconnect();
}

/** returns false if the network isn't configured yet. Create a
new wifi lock with mode WIFI_MODE_FULL */
public boolean connect(int selectedHotspot) {
String selectedSSID = wifiNetworks.get
(selectedHotspot).scanResult.SSID;

for (WifiConfiguration wc: wm.getConfiguredNetworks()) {
String ssid = wc.SSID.replaceAll("\"", "");
if (ssid.equals(selectedSSID)) {
Log.d(TAG, "Connecting to hotspot: " + wifiNetworks.get
(selectedHotspot));
createWifiLock(true);
wm.enableNetwork(wc.networkId, true);
return true;
}
}
Log.d(TAG, "Connection requested, but hotspot not configured
yet");
return false; // hotspot not found in the configured networks
}


I have no clue how to move forward on this issue, so any help and/or
advice will be greatly appreciated!

Mathieu

-- 
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: Dallas Android Developers

2009-11-11 Thread PJ
If anyone is interested in joining the "Dallas Droid Devs", just reply
to this thread and let us know that you're interested.

An existing member can then invite you to be a collaborator of our
spreadsheet, so that you can see who we are, see what all is going on,
and tell us about yourself.

-- PJ



On Nov 12, 12:39 am, PJ  wrote:
> I vote for the 14th!  (I'm out of town on the 21st.)
>
> I was about to ask everyone where they lived and a bunch of other
> info, then I realized it would be easier if we just had a shared
> spreadsheet.
>
> So guys, I've created a Google Docs spreadsheet that we can all 
> edit!http://spreadsheets.google.com/ccc?key=tLm0U-zoptmlhEk_B_DteaA&hl=en
>
> It's not too fancy, but please note that it does have multiple sheets/
> tabs at the bottom:
> "Members": Go here and enter your profile info so that we can see
> where you live, what your skills/interests are, etc.
> "Meetings": List of meetings.  For now I went ahead and put the 14th
> down for our first meeting!
> "Notes": Put random notes/discussions/crap about the group here.
>
> I'll give everyone (in this discussion) permissions to edit the
> spreadsheet.  If you have trouble viewing or editing it, let me know
> and I'll try to fix it.
>
> -- PJ
>
> On Nov 11, 4:44 pm, Aniruddh Bajirao  wrote:
>
>
>
> >  14th or 21st both are good for me.
> > How about the others?
>
> > On Wed, Nov 11, 2009 at 1:24 PM, Chris Dempsey  wrote:
> > > How about the 14th or 21st?  I'm in the Plano area but I own a car so
> > > traveling isn't a problem. :)
>
> > > On Wed, Nov 11, 2009 at 10:49 AM, Aniruddh Bajirao 
> > > wrote:
>
> > >> As PJ suggested 'Dallas Droid Devs'...
> > >> Lets plan an informal meet and get started... Any suggestions on when n
> > >> where we can have a meet...
>
> > >> On Wed, Nov 11, 2009 at 7:03 AM, Chris Dempsey  wrote:
>
> > >>> I am interested in a Dallas Droid developer group.  I think PJ has the
> > >>> right idea.  Start informal and see where it goes.
>
> > >>> On Wed, Nov 11, 2009 at 1:22 AM, PJ  wrote:
>
> >  "Dallas Droid Devs".  It's catchy.  Quick, someone reserve the domain!
>
> >  I think the biggest barrier to forming a local Android Dev group is
> >  the fact that developers can hang out in the IRC channel (and this
> >  Google group) and find lots of discussion there, from the comfort (and
> >  whim/speed) of their own homes.  So, some people might not feel the
> >  extra effort is worth it.
>
> >  So an important step to creating a successful Dallas Android Dev group
> >  is to brainstorm and come up with a convincing list of incentives to
> >  create/join a local group.  Developers will ask, "What can the Dallas
> >  group offer me that the worldwide community can't?"
>
> >  The answer is stuff like:
> >  * Job placement: When Dallas devs get together, they can share info
> >  about local opportunities
> >  * Discuss local interests (like... uh... Dallas Cowboys?
> >  Whataburger?  hahaha...)
> >  * Get out of the house and meet in person
> >  * etc.
>
> >  I'm personally not gifted at organizing social events, but I'd
> >  strongly consider joining/supporting.
>
> >  On Nov 10, 9:54 pm, Aniruddh Bajirao  wrote:
> >  > Anyone interested in having a Dallas Android Group?
>
> >  > On Fri, Nov 6, 2009 at 9:42 PM, Aniruddh Bajirao 
> >  wrote:
> >  > > If we have enough people interested lets create a Dallas Android
> >  Dev-group.
>
> >  > > We can have planned meets. Will definitely be interesting and 
> >  > > useful
> >  to
> >  > > share knowledge and experience as well as to get answers to
> >  questions. Above
> >  > > all it would be very interesting to meet and network with other
> >  Android
> >  > > Enthusiasts.
>
> >  > > On Fri, Nov 6, 2009 at 8:51 PM, cpick  wrote:
>
> >  > >> You might check the Texas Startup Blog. Alex Muse has a happy hour
> >  > >> down at the info mart first monday of the month. Usually some
> >  android
> >  > >> guys there (although it is more entrepreneur related). They also
> >  > >> sometimes have the mobile monday meeting in their office space..
> >  But I
> >  > >> would not mind getting a bit involved in a Android Dev group. 
> >  > >> There
> >  is
> >  > >> a North Texas PC Users group somewhere (My father is a part of 
> >  > >> it).
> >  > >> They meet on a weekend, and have break out groups I think for
> >  > >> different technologies.. Maybe get  a subgroup started there?
>
> >  > >> --
> >  > >> 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 >  > >>  cr...@googlegroups.com>

[android-developers] Re: get device manufacturer or USB device id...

2009-11-11 Thread sdphil
this wound up well.

http://groups.google.com/group/android-developers/browse_thread/thread/2fd3d3b08e0612bb/047604485af1543c#047604485af1543c

On Nov 11, 8:49 am, sdphil  wrote:
> ah...  i had the API-3 filter set, so it was gray and dim and I didn't
> see it -- thanks.
>
> however, what do I do for 1.5?  just sol?
>
> On Nov 11, 8:37 am, Lance Nanek  wrote:
>
> > I see a manufacturer here at 
> > least:http://developer.android.com/intl/fr/reference/android/os/Build.html
>
> > On Nov 11, 9:30 am, sdphil  wrote:
>
> > > thanks, but i meant programmatically - from the phone.
>
> > > On Nov 10, 11:44 pm, ko5tik  wrote:
>
> > > > If you connect to linux box,  lsusb and messages log will tell you
> > > > everything
>
>

-- 
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


Re: [android-developers] Re: Why activity Icon is not removed from launcher

2009-11-11 Thread Romain Guy
It was a bug in Cupcake.

On Wed, Nov 11, 2009 at 10:27 PM, Andrew Ding  wrote:
> Hi, Dianne and all,
>
>    I have a requirement whish is same as that of Shaz. In
> chooseractivity, it can show all the activities who can perform an
> ACTION.
>
>    Now I want to disable one activity so taht the activity will not
> be shown in the ChooserActivity. So I use the API of
>
> setComponentEnabledSetting() too. It does not work at all, though no
> exception is thrown out. I tried it without DONT_KILL_APP.
>
>   Do you have any other good suggestion? Do I make something wrong?
>
> BR,
> Andrew
>
> On Nov 12, 12:01 pm, Dianne Hackborn  wrote:
>> Try it without DONT_KILL_APP.  There may be a bug in the delayed broadcast
>> that happens as a result of not killing the activity, which I was actually
>> just looking at. :)
>>
>> On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad 
>> wrote:
>>
>>
>>
>>
>>
>> > hi,
>> >    I'm trying to remove activity icon from launcher panel. I'm using
>> > firmware 1.5. But nothing seems to work. I'm not receiving any error but
>> > activity icon is not removed. Following is the code
>>
>> > public class HelloActivity extends Activity {
>>
>> > public void onCreate(Bundle savedInstanceState) {
>> >         super.onCreate(savedInstanceState);
>> >        setContentView(R.layout.hello_activity);
>> > }
>>
>> >     public void onDestroy() {
>> >         super.onDestroy();
>> >         disbaleActivity();
>> > }
>>
>> >     private void disbaleActivity(){
>> >         ComponentName receiver = new
>> > ComponentName(getApplicationContext(),
>> >         "HelloActivity.class");
>> >         PackageManager pm = getPackageManager();
>> >         pm.setComponentEnabledSetting(receiver,
>> > PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
>> >                     PackageManager.DONT_KILL_APP);
>>
>> >     }
>> > }
>>
>> > I've set following permission in manifest file
>> > > > android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>>
>> > and following is portion of activity in manifest file
>>
>> >       
>> >             
>> >                 
>> >                 
>> >             
>> >         
>>
>> > Please help me to resolve the issue. According to documentation it should
>> > work but it doesn't. I've tried calling disbaleActivity() even from
>> > OnCreate() method but no success :-(
>>
>> > Regards,
>> > shaz
>>
>> >  --
>> > 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
>>
>> --
>> 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.- 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
>



-- 
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: Google APIs not being found by adb after upgrade.

2009-11-11 Thread Clay
ARRRG. sorry





On Nov 11, 10:17 pm, Clay  wrote:
> I am having a strange problem after upgrading from the 1.5 to the 2.0
> API in ADB, is there a setting I dont know about?
>
> Any time I try to reference a Google specific class, even in the
> simplest of projects such as:
>
> package com.noi.android.test3;
>
> import com.google.android.maps.GeoPoint;
> import android.app.Activity;
> import android.os.Bundle;
>
> public class TestActivity extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>
>         //why cant you be found by the ADB classloader?
>         GeoPoint p = new GeoPoint((int) (1 * 100),
>                                 (int) (1 * 100));
>     }
>
> }
>
> I get a ClassNotFound exception when the application starts up in the
> emulator.
>
> 11-11 21:29:40.221: ERROR/dalvikvm(733): Could not find class
> 'com.google.android.maps.GeoPoint', referenced from method
>
> What I *dont* think this is:
>
> 1. An eclipse .classpath or .project issue, it builds fine, no errors.
>
> 2. A manifest or target issue.
>
> 
> http://schemas.android.com/apk/res/android";
>       package="com.noi.android.test3"
>       android:versionCode="1"
>       android:versionName="1.0">
>     
>                            android:label="@string/app_name">
>             
>                 
>                  android:name="android.intent.category.LAUNCHER" />
>             
>         
>     
>     
> 
>
> # Project target.
> target=Google Inc.:Google APIs:4
> # Indicates whether an apk should be generated for each density.
> split.density=false
>
> I thought for Google target maps.jar was provided by the manufacturer
> of the phone, so I shouldn't include it in my apk build should I? This
> is confusing to me, this should be basic, the problem makes me feel
> like a major nube.  I really have looked at the docs, it could be I
> missed something.
>
> Any pointers appreciated.
>
> Clay

-- 
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 - Market Conflicting Names. GOOGLE, READ IT

2009-11-11 Thread JP

Hey, you're getting bailed out!


On Nov 11, 10:56 am, James Yum  wrote:
> Hi,
>
> We are working on a fix for this, so stay tuned. I'll try to update this
> thread when it's done.
>
> In the meantime, you can choose a slightly different name and plan on
> renaming it later.
>
> Cheers,
> James
>
> On Wed, Nov 11, 2009 at 3:01 AM, Piotr  wrote:
> > I already done that, and my software is on public part of Market.
>
> > The problem is, a name of application, that is CONFLICTING with NAME
> > in ADC2 Market part.
>
> > This is stupid GOOGLE bug, because APP NAME can't be a KEY in non-
> > public AND public part of Market together. Some "smart" developer of
> > Market, runs existence query on both, when you submit your app, so you
> > can't have two same names on two areas.
>
> > So, my app has two different names: one for ADC2 and one for Market.
>
> > Because I set right name in ADC2 - AND GOOGLE DOES NOT MENTIONED about
> > conflicting names in future, now I can not have right name in public
> > Market.
>
> > On 11 Lis, 11:46, Vytautas Vaitukaitis
> >  wrote:
> > > It might be a good idea to rename the package name of your application
> > > (it's a 2-click operation in Eclipse) rather than waiting for Google
> > > people to remove your app from ADC2 version of Market as I think it is
> > > probably the reason why you can't submit your app to the normal
> > > Android Market.
>
> > > Hope this helps.
>
> > > Vytautas
>
> > > On Nov 11, 10:37 am, Piotr  wrote:
>
> > > > I'm tired waiting 3 months for reply from Google Market. I requested
> > > > them to help - no help, no explanation, so I hope, somebody will read
> > > > at least this.
>
> > > > I need to my software be removed from ADC2 part of Market, because for
> > > > last 3 months, I CAN NOT set right name for my software in public
> > > > Market. Do not direct me to Market groups - their "support" is dead.
>
> > > > How long I must wait ?
>
> > > > Piotr
>
> > --
> > 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

-- 
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 write multiple-version compatible code...

2009-11-11 Thread sdphil
Thanks for your help Mark.  For anyone that's interested, here's a
code snippet.

private static String manufacturer = null;
public static String getDeviceManufacturer() throws Exception {
// use reflection to get device manufacturer safely.

// ANDROID1.6
// android.os.Build.MANUFACTURER

if (manufacturer != null) {
return manufacturer;
}

try {
Class buildClass = 
android.os.Build.class;
Field field = buildClass.getField("MANUFACTURER");
manufacturer = (String) field.get(new 
android.os.Build());
} catch (NoSuchFieldException e) {
manufacturer = "(unavailable)";
} catch (Exception e) {
manufacturer = "error";
}
return manufacturer;
}

and it seemed to work.

On Nov 11, 12:04 pm, Mark Murphy  wrote:
> sdphil wrote:
> > hm...  looks like I should use this --
> >http://developer.android.com/reference/java/lang/reflect/Field.html
>
> Yes. The only tricky part may be getting it for a static. I haven't done
> tons of reflection work, so I don't have examples to show you of this
> specific problem.
>
> On the plus side, you can do the reflection work itself in a static
> context, so you only go through the reflection once.
>
> > also, I don't think a try/catch will work - the java pre-verifier will
> > choke before it gets to running it... eh?
>
> Yup!
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Beginning Android_ from Apress Now Available!

-- 
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: Dallas Android Developers

2009-11-11 Thread PJ
I vote for the 14th!  (I'm out of town on the 21st.)

I was about to ask everyone where they lived and a bunch of other
info, then I realized it would be easier if we just had a shared
spreadsheet.

So guys, I've created a Google Docs spreadsheet that we can all edit!
http://spreadsheets.google.com/ccc?key=tLm0U-zoptmlhEk_B_DteaA&hl=en

It's not too fancy, but please note that it does have multiple sheets/
tabs at the bottom:
"Members": Go here and enter your profile info so that we can see
where you live, what your skills/interests are, etc.
"Meetings": List of meetings.  For now I went ahead and put the 14th
down for our first meeting!
"Notes": Put random notes/discussions/crap about the group here.

I'll give everyone (in this discussion) permissions to edit the
spreadsheet.  If you have trouble viewing or editing it, let me know
and I'll try to fix it.

-- PJ



On Nov 11, 4:44 pm, Aniruddh Bajirao  wrote:
>  14th or 21st both are good for me.
> How about the others?
>
>
>
>
>
> On Wed, Nov 11, 2009 at 1:24 PM, Chris Dempsey  wrote:
> > How about the 14th or 21st?  I'm in the Plano area but I own a car so
> > traveling isn't a problem. :)
>
> > On Wed, Nov 11, 2009 at 10:49 AM, Aniruddh Bajirao 
> > wrote:
>
> >> As PJ suggested 'Dallas Droid Devs'...
> >> Lets plan an informal meet and get started... Any suggestions on when n
> >> where we can have a meet...
>
> >> On Wed, Nov 11, 2009 at 7:03 AM, Chris Dempsey  wrote:
>
> >>> I am interested in a Dallas Droid developer group.  I think PJ has the
> >>> right idea.  Start informal and see where it goes.
>
> >>> On Wed, Nov 11, 2009 at 1:22 AM, PJ  wrote:
>
>  "Dallas Droid Devs".  It's catchy.  Quick, someone reserve the domain!
>
>  I think the biggest barrier to forming a local Android Dev group is
>  the fact that developers can hang out in the IRC channel (and this
>  Google group) and find lots of discussion there, from the comfort (and
>  whim/speed) of their own homes.  So, some people might not feel the
>  extra effort is worth it.
>
>  So an important step to creating a successful Dallas Android Dev group
>  is to brainstorm and come up with a convincing list of incentives to
>  create/join a local group.  Developers will ask, "What can the Dallas
>  group offer me that the worldwide community can't?"
>
>  The answer is stuff like:
>  * Job placement: When Dallas devs get together, they can share info
>  about local opportunities
>  * Discuss local interests (like... uh... Dallas Cowboys?
>  Whataburger?  hahaha...)
>  * Get out of the house and meet in person
>  * etc.
>
>  I'm personally not gifted at organizing social events, but I'd
>  strongly consider joining/supporting.
>
>  On Nov 10, 9:54 pm, Aniruddh Bajirao  wrote:
>  > Anyone interested in having a Dallas Android Group?
>
>  > On Fri, Nov 6, 2009 at 9:42 PM, Aniruddh Bajirao 
>  wrote:
>  > > If we have enough people interested lets create a Dallas Android
>  Dev-group.
>
>  > > We can have planned meets. Will definitely be interesting and useful
>  to
>  > > share knowledge and experience as well as to get answers to
>  questions. Above
>  > > all it would be very interesting to meet and network with other
>  Android
>  > > Enthusiasts.
>
>  > > On Fri, Nov 6, 2009 at 8:51 PM, cpick  wrote:
>
>  > >> You might check the Texas Startup Blog. Alex Muse has a happy hour
>  > >> down at the info mart first monday of the month. Usually some
>  android
>  > >> guys there (although it is more entrepreneur related). They also
>  > >> sometimes have the mobile monday meeting in their office space..
>  But I
>  > >> would not mind getting a bit involved in a Android Dev group. There
>  is
>  > >> a North Texas PC Users group somewhere (My father is a part of it).
>  > >> They meet on a weekend, and have break out groups I think for
>  > >> different technologies.. Maybe get  a subgroup started there?
>
>  > >> --
>  > >> 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  > >>  cr...@googlegroups.com>  cr...@googlegroups.com>
>  > >> For more options, visit this group at
>  > >>http://groups.google.com/group/android-developers?hl=en
>
>  > > --
>  > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>  -- --
>  > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>  -- --
>  > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>  > > Great spirits have always found violent opposition from
>  mediocrities. The
>  > > latter cannot understand it when

[android-developers] Re: custom protocol handler...

2009-11-11 Thread sdphil
anybody?  andybody?? :)

On Nov 11, 9:09 am, sdphil  wrote:
> i want to do the following thing -
>
> when a user navigates to a web page, I want to have a link in there
> that looks like this:
>
>     Click here for fun.
>
> Then when the user clicks on that from the phone browser, I want it to
> launch my intent with that full url.
>
> In my AndroidManifest.xml file, I have the following info:
>
>     
>                 
>                 
>                      android:name="android.intent.action.VIEW">
>                      android:name="android.intent.category.DEFAULT">
>                      android:name="android.intent.category.BROWSABLE">
>                     
>                 
>     
>
> When I try this, when I click on the link on the web page from the
> phone browser, it says --
>
> Web page not available
> The Web page at myprotocol://blah=42 might be temporarily down or it
> may have moved permanently to a new web address.
>
> Any help here would be appreciated.
>
> tia.

-- 
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: Map is not displaying even the settings are correct

2009-11-11 Thread naveenballa
thanks for reply
yes i registered the API key
even then the map is not displaying
it's working in another Computer not in mine
what may be the problem . Is there other settings i need to do in my
computer.

On Nov 12, 1:09 am, jotobjects  wrote:
> Did you register the debug API key that you are using in the emulator
> following the documentation instructions?
>
> On Nov 10, 9:49 pm, naveenballa  wrote:
>
>
>
> > i am running the mapdemo application in the samples of SDK.
> > i have set the MAP api key and set the permissions(INTERNET, FINE,
> > COARSE)
> > Then also the map is not displaying on the emulator (only just Tiles)
> > please help me
>
> > 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


Re: 答复: [android-developers] Re: hiding a forcib ly opened soft keyboard...

2009-11-11 Thread sdphil
I'm not sure about the view, but i'm sure the top most window is there
-- and i thought that's what --

getApplicationWindowToken --
Retrieve a unique token identifying the top-level "real" window of the
window that this view is attached to.

was supposed to take care.

Can I do a view.requestFocus() before calling this to ensure it has
focus?

On Nov 11, 8:06 pm, Dianne Hackborn  wrote:
> Ah sorry 0 is correct here.  Are you sure the window you are passing in
> actually currently has input focus?  Fwiw, the framework code that
> hides/shows the IME from long pressing on menu does basically the same thing
> -- shows with the force flag, hides with 0 flags.
>
> 2009/11/11 sdphil 
>
>
>
> > I'm basically doing what you show here.
>
> > What I mean by "forced" soft keyboard is when you hold down the menu
> > key.
>
> > It doesn't make it go away.  I tried using
> > view.getApplicationWindowToken vs. view.getWindowToken
>
> > and it did not make any difference.  so something else must be going
> > on...
>
> > On Nov 11, 7:02 pm, zhanglei(张雷)  wrote:
> > > InputMethodManager m_inputManager = null;
> > > //show input
> > > m_inputManager = (InputMethodManager)
> > getSystemService(Context.INPUT_METHOD_SERVICE);
> > > m_inputManager.showSoftInput(
> > this.getCurrentFocus(),InputMethodManager.SHOW_FORCED );
>
> > > //hide input
> > > private boolean hideInputMethod( )
> > > {
> > > boolean bHideIM =
> > m_inputManager.hideSoftInputFromWindow(name.getWindowToken(), 0); //hide
> > Input Method
> > > if( false == bHideIM )
> > > {
> > > Log.e( TAG, "hide InputMethod is error!" );
> > > }
> > > return bHideIM;
> > > }
>
> > > -邮件原件-
> > > 发件人: sdphil [mailto:phil.pellouch...@gmail.com]
> > > 发送时间: 2009年11月12日 10:43
> > > 收件人: Android Developers
> > > 主题: [android-developers] Re: hiding a forcibly opened soft keyboard...
>
> > > What flag is that?  All I see documented are --
>
> > > int HIDE_IMPLICIT_ONLY  Flag for hideSoftInputFromWindow(IBinder,
> > > int) to indicate that the soft input window should only be hidden if
> > > it was not explicitly shown by the user.
> > > int HIDE_NOT_ALWAYS Flag for hideSoftInputFromWindow(IBinder,
> > int)
> > > to indicate that the soft input window should normally be hidden,
> > > unless it was originally shown with SHOW_FORCED.
>
> > >http://developer.android.com/intl/fr/reference/android/view/inputmeth...
>
> > > tia.
>
> > > On Nov 11, 6:40 pm, Dianne Hackborn  wrote:
>
> > > > You need to pass the flag to force it to be hidden.
>
> > > > On Wed, Nov 11, 2009 at 5:09 PM, sdphil 
> > wrote:
> > > > > i am attempting to hide a forcibly opened soft keyboard using --
>
> > > > >// hide the soft keyboard.
> > > > >View view = (View) findViewById(R.id.DebugText);
> > > > >InputMethodManager manager = (InputMethodManager)
> > > > > getSystemService(Context.INPUT_METHOD_SERVICE);
> > > > >IBinder binder = view.getApplicationWindowToken();
> > > > >if (binder != null) {
> > > > >manager.hideSoftInputFromWindow(binder, 0);
> > > > >}
>
> > > > > but it doesn't seem to be working - any ideas?
>
> > > > > tia.
>
> > > > > --
> > > > > 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
>
> > > > --
> > > > 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 athttp://
> > groups.google.com/group/android-developers?hl=en
>
> > --
> > 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: HTC Tatto for Android Application testing

2009-11-11 Thread Nemat
Thanks Michael.

As far as I am concerned ,it is touch screen.

By the way...I am in India.

Thanks,
Nemat

On Nov 12, 11:12 am, Chi Kit Leung  wrote:
> I use HTC Magic for testing my apps.
>
> On Thu, Nov 12, 2009 at 4:11 PM, Chi Kit Leung wrote:
>
>
>
>
>
> > I am in Australia, I have not any hand on experince with HTC Tatto yet.
> > Please confirm whether that is a touch screen device. Because in my memory,
> > that is not. Moreover, if you are in US, you can consider Droid. That is a
> > 2.0 native device. I think that is worth to consider.
>
> > On Thu, Nov 12, 2009 at 4:04 PM, Nemat  wrote:
>
> >> Hey friends
>
> >> I have to buy a new Android phone for testing android applications I
> >> work upon.What about HTC Tatoo??
>
> >> Can I buy that one??This would be specifically for testing not for
> >> personal use...Can you guys help me out in choosing a good Android
> >> device for testing ...please
>
> >> Thanks in advance
> >> Nemat
>
> >> --
> >> 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
>
> > --
> > Regards,
> > Michael Leung
> >http://www.itblogs.info
> >http://www.michaelleung.info
>
> --
> Regards,
> Michael Leunghttp://www.itblogs.infohttp://www.michaelleung.info- 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] Re: Why activity Icon is not removed from launcher

2009-11-11 Thread Andrew Ding
Hi, Dianne and all,

I have a requirement whish is same as that of Shaz. In
chooseractivity, it can show all the activities who can perform an
ACTION.

Now I want to disable one activity so taht the activity will not
be shown in the ChooserActivity. So I use the API of

setComponentEnabledSetting() too. It does not work at all, though no
exception is thrown out. I tried it without DONT_KILL_APP.

   Do you have any other good suggestion? Do I make something wrong?

BR,
Andrew

On Nov 12, 12:01 pm, Dianne Hackborn  wrote:
> Try it without DONT_KILL_APP.  There may be a bug in the delayed broadcast
> that happens as a result of not killing the activity, which I was actually
> just looking at. :)
>
> On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad 
> wrote:
>
>
>
>
>
> > hi,
> >    I'm trying to remove activity icon from launcher panel. I'm using
> > firmware 1.5. But nothing seems to work. I'm not receiving any error but
> > activity icon is not removed. Following is the code
>
> > public class HelloActivity extends Activity {
>
> > public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >        setContentView(R.layout.hello_activity);
> > }
>
> >     public void onDestroy() {
> >         super.onDestroy();
> >         disbaleActivity();
> > }
>
> >     private void disbaleActivity(){
> >         ComponentName receiver = new
> > ComponentName(getApplicationContext(),
> >         "HelloActivity.class");
> >         PackageManager pm = getPackageManager();
> >         pm.setComponentEnabledSetting(receiver,
> > PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
> >                     PackageManager.DONT_KILL_APP);
>
> >     }
> > }
>
> > I've set following permission in manifest file
> >  > android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>
> > and following is portion of activity in manifest file
>
> >       
> >             
> >                 
> >                 
> >             
> >         
>
> > Please help me to resolve the issue. According to documentation it should
> > work but it doesn't. I've tried calling disbaleActivity() even from
> > OnCreate() method but no success :-(
>
> > Regards,
> > shaz
>
> >  --
> > 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
>
> --
> 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.- 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


Re: [android-developers] HTC Tatto for Android Application testing

2009-11-11 Thread Dianne Hackborn
The Tattoo is most definitely a touch screen device.  Currently only touch
screen devices are android compatible.

On Wed, Nov 11, 2009 at 10:11 PM, Chi Kit Leung wrote:

> I am in Australia, I have not any hand on experince with HTC Tatto yet.
> Please confirm whether that is a touch screen device. Because in my memory,
> that is not. Moreover, if you are in US, you can consider Droid. That is a
> 2.0 native device. I think that is worth to consider.
>
>
> On Thu, Nov 12, 2009 at 4:04 PM, Nemat  wrote:
>
>> Hey friends
>>
>> I have to buy a new Android phone for testing android applications I
>> work upon.What about HTC Tatoo??
>>
>> Can I buy that one??This would be specifically for testing not for
>> personal use...Can you guys help me out in choosing a good Android
>> device for testing ...please
>>
>> Thanks in advance
>> Nemat
>>
>> --
>> 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
>
>
>
>
> --
> 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
>



-- 
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: Centering text in a button?

2009-11-11 Thread CyberQat
Some more info

The text is perfectly centered (but tiny) if I lave it at the default
setting.  If I try to scale it
up to match the button size however I lose vertical centering :(

Ive tried looking at the drawing code but it is massively complex.

Anyone know a soln?

On Nov 10, 10:37 am, CyberQat  wrote:
> Hi Guys,
>
> Ive just started fooling around with programming my Motorola Droid.
> I'm programmatic ally laying out an interface such that the text
> contained in my Button is sized at layout time to fit the button.  My
> questions are:
>
> (1) I know the pixel size of the button, what is the best way to set
> the text size to fit the button size?
> (2) I can't seem to get it to center.  I've tried a Gravity of 11 and
> that helps, but ist still not right.  How do I get my text to center
> itself properly horizontally and vertically in the button?
>
> 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] Google APIs not being found by adb after upgrade.

2009-11-11 Thread Clay
I am having a strange problem after upgrading from the 1.5 to the 2.0
API in ADB, is there a setting I dont know about?

Any time I try to reference a Google specific class, even in the
simplest of projects such as:

package com.noi.android.test3;

import com.google.android.maps.GeoPoint;
import android.app.Activity;
import android.os.Bundle;

public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

//why cant you be found by the ADB classloader?
GeoPoint p = new GeoPoint((int) (1 * 100),
(int) (1 * 100));
}
}

I get a ClassNotFound exception when the application starts up in the
emulator.

11-11 21:29:40.221: ERROR/dalvikvm(733): Could not find class
'com.google.android.maps.GeoPoint', referenced from method

What I *dont* think this is:

1. An eclipse .classpath or .project issue, it builds fine, no errors.

2. A manifest or target issue.


http://schemas.android.com/apk/res/android";
  package="com.noi.android.test3"
  android:versionCode="1"
  android:versionName="1.0">











# Project target.
target=Google Inc.:Google APIs:4
# Indicates whether an apk should be generated for each density.
split.density=false

I thought for Google target maps.jar was provided by the manufacturer
of the phone, so I shouldn't include it in my apk build should I? This
is confusing to me, this should be basic, the problem makes me feel
like a major nube.  I really have looked at the docs, it could be I
missed something.

Any pointers appreciated.

Clay



-- 
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] [Video]Max FPS android support?

2009-11-11 Thread 侯玉涛
I have a problem, what is the max number of video FPS that andoird support?

Thanks a lot.

-- 
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

Re: [android-developers] HTC Tatto for Android Application testing

2009-11-11 Thread Chi Kit Leung
I use HTC Magic for testing my apps.

On Thu, Nov 12, 2009 at 4:11 PM, Chi Kit Leung wrote:

> I am in Australia, I have not any hand on experince with HTC Tatto yet.
> Please confirm whether that is a touch screen device. Because in my memory,
> that is not. Moreover, if you are in US, you can consider Droid. That is a
> 2.0 native device. I think that is worth to consider.
>
>
> On Thu, Nov 12, 2009 at 4:04 PM, Nemat  wrote:
>
>> Hey friends
>>
>> I have to buy a new Android phone for testing android applications I
>> work upon.What about HTC Tatoo??
>>
>> Can I buy that one??This would be specifically for testing not for
>> personal use...Can you guys help me out in choosing a good Android
>> device for testing ...please
>>
>> Thanks in advance
>> Nemat
>>
>> --
>> 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
>
>
>
>
> --
> Regards,
> Michael Leung
> http://www.itblogs.info
> http://www.michaelleung.info
>



-- 
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

Re: [android-developers] HTC Tatto for Android Application testing

2009-11-11 Thread Chi Kit Leung
I am in Australia, I have not any hand on experince with HTC Tatto yet.
Please confirm whether that is a touch screen device. Because in my memory,
that is not. Moreover, if you are in US, you can consider Droid. That is a
2.0 native device. I think that is worth to consider.

On Thu, Nov 12, 2009 at 4:04 PM, Nemat  wrote:

> Hey friends
>
> I have to buy a new Android phone for testing android applications I
> work upon.What about HTC Tatoo??
>
> Can I buy that one??This would be specifically for testing not for
> personal use...Can you guys help me out in choosing a good Android
> device for testing ...please
>
> Thanks in advance
> Nemat
>
> --
> 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




-- 
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

Re: [android-developers] Re: what is FLV associated with?

2009-11-11 Thread dan raaka
check Open screen project by Adobe.
-Dan


On Wed, Nov 11, 2009 at 11:41 AM, niko20  wrote:

> Hi,
>
> FLV is flash video, which isn't supported just yet. Supposedly in
> early 2010 they'll have a plugin to do it in Android 2.0
>
>
>
> On Nov 11, 10:21 am, Adrian Vintu  wrote:
> > Hi all,
> >
> > I can't seem to be able to play a FLV file on my Samsung Galaxy.
> >
> > Does anyone know why i need special software for that and also where to
> get
> > it?
> >
> > Thank you,
> > Adrian
> >
> > PS i suppose it's some proprietary thing, but why is it then playing in
> the
> > browser?
>
> --
> 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
>

-- 
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] HTC Tatto for Android Application testing

2009-11-11 Thread Nemat
Hey friends

I have to buy a new Android phone for testing android applications I
work upon.What about HTC Tatoo??

Can I buy that one??This would be specifically for testing not for
personal use...Can you guys help me out in choosing a good Android
device for testing ...please

Thanks in advance
Nemat

-- 
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: Recording direct system audio??

2009-11-11 Thread PJ
Bytes,

To answer your question, I'm using Java.

Two questions for you:

1. Are you testing this on both an emulator and on a real device?  You
might have problems on one but not the other.  In my case,
simultaneous record+playback is very choppy on the emulator (I have an
Intel Core 2 Duo 1.87GHz), but smoother on my real G1 device.  So,
just be aware that if the emulator/cpu is too slow for your design, it
can cause problems.

2. Are you invoking mAudioRecord.startRecording() as late as
possible?  I used to have problem with simultaneous record+playback
because I would first create and set up AudioRecord and invoke
mAudioRecord.startRecording(), then I would create and set up
AudioTrack and invoke mAudioTrack.play() afterwards.  However,
initializing the AudioTrack for playback takes a small amount of time
that can cause problems.  Even if you are not doing that, perhaps you
are doing other tasks that you could relocate before your
mAudioRecord.startRecording() call.  So, what I'm trying to say is:
try to invoke mAudioRecord.startRecording() as late as you possibly
can, and try to start consuming the audio data as soon as you possibly
can immediately after the startRecording() call.  This should also
reduce your buffer overflow problems.

Hope this helps,
-- PJ


On Nov 11, 11:22 pm, Bytes  wrote:
> PJ & Niko,
>
> Thanks for your response.
>
> Yes , whatever you are telling is correct. Using a large buffer will
> solve the buffer overflow problem.
>
> http://groups.google.com/group/android-developers/browse_thread/threa...
>
> According to above thread (ofcourse, he is using callbacks) and my
> personal exp showed me in isolation both recording and playing is fine
> but as soon as they combined problems occuring.
>
> Niko, can you share your feedback after implementing a loopback.
>
> Once again, Are you guys using C++ or Java ?
>
> -Bytes

-- 
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: Recording direct system audio??

2009-11-11 Thread Bytes
PJ & Niko,

Thanks for your response.

Yes , whatever you are telling is correct. Using a large buffer will
solve the buffer overflow problem.

http://groups.google.com/group/android-developers/browse_thread/thread/dda83b16eda1f848/beb397cbd5ab073d?lnk=raot

According to above thread (ofcourse, he is using callbacks) and my
personal exp showed me in isolation both recording and playing is fine
but as soon as they combined problems occuring.

Niko, can you share your feedback after implementing a loopback.

Once again, Are you guys using C++ or Java ?

-Bytes






-- 
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: Moving ADC non-winner to regular Market

2009-11-11 Thread Andrei
i think you have to rename your package and upload as new

On Nov 11, 11:37 pm, SR  wrote:
> Hi,
>
> I've got an application that didn't make the cut.  How can I get it to
> move/or can someone at Google please move the app from the ADC site
> back to normal Android Market panel so I can upload the updated
> version that included three more months work and, like, a zillion
> squashed bugs?
>
> Thanks!
>
> SR

-- 
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 set the inset.top to 0 for TextView

2009-11-11 Thread Riyaz
How to align the text to top of a TextView/container, that is top of
text should start be in (0,0) of TextView


http://schemas.android.com/apk/res/android";
>






I have used above snippet, however still output is not as expected

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] Menu Items.

2009-11-11 Thread Sasikumar.S
Hi,

In my application I'm using 3 layouts and one java file.
I'm creating a menu.
I want to show menu for only one particular layout.
The other layout should not get the menu.
what should i do for that?
can any one know about this?


Thanks in advance :)




-- 
Thanks & Regards
Sasikumar.S

-- 
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] Moving ADC non-winner to regular Market

2009-11-11 Thread SR
Hi,

I've got an application that didn't make the cut.  How can I get it to
move/or can someone at Google please move the app from the ADC site
back to normal Android Market panel so I can upload the updated
version that included three more months work and, like, a zillion
squashed bugs?

Thanks!

SR

-- 
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


Re: [android-developers] Re: Android keyevent keycodes and scancodes

2009-11-11 Thread Dianne Hackborn
The scan codes for 'a' and 'A' are the same, too.  Key codes and scan codes
represent physical buttons, not the textual result.

On Wed, Nov 11, 2009 at 12:23 PM, Android_n00b  wrote:

> Thanks a lot guys. Dianne, I didn't mean to be rude, I just wanted an
> answer from someone at Google, instead of anyone else. because I have
> posted a similar message in a bunch of forums and got different
> replies! Thanks again guys, I shall look into this. I was wondering
> whether there was any quicker way without creating a map because I am
> going to run into issues there, as the keycodes for 'a' and 'A' are
> the same (29).
>
> On Nov 11, 3:16 pm, Dianne Hackborn  wrote:
> > On Wed, Nov 11, 2009 at 11:34 AM, Android_n00b 
> wrote:
> > > I would really appreciate a reply from someone at Google if nobody can
> > > answer this. I really need to know this to move ahead with my
> > > project.
> >
> > Um, sorry it took me more than 20 minutes to respond to your post. :p
> >
> > The table mapping between scan codes and key codes is not available in
> the
> > SDK.  In addition, scan codes are by definition device dependent, so you
> > shouldn't rely on any particular value for them.  Instead you should use
> the
> > constants in KeyEvent to map the key codes you receive to the codes that
> you
> > want to send.
> >
> > --
> > 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
>



-- 
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

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-11 Thread Dianne Hackborn
I am pretty sure the emulator will not do anything intelligent with this.
:)  I very much doubt its touch driver has even been changed to generate
events with the new multitouch protocol.

On Wed, Nov 11, 2009 at 1:27 PM, PJ  wrote:

> I'm seriously considering installing a special mouse driver that
> allows two mice at once on the screen (they do exist), and trying to
> see if the emulator responds to simultaneous clicks as multi-touch.
> Someone please try this and let me know if it works.  Or maybe I'll
> get around to it in a couple of weeks...
>
>
>
> On Nov 10, 9:06 am, "gratiancutule...@yahoo.com"
>  wrote:
> > On Oct 27, 6:45 pm, Dianne Hackborn  wrote:
> >
> >
> >
> >
> >
> > > It's basically just some new APIs on MotionEvent:
> >
> > >http://developer.android.com/reference/android/view/MotionEvent.html
> >
> > >  >Hmmm
> > >  and I'm not sure why, but in the doc all of those new APIs are in
> gray, so
> > > they should be easy to see. :)
> >
> > > Or  here is the API diff report:
> >
> > >http://developer.android.com/sdk/api_diff/5/changes.html
> >
> > >  I see that
> I
> > > didn't get around to writing documentation in MotionEvent on the way
> > > multi-touch works; sorry about that.  Basically there are new actions
> that
> > > tell you when additional fingers go down and up, and each MotionEvent
> you
> > > receive allows you to query for the number of pointers in the event as
> well
> > > as the x, y, size, and pressure of each of those points (and the
> historical
> > > data for all those points as well if you want to collect all data since
> the
> > > last motion event you received).
> >
> > > So it should be pretty straight-forward.  The main thing to watch out
> for is
> > > the difference between the index in the current event for a pointer's
> data
> > > vs. the pointer ID for that pointer:
> >
> > >http://developer.android.com/reference/android/view/MotionEvent.html#.
> ..
> >
> > > <
> http://developer.android.com/reference/android/view/MotionEvent.html#..
> .>The
> > > pointer ID allows you to keep track of the individual fingers across
> > > multiple motion events.  For example, if the user touches finger 1,
> then
> > > finger 2, then releases 1, then touches 1 again, you would see:
> >
> > > Finger 1 down: MotionEvent ACTION_DOWN with one pointer, whose ID is 0.
> >
> > > Finger 2 down: MotionEvent ACTION_POINTER_2_DOWN with two pointers,
> whose
> > > IDs are 0 and 1.
> >
> > > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID
> is
> > > 1.
> >
> > > Finger 1 down: MotionEvent ACTION_POINTER_1_DOWN with two pointers,
> whose
> > > IDs are 0 and 1.
> >
> > > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID
> is
> > > 1.
> >
> > > Finger 2 up: MotionEvent ACTION_UP with one pointer, whose ID is 1.
> >
> > > (And inspite of what the update documentation says, the API allows for
> an
> > > arbitrary number of fingers, not just 3.  I just happened to define
> > > convenience constants for the first 3 finger down/up actions, but given
> > > their weird naming as seen above and the finger ID mask is actually
> 255, it
> > > is perhaps best just to ignore those constants. :p)
> >
> > > On Tue, Oct 27, 2009 at 9:29 AM, Streets Of Boston
> > > wrote:
> >
> > > > Kind-a burried inside the blog-post on developer.android.com(http://
> > > > developer.android.com/sdk/android-2.0-highlights.html), i saw that
> > > > multi-touch is now supported:
> >
> > > > Android virtual keyboard
> > > > •An improved keyboard layout to makes it easier to hit the correct
> > > > characters and improve typing speed.
> > > > •The ***framework's multi-touch support*** ensures that key presses
> > > > aren't missed while typing rapidly with two fingers.
> > > > •A smarter dictionary learns from word usage and automatically
> > > > includes contact names as suggestions.
> > > > <<
> >
> > > > I'm really curious how multi-touch is supported in the API.
> >
> > > --
> > > 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.
> >
> > Hello,
> > Could you give me a more detailed example. I'm still not sure what is
> > the difference between the pointer's ID and the pointer's index.
> > Thanks!- 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
>

[android-developers] Re: Widget Path

2009-11-11 Thread GPU
Is it possible to find out the view is from widget or from normal
application ?

On Nov 12, 8:34 am, GPU  wrote:
> Hi ,
> Is widget views are  handled by some system services ?
> not getting the getContext().getApplicationContext().getPackageCodePath
> ()
>
> On Nov 11, 6:36 pm, GPU  wrote:
>
> > Hi ,
>
> > From View object how to get the application code path for WIdgets
>
> > By using the getContext().getApplicationContext().getPackageCodePath
> > (); i am able to get the
>
> > apk path
>
> > Its giving the path like "data/app/appname.apk"
> > but for widget  i am not getting the path
>
> > Is widget views are  handled by some system services ?

-- 
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


Re: 答复: [android-developers] Re: hiding a forcib ly opened soft keyboard...

2009-11-11 Thread Dianne Hackborn
Ah sorry 0 is correct here.  Are you sure the window you are passing in
actually currently has input focus?  Fwiw, the framework code that
hides/shows the IME from long pressing on menu does basically the same thing
-- shows with the force flag, hides with 0 flags.

2009/11/11 sdphil 

> I'm basically doing what you show here.
>
> What I mean by "forced" soft keyboard is when you hold down the menu
> key.
>
> It doesn't make it go away.  I tried using
> view.getApplicationWindowToken vs. view.getWindowToken
>
> and it did not make any difference.  so something else must be going
> on...
>
> On Nov 11, 7:02 pm, zhanglei(张雷)  wrote:
> > InputMethodManager m_inputManager = null;
> > //show input
> > m_inputManager = (InputMethodManager)
> getSystemService(Context.INPUT_METHOD_SERVICE);
> > m_inputManager.showSoftInput(
> this.getCurrentFocus(),InputMethodManager.SHOW_FORCED );
> >
> > //hide input
> > private boolean hideInputMethod( )
> > {
> > boolean bHideIM =
> m_inputManager.hideSoftInputFromWindow(name.getWindowToken(), 0); //hide
> Input Method
> > if( false == bHideIM )
> > {
> > Log.e( TAG, "hide InputMethod is error!" );
> > }
> > return bHideIM;
> > }
> >
> > -邮件原件-
> > 发件人: sdphil [mailto:phil.pellouch...@gmail.com]
> > 发送时间: 2009年11月12日 10:43
> > 收件人: Android Developers
> > 主题: [android-developers] Re: hiding a forcibly opened soft keyboard...
> >
> > What flag is that?  All I see documented are --
> >
> > int HIDE_IMPLICIT_ONLY  Flag for hideSoftInputFromWindow(IBinder,
> > int) to indicate that the soft input window should only be hidden if
> > it was not explicitly shown by the user.
> > int HIDE_NOT_ALWAYS Flag for hideSoftInputFromWindow(IBinder,
> int)
> > to indicate that the soft input window should normally be hidden,
> > unless it was originally shown with SHOW_FORCED.
> >
> > http://developer.android.com/intl/fr/reference/android/view/inputmeth...
> >
> > tia.
> >
> > On Nov 11, 6:40 pm, Dianne Hackborn  wrote:
> >
> >
> >
> > > You need to pass the flag to force it to be hidden.
> >
> > > On Wed, Nov 11, 2009 at 5:09 PM, sdphil 
> wrote:
> > > > i am attempting to hide a forcibly opened soft keyboard using --
> >
> > > >// hide the soft keyboard.
> > > >View view = (View) findViewById(R.id.DebugText);
> > > >InputMethodManager manager = (InputMethodManager)
> > > > getSystemService(Context.INPUT_METHOD_SERVICE);
> > > >IBinder binder = view.getApplicationWindowToken();
> > > >if (binder != null) {
> > > >manager.hideSoftInputFromWindow(binder, 0);
> > > >}
> >
> > > > but it doesn't seem to be working - any ideas?
> >
> > > > tia.
> >
> > > > --
> > > > 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
> >
> > > --
> > > 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 athttp://
> groups.google.com/group/android-developers?hl=en
>
> --
> 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
>



-- 
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+

Re: [android-developers] Re: How do I programatically and permenantly remove an icon from the launcher

2009-11-11 Thread Dianne Hackborn
Third party applications can not be granted CHANGE_COMPONENT_ENABLED_STATE,
since that would allow them to break or otherwise mess with other
applications.

On Wed, Jun 17, 2009 at 3:29 PM, erictcrook  wrote:

> Ok, so, I am unable to use setComponentEnable.
>
> I apologize for the long post, I am trying to include all the helpful info
> here.
>
> ComponentName componentName =
> *new* ComponentName("com.ericcrook.disabletest",
> "com.ericcrook.disabletest.DisableActivity.class");
>
> pm.setComponentEnabledSetting(componentName, PackageManager.
> *COMPONENT_ENABLED_STATE_DISABLED*, PackageManager.*DONT_KILL_APP*);
>
> If the ComponentName points to this class, it runs without error, however
> the icon is still displayed in the Applications Drawer.
>
> If ComponentName points to another class in another package, it throws this
>
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): Caused by:
> java.lang.SecurityException: Permission Denial: attempt to change component
> state from pid=2026, uid=10004, package uid=10032
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.os.Parcel.readException(Parcel.java:1234)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.os.Parcel.readException(Parcel.java:1222)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:1823)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.app.ApplicationContext$ApplicationPackageManager.setComponentEnabledSetting(ApplicationContext.java:2421)
>
>
> Looking at the source found at:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/PackageManagerService.java;h=1f3ec2bd1f7e93655b10270b8691726de8ead421;hb=cupcake
> on line 4461
>
> this line appears:
>
> final int permission = 
> mContext.checkCallingPermission(android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE);
>
> This is later checked at line 4475:
>  if (!allowedByPermission && (uid != pkgSetting.userId)) {
>throw new SecurityException(
>
> "Permission Denial: attempt to change component state 
> from pid="
> + Binder.getCallingPid()
>
>  + ", uid=" + uid + ", package uid=" + 
> pkgSetting.userId);
> }
>
> The weird thing about all this is, when I set
>
>  "android.permission.CHANGE_COMPONENT_ENABLED_STATE"* />
>
> as a child of Manifest, when I install the app, it says, "No permissions
> required"
> If I request other permissions, they show up appropriately during install.
> I don't fully understand the uid check here, but I am looking into it.
> Thanks,
> Eric Crook
>
> n Wed, Jun 17, 2009 at 10:08 AM, Romain Guy  wrote:
>
>>
>> Launcher is the name of the application also called Home. So Home ==
>> Launcher and Launcher == Home.
>>
>> UNINSTALL_SHORTCUT can *only* be used to uninstall a shortcut from the
>> workspace (or desktop). Icons in the applications drawer can only be
>> uninstalled by either disabling the activities or uninstalling
>> packages via the PackageManager.
>>
>> > /*I explicitly send my intent to the launcher app.  I only knew to do
>> this
>> > by looking
>> > at the source code I found here:
>> >
>> http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/UninstallShortcutReceiver.java;h=e490f9c0f59e609ba70d82a8093c950285865267;hb=cupcake
>> > */
>> > intent.setComponent(
>> >
>> > new ComponentName("com.android.launcher",
>> > "com.android.launcher.UninstallShortcutReceiver"));
>>
>> There's absolutely no need to do this. All you need to do is set the
>> action to com.android.launcher.permission.UNINSTALL_SHORTCUT.
>>
>> --
>> 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
>> -~--~~~~--~~--~--~---
>>
>>


-- 
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 

Re: [android-developers] Why activity Icon is not removed from launcher

2009-11-11 Thread Dianne Hackborn
Try it without DONT_KILL_APP.  There may be a bug in the delayed broadcast
that happens as a result of not killing the activity, which I was actually
just looking at. :)

On Wed, Nov 11, 2009 at 7:42 PM, shahzad ahmad wrote:

> hi,
>I'm trying to remove activity icon from launcher panel. I'm using
> firmware 1.5. But nothing seems to work. I'm not receiving any error but
> activity icon is not removed. Following is the code
>
>
> public class HelloActivity extends Activity {
>
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
>setContentView(R.layout.hello_activity);
> }
>
>
> public void onDestroy() {
> super.onDestroy();
> disbaleActivity();
> }
>
> private void disbaleActivity(){
> ComponentName receiver = new
> ComponentName(getApplicationContext(),
> "HelloActivity.class");
> PackageManager pm = getPackageManager();
> pm.setComponentEnabledSetting(receiver,
> PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
> PackageManager.DONT_KILL_APP);
>
> }
> }
>
>
> I've set following permission in manifest file
>  android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
>
> and following is portion of activity in manifest file
>
>   
> 
> 
> 
> 
> 
>
>
> Please help me to resolve the issue. According to documentation it should
> work but it doesn't. I've tried calling disbaleActivity() even from
> OnCreate() method but no success :-(
>
> Regards,
> shaz
>
>  --
> 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




-- 
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

Re: [android-developers] Re: Widget Layout Frustration

2009-11-11 Thread for android
Oh ok.I was under the assumption that only the launcher application
understands that Intent.

On Wed, Nov 11, 2009 at 9:49 PM, Romain Guy  wrote:

> That's the common Intent.
>
> On Wed, Nov 11, 2009 at 1:22 AM, for android  wrote:
> > i was referring to the INSTALL_SHORTCUT in the launcher application with
> > action "com.android.launcher.action.INSTALL_SHORTCUT"
> > which refers to the Launcher application.Is there any common Intent for
> > that?
> >
> > On Thu, Nov 5, 2009 at 9:09 PM, Romain Guy  wrote:
> >>
> >> >Is there any common intent to create short-cuts accross "Home"
> >> > applications.Because as I see it if the user is using any other
> >> > application
> >> > as the desktop,the short-cut is not created for those applications.
> >>
> >> Yes, there is. If it doesn't work in some Home screens, they are doing
> >> a poor job :)
> >>
> >> >
> >> > On Thu, Nov 5, 2009 at 11:09 AM, Romain Guy 
> >> > wrote:
> >> >>
> >> >> Just create a shortcut. Apps can offer shortcuts.
> >> >>
> >> >> On Wed, Nov 4, 2009 at 9:17 PM, Susan  wrote:
> >> >> > Romain,
> >> >> >
> >> >> > I understand what you're saying and I am generally in favor of not
> >> >> > trying to fit a square peg in a round hole. However, it seems like
> >> >> > there are other valid reasons for making a widget look like an
> icon.
> >> >> > For example, if I wanted to use a different icon for a standard app
> >> >> > --
> >> >> > maybe to make it easier to see for someone with vision problems or
> to
> >> >> > make it brighter so it can be seen more easily while driving. Is
> >> >> > there
> >> >> > some better way to change an icon than to make a whole new widget?
> >> >> >
> >> >> > Thanks!
> >> >> >
> >> >> > Susan
> >> >> >
> >> >> > PS - Thanks, Evan, that's super helpful!
> >> >> >
> >> >> > On Nov 4, 4:47 pm, Romain Guy  wrote:
> >> >> >> No, that's not what I mean. I mean that shortcuts should look like
> >> >> >> shortcuts and widgets like widgets. Just don't expect your code to
> >> >> >> keep matching Home across devices, themes, versions, etc.
> >> >> >>
> >> >> >> > They do EXACTLY what they say
> >> >> >> > and don't take up any more than the minimum space;
> >> >> >>
> >> >> >> You don't have to make thewidgetlook like a shortcut for that.
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> > E
> >> >> >>
> >> >> >> > On Nov 4, 5:07 pm, Romain Guy  wrote:
> >> >> >> >> You cannot change thetextoriconof a shortcut. Just don't make
> >> >> >> >> your
> >> >> >> >>widgetlook like a shortcut. There's no reason to make it look
> like
> >> >> >> >> a
> >> >> >> >> shortcut if it's awidget. It's just misleading.
> >> >> >>
> >> >> >> >> On Wed, Nov 4, 2009 at 2:05 PM, Evan Ruff  >
> >> >> >> >> wrote:
> >> >> >> >> > RG,
> >> >> >>
> >> >> >> >> > Mywidgetmanages the state of a Service running in the
> >> >> >> >> > background.
> >> >> >> >> > As
> >> >> >> >> > you click thewidgetit starts/stops/pauses/etc the service. I
> >> >> >> >> > want
> >> >> >> >> > it
> >> >> >> >> > to look like a Shortcut so that it fits into the Home Screen
> >> >> >> >> > seamlessly. Additionally, theiconandtextchange depending on
> the
> >> >> >> >> > state of the service. Is there a way to do that using a
> >> >> >> >> > shortcut
> >> >> >> >> > without going with awidget? Otherwise, can you think of
> another
> >> >> >> >> > way
> >> >> >> >> > to use the OS-level resources to render the same sort of
> thing?
> >> >> >>
> >> >> >> >> > Thanks!
> >> >> >>
> >> >> >> >> > Evan
> >> >> >>
> >> >> >> >> > On Nov 4, 4:59 pm, Romain Guy  wrote:
> >> >> >> >> >> Note that Home uses a custom view derived from TextView to
> >> >> >> >> >> create
> >> >> >> >> >> this
> >> >> >> >> >> effect. Also, if you want yourwidgetto look like a shortcut,
> >> >> >> >> >> why
> >> >> >> >> >> provide awidgetin the first place? It's very easy for
> >> >> >> >> >> applications
> >> >> >> >> >> to offer shortcuts and let Home take care of how it looks
> >> >> >> >> >> (what
> >> >> >> >> >> will
> >> >> >> >> >> happen to yourwidgetwith other Home screens? What if we
> decide
> >> >> >> >> >> to
> >> >> >> >> >> change the radius of the background behind thetext? etc.)
> >> >> >>
> >> >> >> >> >> On Wed, Nov 4, 2009 at 1:55 PM, Evan Ruff
> >> >> >> >> >> 
> >> >> >> >> >> wrote:
> >> >> >> >> >> > Susan,
> >> >> >>
> >> >> >> >> >> > I've tweaked it a little bit more and here is where I'm
> at:
> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> > >
> http://i243.photobucket.com/albums/ff2/gte619n/widgetLayout.png
> >> >> >>
> >> >> >> >> >> > Pixel for Pixel, thetextis exactly the same. The location
> >> >> >> >> >> > within the
> >> >> >> >> >> > bounding box is the same, as is the distance between
> >> >> >> >> >> > thetextand
> >> >> >> >> >> > the
> >> >> >> >> >> > graphic. In order to do this, I used the XML Layout and an
> >> >> >> >> >> > XML
> >> >> >> >> >> > drawable, no 9-patch was necessary.
> >> >> >>
> >> >> >> >> >> > Here's the code:
> >> >> >> >> >> > res/drawabl

[android-developers] Re: listDivider in 2.0

2009-11-11 Thread alex
I've ended up copying the 1.*-style divider (divider_horizontal_dark.
9.png) and changing
--
android:src="?android:attr/listDivider"
--
to
--
src="@drawable/divider_horizontal_dark"
--
from the snippet in the first post. Seems like they like breaking APIs
for no reason.

-- 
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


Re: [android-developers] Re: Widget Layout Frustration

2009-11-11 Thread Guru
thanks Romain.

On Wed, Nov 11, 2009 at 9:49 PM, Romain Guy  wrote:

> That's the common Intent.
>
> On Wed, Nov 11, 2009 at 1:22 AM, for android  wrote:
> > i was referring to the INSTALL_SHORTCUT in the launcher application with
> > action "com.android.launcher.action.INSTALL_SHORTCUT"
> > which refers to the Launcher application.Is there any common Intent for
> > that?
> >
> > On Thu, Nov 5, 2009 at 9:09 PM, Romain Guy  wrote:
> >>
> >> >Is there any common intent to create short-cuts accross "Home"
> >> > applications.Because as I see it if the user is using any other
> >> > application
> >> > as the desktop,the short-cut is not created for those applications.
> >>
> >> Yes, there is. If it doesn't work in some Home screens, they are doing
> >> a poor job :)
> >>
> >> >
> >> > On Thu, Nov 5, 2009 at 11:09 AM, Romain Guy 
> >> > wrote:
> >> >>
> >> >> Just create a shortcut. Apps can offer shortcuts.
> >> >>
> >> >> On Wed, Nov 4, 2009 at 9:17 PM, Susan  wrote:
> >> >> > Romain,
> >> >> >
> >> >> > I understand what you're saying and I am generally in favor of not
> >> >> > trying to fit a square peg in a round hole. However, it seems like
> >> >> > there are other valid reasons for making a widget look like an
> icon.
> >> >> > For example, if I wanted to use a different icon for a standard app
> >> >> > --
> >> >> > maybe to make it easier to see for someone with vision problems or
> to
> >> >> > make it brighter so it can be seen more easily while driving. Is
> >> >> > there
> >> >> > some better way to change an icon than to make a whole new widget?
> >> >> >
> >> >> > Thanks!
> >> >> >
> >> >> > Susan
> >> >> >
> >> >> > PS - Thanks, Evan, that's super helpful!
> >> >> >
> >> >> > On Nov 4, 4:47 pm, Romain Guy  wrote:
> >> >> >> No, that's not what I mean. I mean that shortcuts should look like
> >> >> >> shortcuts and widgets like widgets. Just don't expect your code to
> >> >> >> keep matching Home across devices, themes, versions, etc.
> >> >> >>
> >> >> >> > They do EXACTLY what they say
> >> >> >> > and don't take up any more than the minimum space;
> >> >> >>
> >> >> >> You don't have to make thewidgetlook like a shortcut for that.
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> > E
> >> >> >>
> >> >> >> > On Nov 4, 5:07 pm, Romain Guy  wrote:
> >> >> >> >> You cannot change thetextoriconof a shortcut. Just don't make
> >> >> >> >> your
> >> >> >> >>widgetlook like a shortcut. There's no reason to make it look
> like
> >> >> >> >> a
> >> >> >> >> shortcut if it's awidget. It's just misleading.
> >> >> >>
> >> >> >> >> On Wed, Nov 4, 2009 at 2:05 PM, Evan Ruff  >
> >> >> >> >> wrote:
> >> >> >> >> > RG,
> >> >> >>
> >> >> >> >> > Mywidgetmanages the state of a Service running in the
> >> >> >> >> > background.
> >> >> >> >> > As
> >> >> >> >> > you click thewidgetit starts/stops/pauses/etc the service. I
> >> >> >> >> > want
> >> >> >> >> > it
> >> >> >> >> > to look like a Shortcut so that it fits into the Home Screen
> >> >> >> >> > seamlessly. Additionally, theiconandtextchange depending on
> the
> >> >> >> >> > state of the service. Is there a way to do that using a
> >> >> >> >> > shortcut
> >> >> >> >> > without going with awidget? Otherwise, can you think of
> another
> >> >> >> >> > way
> >> >> >> >> > to use the OS-level resources to render the same sort of
> thing?
> >> >> >>
> >> >> >> >> > Thanks!
> >> >> >>
> >> >> >> >> > Evan
> >> >> >>
> >> >> >> >> > On Nov 4, 4:59 pm, Romain Guy  wrote:
> >> >> >> >> >> Note that Home uses a custom view derived from TextView to
> >> >> >> >> >> create
> >> >> >> >> >> this
> >> >> >> >> >> effect. Also, if you want yourwidgetto look like a shortcut,
> >> >> >> >> >> why
> >> >> >> >> >> provide awidgetin the first place? It's very easy for
> >> >> >> >> >> applications
> >> >> >> >> >> to offer shortcuts and let Home take care of how it looks
> >> >> >> >> >> (what
> >> >> >> >> >> will
> >> >> >> >> >> happen to yourwidgetwith other Home screens? What if we
> decide
> >> >> >> >> >> to
> >> >> >> >> >> change the radius of the background behind thetext? etc.)
> >> >> >>
> >> >> >> >> >> On Wed, Nov 4, 2009 at 1:55 PM, Evan Ruff
> >> >> >> >> >> 
> >> >> >> >> >> wrote:
> >> >> >> >> >> > Susan,
> >> >> >>
> >> >> >> >> >> > I've tweaked it a little bit more and here is where I'm
> at:
> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> > >
> http://i243.photobucket.com/albums/ff2/gte619n/widgetLayout.png
> >> >> >>
> >> >> >> >> >> > Pixel for Pixel, thetextis exactly the same. The location
> >> >> >> >> >> > within the
> >> >> >> >> >> > bounding box is the same, as is the distance between
> >> >> >> >> >> > thetextand
> >> >> >> >> >> > the
> >> >> >> >> >> > graphic. In order to do this, I used the XML Layout and an
> >> >> >> >> >> > XML
> >> >> >> >> >> > drawable, no 9-patch was necessary.
> >> >> >>
> >> >> >> >> >> > Here's the code:
> >> >> >> >> >> > res/drawable/text_border.xml
> >> >> >> >> >> >  >> >> >> >> >> > xmlns:android="http://s

[android-developers] Why activity Icon is not removed from launcher

2009-11-11 Thread shahzad ahmad
hi,
   I'm trying to remove activity icon from launcher panel. I'm using
firmware 1.5. But nothing seems to work. I'm not receiving any error but
activity icon is not removed. Following is the code


public class HelloActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
   setContentView(R.layout.hello_activity);
}


public void onDestroy() {
super.onDestroy();
disbaleActivity();
}

private void disbaleActivity(){
ComponentName receiver = new
ComponentName(getApplicationContext(),
"HelloActivity.class");
PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);

}
}


I've set following permission in manifest file


and following is portion of activity in manifest file

  







Please help me to resolve the issue. According to documentation it should
work but it doesn't. I've tried calling disbaleActivity() even from
OnCreate() method but no success :-(

Regards,
shaz

-- 
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: Widget Path

2009-11-11 Thread GPU
Hi ,
Is widget views are  handled by some system services ?
not getting the getContext().getApplicationContext().getPackageCodePath
()


On Nov 11, 6:36 pm, GPU  wrote:
> Hi ,
>
> From View object how to get the application code path for WIdgets
>
> By using the getContext().getApplicationContext().getPackageCodePath
> (); i am able to get the
>
> apk path
>
> Its giving the path like "data/app/appname.apk"
> but for widget  i am not getting the path
>
> Is widget views are  handled by some system services ?

-- 
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


Re: [android-developers] Re: How do I programatically and permenantly remove an icon from the launcher

2009-11-11 Thread shahzad ahmad
Were you able to remove the activity icon from launcher panel?

On Thu, Jun 18, 2009 at 10:29 AM, erictcrook  wrote:

> Ok, so, I am unable to use setComponentEnable.
>
> I apologize for the long post, I am trying to include all the helpful info
> here.
>
> ComponentName componentName =
> *new* ComponentName("com.ericcrook.disabletest",
> "com.ericcrook.disabletest.DisableActivity.class");
>
> pm.setComponentEnabledSetting(componentName, PackageManager.
> *COMPONENT_ENABLED_STATE_DISABLED*, PackageManager.*DONT_KILL_APP*);
>
> If the ComponentName points to this class, it runs without error, however
> the icon is still displayed in the Applications Drawer.
>
> If ComponentName points to another class in another package, it throws this
>
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): Caused by:
> java.lang.SecurityException: Permission Denial: attempt to change component
> state from pid=2026, uid=10004, package uid=10032
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.os.Parcel.readException(Parcel.java:1234)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.os.Parcel.readException(Parcel.java:1222)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:1823)
> 06-17 16:13:18.075: ERROR/AndroidRuntime(2026): at
> android.app.ApplicationContext$ApplicationPackageManager.setComponentEnabledSetting(ApplicationContext.java:2421)
>
>
> Looking at the source found at:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/PackageManagerService.java;h=1f3ec2bd1f7e93655b10270b8691726de8ead421;hb=cupcake
> on line 4461
>
> this line appears:
>
> final int permission = 
> mContext.checkCallingPermission(android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE);
>
> This is later checked at line 4475:
>  if (!allowedByPermission && (uid != pkgSetting.userId)) {
>throw new SecurityException(
>
> "Permission Denial: attempt to change component state 
> from pid="
> + Binder.getCallingPid()
>
>  + ", uid=" + uid + ", package uid=" + 
> pkgSetting.userId);
> }
>
> The weird thing about all this is, when I set
>
>  "android.permission.CHANGE_COMPONENT_ENABLED_STATE"* />
>
> as a child of Manifest, when I install the app, it says, "No permissions
> required"
> If I request other permissions, they show up appropriately during install.
> I don't fully understand the uid check here, but I am looking into it.
> Thanks,
> Eric Crook
>
> n Wed, Jun 17, 2009 at 10:08 AM, Romain Guy  wrote:
>
>>
>> Launcher is the name of the application also called Home. So Home ==
>> Launcher and Launcher == Home.
>>
>> UNINSTALL_SHORTCUT can *only* be used to uninstall a shortcut from the
>> workspace (or desktop). Icons in the applications drawer can only be
>> uninstalled by either disabling the activities or uninstalling
>> packages via the PackageManager.
>>
>> > /*I explicitly send my intent to the launcher app.  I only knew to do
>> this
>> > by looking
>> > at the source code I found here:
>> >
>> http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/UninstallShortcutReceiver.java;h=e490f9c0f59e609ba70d82a8093c950285865267;hb=cupcake
>> > */
>> > intent.setComponent(
>> >
>> > new ComponentName("com.android.launcher",
>> > "com.android.launcher.UninstallShortcutReceiver"));
>>
>> There's absolutely no need to do this. All you need to do is set the
>> action to com.android.launcher.permission.UNINSTALL_SHORTCUT.
>>
>> --
>> 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
>> -~--~~~~--~~--~--~---
>>
>>

-- 
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] Android 2.0 setImageResource(R.drawable.my_icon)

2009-11-11 Thread Alexey Volovoy
hi all , not sure if it's a bug or i'm using that in the wrong place.
If i have following line (s ) of code in onCreate ()
iconView.setImageResource(R.drawable.my_icon);
And ONLY if my device(Droid) or emulator running 2.0 in landscape it
cause activity go through lifecycle endlessly like described in this
thread :
http://groups.google.com/group/android-developers/browse_thread/thread/d3d6f944c6167952
If i move code to onStart() - life is good again.
Weird thing it only happens if i'm testing 2.0 and only landscape. I
realize that onCreate may be not the best choice to put such things
in, but still it's weird that it doesn't work only in landscape.

-- 
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


Re: 答复: [android-developers] Re: hiding a forcib ly opened soft keyboard...

2009-11-11 Thread sdphil
I'm basically doing what you show here.

What I mean by "forced" soft keyboard is when you hold down the menu
key.

It doesn't make it go away.  I tried using
view.getApplicationWindowToken vs. view.getWindowToken

and it did not make any difference.  so something else must be going
on...

On Nov 11, 7:02 pm, zhanglei(张雷)  wrote:
> InputMethodManager m_inputManager = null;
> //show input
> m_inputManager = (InputMethodManager) 
> getSystemService(Context.INPUT_METHOD_SERVICE);
> m_inputManager.showSoftInput( 
> this.getCurrentFocus(),InputMethodManager.SHOW_FORCED );
>
> //hide input
> private boolean hideInputMethod( )
> {
> boolean bHideIM = 
> m_inputManager.hideSoftInputFromWindow(name.getWindowToken(), 0); //hide 
> Input Method
> if( false == bHideIM )
> {
> Log.e( TAG, "hide InputMethod is error!" );
> }
> return bHideIM;
> }
>
> -邮件原件-
> 发件人: sdphil [mailto:phil.pellouch...@gmail.com]
> 发送时间: 2009年11月12日 10:43
> 收件人: Android Developers
> 主题: [android-developers] Re: hiding a forcibly opened soft keyboard...
>
> What flag is that?  All I see documented are --
>
> int HIDE_IMPLICIT_ONLY  Flag for hideSoftInputFromWindow(IBinder,
> int) to indicate that the soft input window should only be hidden if
> it was not explicitly shown by the user.
> int HIDE_NOT_ALWAYS Flag for hideSoftInputFromWindow(IBinder, int)
> to indicate that the soft input window should normally be hidden,
> unless it was originally shown with SHOW_FORCED.
>
> http://developer.android.com/intl/fr/reference/android/view/inputmeth...
>
> tia.
>
> On Nov 11, 6:40 pm, Dianne Hackborn  wrote:
>
>
>
> > You need to pass the flag to force it to be hidden.
>
> > On Wed, Nov 11, 2009 at 5:09 PM, sdphil  wrote:
> > > i am attempting to hide a forcibly opened soft keyboard using --
>
> > >// hide the soft keyboard.
> > >View view = (View) findViewById(R.id.DebugText);
> > >InputMethodManager manager = (InputMethodManager)
> > > getSystemService(Context.INPUT_METHOD_SERVICE);
> > >IBinder binder = view.getApplicationWindowToken();
> > >if (binder != null) {
> > >manager.hideSoftInputFromWindow(binder, 0);
> > >}
>
> > > but it doesn't seem to be working - any ideas?
>
> > > tia.
>
> > > --
> > > 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
>
> > --
> > 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 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
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: Showing ellipsis in a TextView?

2009-11-11 Thread Mark Wyszomierski
nEx,

I finally took a look at the TextUtils class. It doesn't seem to
consider height at all, just width - you found the same thing right? I
think I have to measure each character at a time and handle wrapping
myself until it gets to a maxLines parameter I'll set, then do the
ellipsizing,

Thanks

On Oct 21, 11:40 am, Mark Wyszomierski  wrote:
> Ha that's the same exact control I'm looking to create, multiline and
> if it spills over three vertical lines, replace the last few
> characters with anellipsisand "More" text - the user clicks that and
> the textview expands to full height.
>
> I have written this kind of control for blackberry but was hoping
> there'd be something already premade in android. I'll check out the
> source of TextView as a starting point. Thanks for your help and
> confirming this.
>
> On Oct 21, 12:31 pm, "nEx.Software" 
> wrote:
>
>
>
> > I have ellipsize working for multiline text. I had to write my own
> > ellipsize function to do it. I wanted to replace the "..." with
> > "...Read More" so my implementation is highly customized. A tip, you
> > can clone the ellipsize function from the AOSP then use it directly.
> > The problem appears to be not in the ellipsize code itself but in
> > somewhere in how the TextView tells its size to the ellipsize
> > function. I have not tracked down exactly where this is happening and
> > since I don't have a build environment setup for AOSP, it would be
> > hard for me to test it anyway. I should revisit my implementation and
> > see if I can clean it up for more generic use.
>
> > On Oct 21, 8:30 am, Mark Wyszomierski  wrote:
>
> > > Ok, that confirms what I'm seeing. I wonder if there really is a way
> > > to get theellipsisto work for multiline text. If not, I will have to
> > > write a widget for it unfortunately!
>
> > > Thanks
>
> > > On Oct 20, 12:37 pm, Wouter  wrote:
>
> > > > Yes I have searched this also before and this also works for single
> > > > line text so i think you have to use it this way..
>
> > > > Wouter
>
> > > > On Oct 20, 6:23 pm, MarkWyszomierski wrote:
>
> > > > > Hi Wouter,
>
> > > > > Yes that does work for single line text, but not for multiline -
> > > > > checking from other posts here it seems like theellipsisdoes not
> > > > > handle multiline text correctly?
>
> > > > > Thanks
>
> > > > > On Oct 20, 12:06 pm, Wouter  wrote:
>
> > > > > > I use this in my layout xml file:
>
> > > > > > android:ellipsize="end"
> > > > > > android:singleLine="true"
>
> > > > > > And this works perfectly for text on 1 line..
>
> > > > > > On Oct 20, 5:42 pm, MarkWyszomierski wrote:
>
> > > > > > > Hi,
>
> > > > > > > I have a normal TextView which has multiple lines. I set its max
> > > > > > > number of lines to 3. I'd like it to show anellipsisat the end if
> > > > > > > the text is too long:
>
> > > > > > >   TextView tv = new TextView(context);
> > > > > > >   tv.setLines(tv);
> > > > > > >   tv.setText("some really long text...");
>
> > > > > > > I tried the setellipsiscalls but it doesn't seem to do anything -
> > > > > > > the text appears the same way. How do we get this to work?
>
> > > > > > > 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: Unexpected Resumes Running Under 2.0

2009-11-11 Thread Alexey Volovoy
I have same issue cause by this line of code i onCreate();
iconView.setImageResource(R.drawable.mylogor);

On Oct 29, 9:18 pm, Nmix  wrote:
> Ok, I found it -- it's my bug. Mark, you were partly right, and that
> helped. It was related to the configuration. Here is the guilty code,
> which is in onCreate():
>
> mRes = getResources();
> mConfig = mRes.getConfiguration();
> mConfig.setToDefaults();      //Error here.
>
> There should not be a call to setToDefaults(). I don't remember now
> what I was thinking at the time, and the Android doc is very
> uninformative for this method. Possibly I copied an example from
> somewhere. Removing this line solved the problem.
>
> Funny thing is that the bad code works fine pre-2.0 releases. However,
> once I found it I carefully scoured the logcat on a 1.6 AVD and I did
> find the same warning log spit out from the system process. Of course,
> since nothing was broken and there was no way to relate the log to my
> process, I had no idea.
>
> I know now because it breaks in 2.0 by forcing a restart of the
> activity that resembles a config change. I don't know if the 2.0
> behavior is right or wrong since the write-up for setToDefaults() says
> very little.
>
> fadden: I did consider filing a bug, but that seemed premature when I
> wasn't able to localize the problem. I didn't want to simply point to
> the app on Android Market. Now the point is moot. Thanks.
>
> On Oct 29, 7:04 pm, Nmix  wrote:
>
>
>
> > Apart from a Log.d() that I just added to produce the logcat trace and
> > the super call, there was just one line of code (an 'if' with a
> > condition which isn't satisfied) which is pretty boring. Regardless, I
> > commented that out. No change in behavior. Thanks for the suggestion,
> > Mark, but I am beginning to think that something quite a bit more
> > subtle is going on.
>
> > Now I'm getting quite worried about when 2.0 shows up in OTA updates
> > because it may/will break my app and I have no idea what to do. Up to
> > 1.6 the app is solid as a rock.
>
> > On Oct 29, 5:30 pm, Mark Murphy  wrote:
>
> > > Nmix wrote:
> > > > I did some additional testing on the 2.0 AVD, including numerous
> > > > project cleans, compiling with 1.5, 1.6 and 2.0, and cutting out large
> > > > swaths of code. The problem persists. Yet other apps I have work fine
> > > > on 2.0.
>
> > > > I peppered logs in each of the major life cycle methods I implement,
> > > > and this is what I get:
> > > > 10-29 20:33:23.561: DEBUG/tag(502): onCreate
> > > > 10-29 20:33:24.271: DEBUG/tag(502): onResume
> > > > 10-29 20:33:26.101: DEBUG/tag(502): onSaveInstanceState
> > > > 10-29 20:33:26.214: DEBUG/tag(502): onPause
> > > > 10-29 20:33:26.311: DEBUG/tag(502): onCreate
> > > > 10-29 20:33:26.561: DEBUG/tag(502): onRestoreInstanceState
> > > > 10-29 20:33:26.571: DEBUG/tag(502): onResume
> > > > 10-29 20:33:27.081: DEBUG/tag(502): onSaveInstanceState
> > > > 10-29 20:33:27.130: DEBUG/tag(502): onPause
> > > > 10-29 20:33:27.211: DEBUG/tag(502): onCreate
> > > > 10-29 20:33:27.601: DEBUG/tag(502): onRestoreInstanceState
> > > > 10-29 20:33:27.611: DEBUG/tag(502): onResume
> > > > 10-29 20:33:28.162: DEBUG/tag(502): onSaveInstanceState
> > > > 10-29 20:33:28.201: DEBUG/tag(502): onPause
> > > > 10-29 20:33:28.541: DEBUG/tag(502): onCreate
> > > > 10-29 20:33:28.951: DEBUG/tag(502): onRestoreInstanceState
> > > > 10-29 20:33:28.960: DEBUG/tag(502): onResume
> > > > 10-29 20:33:29.631: DEBUG/FatCalc(502): onPause
>
> > > > I finally kill it with the back key, though it sometimes takes a few
> > > > tries because the timing is critical.
>
> > > > Elsewhere in the log, I found something in the logs put out by the
> > > > system process that from their timestamp may be correlated with the
> > > > uninstall/install process initiated by ADB:
>
> > > > 10-29 20:33:14.391: WARN/ResourceType(55): Resources don't contain
> > > > package for resource number 0x7f06
> > > > 10-29 20:33:14.461: WARN/ResourceType(55): Resources don't contain
> > > > package for resource number 0x7f060001
>
> > > > These correspond to string resources in the app, both of which appear
> > > > to display normally when the app runs, in the momentary glimpses of
> > > > the app's UI display before it gets destroyed.
>
> > > > This really has me puzzled. Any help appreciated.
>
> > > Something in your onResume() would appear to be triggering behavior
> > > reminiscent of a screen rotation or other configuration change.
>
> > > I'd start by commenting out everything in onResume() and seeing if the
> > > problem persists.
>
> > > --
> > > Mark Murphy (a Commons 
> > > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > > Android 1.6 Programming Books:http://commonsware.com/books

-- 
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+u

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-11 Thread Daniel Lew
This worked great, though it's quite a bit of setup for something that
I think ought to be handled by Android.  I just wanted to say thanks,
this problem was driving me up the wall.

-Daniel

On Nov 10, 7:22 pm, Lance Nanek  wrote:
> Here's a quick attempt at rewriting it without a static. Turned out
> more complex than I'd like. Pastebin version:http://pastebin.com/m7b8b184
>
> Inline version:
> public class MyActivity extends Activity {
>
>         private final static String LOG_TAG = MyActivity.class.getSimpleName
> ();
>
>         private final static int DIALOG_ID = 1;
>
>         private Task mTask;
>
>         private boolean mShownDialog;
>
>         @Override
>         protected void onPrepareDialog(int id, Dialog dialog) {
>                 super.onPrepareDialog(id, dialog);
>
>                 if ( id == DIALOG_ID ) {
>                         mShownDialog = true;
>                 }
>         }
>
>         private void onTaskCompleted() {
>                 Log.i(LOG_TAG, "Activity " + this + " has been notified the 
> task is
> complete.");
>
>                 //Check added because dismissDialog throws an exception if the
> current
>                 //activity hasn't shown it. This Happens if task finishes 
> early
> enough
>                 //before an orientation change that the dialog is already 
> gone when
>                 //the previous activity bundles up the dialogs to reshow.
>                 if ( mShownDialog ) {
>                         dismissDialog(DIALOG_ID);
>                         Toast.makeText(this, "Finished..", 
> Toast.LENGTH_LONG).show();
>                 }
>         }
>
>         @Override
>         protected void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 setContentView(R.layout.main);
>
>                 Object retained = getLastNonConfigurationInstance();
>                 if ( retained instanceof Task ) {
>                         Log.i(LOG_TAG, "Reclaiming previous background 
> task.");
>                         mTask = (Task) retained;
>                         mTask.setActivity(this);
>                 } else {
>                         Log.i(LOG_TAG, "Creating new background task.");
>                         mTask = new Task(this);
>                         mTask.execute();
>                 }
>         }
>
>         @Override
>         public Object onRetainNonConfigurationInstance() {
>                 mTask.setActivity(null);
>                 return mTask;
>         }
>
>         @Override
>         protected Dialog onCreateDialog(int id) {
>                 switch (id) {
>                         case DIALOG_ID:
>                                 ProgressDialog dialog = new 
> ProgressDialog(this);
>                                 dialog.setMessage("Loading stuff..");
>                                 dialog.setCancelable(true);
>                                 return dialog;
>                 }
>                 return super.onCreateDialog(id);
>         }
>
>         private static class Task extends AsyncTask {
>
>                 private MyActivity activity;
>
>                 private boolean completed;
>
>                 private Task(MyActivity activity) {
>                         this.activity = activity;
>                 }
>
>                 @Override
>                 protected void onPreExecute() {
>                         activity.showDialog(DIALOG_ID);
>                 }
>
>                 @Override
>                 protected Void doInBackground(Void... unused) {
>                         try {
>                                 Log.i(LOG_TAG, "Background thread starting 
> sleep.");
>                                 Thread.sleep(15 * 1000);
>                         } catch (InterruptedException e) {
>                                 Log.e(LOG_TAG, "Thread interrupted:", e);
>                         }
>                         Log.i(LOG_TAG, "Background thread finished sleep.");
>                         return null;
>                 }
>
>                 @Override
>                 protected void onPostExecute(Void unused) {
>                         completed = true;
>                         notifyActivityTaskCompleted();
>                 }
>
>                 private void notifyActivityTaskCompleted() {
>                         if ( null != activity ) {
>                                 activity.onTaskCompleted();
>                         }
>                 }
>
>                 private void setActivity(MyActivity activity) {
>                         this.activity = activity;
>                         if ( completed ) {
>                                 notifyActivityTaskCompleted();
>                         }
>                 }
>
>         }
>
> }
>
> On Nov 10, 5:41 pm, Lee Jarvis  wrote:
>
>
>
> > I've tried that, too. But again to no avail, nothing I do seems to
> > work. I've tried using the callback features whilst also implementing
> > weak ref

答复: [android-developers] Re: hiding a forcibly o pened soft keyboard...

2009-11-11 Thread 张雷)
InputMethodManager m_inputManager = null;
//show input
m_inputManager = (InputMethodManager) 
getSystemService(Context.INPUT_METHOD_SERVICE);
m_inputManager.showSoftInput( 
this.getCurrentFocus(),InputMethodManager.SHOW_FORCED );

//hide input
private boolean hideInputMethod( )
{
boolean bHideIM = 
m_inputManager.hideSoftInputFromWindow(name.getWindowToken(), 0); //hide Input 
Method
if( false == bHideIM )
{
Log.e( TAG, "hide InputMethod is error!" ); 
}
return bHideIM;
}

-邮件原件-
发件人: sdphil [mailto:phil.pellouch...@gmail.com] 
发送时间: 2009年11月12日 10:43
收件人: Android Developers
主题: [android-developers] Re: hiding a forcibly opened soft keyboard...

What flag is that?  All I see documented are --

int HIDE_IMPLICIT_ONLY  Flag for hideSoftInputFromWindow(IBinder,
int) to indicate that the soft input window should only be hidden if
it was not explicitly shown by the user.
int HIDE_NOT_ALWAYS Flag for hideSoftInputFromWindow(IBinder, int)
to indicate that the soft input window should normally be hidden,
unless it was originally shown with SHOW_FORCED.

http://developer.android.com/intl/fr/reference/android/view/inputmethod/InputMethodManager.html

tia.

On Nov 11, 6:40 pm, Dianne Hackborn  wrote:
> You need to pass the flag to force it to be hidden.
>
>
>
> On Wed, Nov 11, 2009 at 5:09 PM, sdphil  wrote:
> > i am attempting to hide a forcibly opened soft keyboard using --
>
> >// hide the soft keyboard.
> >View view = (View) findViewById(R.id.DebugText);
> >InputMethodManager manager = (InputMethodManager)
> > getSystemService(Context.INPUT_METHOD_SERVICE);
> >IBinder binder = view.getApplicationWindowToken();
> >if (binder != null) {
> >manager.hideSoftInputFromWindow(binder, 0);
> >}
>
> > but it doesn't seem to be working - any ideas?
>
> > tia.
>
> > --
> > 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
>
> --
> 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

-- 
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: hiding a forcibly opened soft keyboard...

2009-11-11 Thread sdphil
What flag is that?  All I see documented are --

int HIDE_IMPLICIT_ONLY  Flag for hideSoftInputFromWindow(IBinder,
int) to indicate that the soft input window should only be hidden if
it was not explicitly shown by the user.
int HIDE_NOT_ALWAYS Flag for hideSoftInputFromWindow(IBinder, int)
to indicate that the soft input window should normally be hidden,
unless it was originally shown with SHOW_FORCED.

http://developer.android.com/intl/fr/reference/android/view/inputmethod/InputMethodManager.html

tia.

On Nov 11, 6:40 pm, Dianne Hackborn  wrote:
> You need to pass the flag to force it to be hidden.
>
>
>
> On Wed, Nov 11, 2009 at 5:09 PM, sdphil  wrote:
> > i am attempting to hide a forcibly opened soft keyboard using --
>
> >        // hide the soft keyboard.
> >        View view = (View) findViewById(R.id.DebugText);
> >            InputMethodManager manager = (InputMethodManager)
> > getSystemService(Context.INPUT_METHOD_SERVICE);
> >        IBinder binder = view.getApplicationWindowToken();
> >        if (binder != null) {
> >                manager.hideSoftInputFromWindow(binder, 0);
> >        }
>
> > but it doesn't seem to be working - any ideas?
>
> > tia.
>
> > --
> > 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
>
> --
> 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


Re: [android-developers] hiding a forcibly opened soft keyboard...

2009-11-11 Thread Dianne Hackborn
You need to pass the flag to force it to be hidden.

On Wed, Nov 11, 2009 at 5:09 PM, sdphil  wrote:

> i am attempting to hide a forcibly opened soft keyboard using --
>
>// hide the soft keyboard.
>View view = (View) findViewById(R.id.DebugText);
>InputMethodManager manager = (InputMethodManager)
> getSystemService(Context.INPUT_METHOD_SERVICE);
>IBinder binder = view.getApplicationWindowToken();
>if (binder != null) {
>manager.hideSoftInputFromWindow(binder, 0);
>}
>
>
> but it doesn't seem to be working - any ideas?
>
> tia.
>
> --
> 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
>



-- 
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] Server does not receive message from client

2009-11-11 Thread Mike88
Hello, I have created a simple server and client both on android phone
or emulators. The code is as follows

Server:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class AndroidServer extends Activity {
/** Called when the activity is first created. */
public static TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);

tv = new TextView(this);
tv.setText("Main - server");
setContentView(tv);

Thread sThread = new Thread(new TCPServerTest());

sThread.start();
}
}

class TCPServerTest implements Runnable{

public static final String SERVERIP = "10.0.2.15";
public static final int SERVERPORT = ;

public void run() {
 try {
  Log.d("TCP", "S: Connecting...");

  ServerSocket serverSocket = new ServerSocket
(SERVERPORT);
  while (true) {
 Socket client = serverSocket.accept();
 Log.d("TCP", "S: Receiving...");
 try {
  BufferedReader in = new BufferedReader(new
InputStreamReader(client.getInputStream()));
  String str = in.readLine();
  Log.d("TCP", "S: Received: '" + str + "'");
  AndroidServer.tv.setText(str + " -- " +
SERVERIP);
} catch(Exception e) {
Log.e("TCP", "S: Error", e);
} finally {
 client.close();
 Log.d("TCP", "S: Done.");
}

  }

 } catch (Exception e) {
   Log.e("TCP", "S: Error", e);
 }
}
}

Client:

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class AndroidClient extends Activity {
/** Called when the activity is first created. */
public TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);

tv = new TextView(this);
tv.setText("Main - client");
setContentView(tv);

Thread cThread = new Thread(new TCPClientTest());

cThread.start();
}
}

class TCPClientTest implements Runnable {


public void run() {
 try {

   InetAddress serverAddr = InetAddress.getByName("10.0.2.2");

   Log.d("TCP", "C: Connecting...");
   Socket socket = new Socket(serverAddr, );
   String message = "Hello from Client";
   try {
Log.d("TCP", "C: Sending: '" + message + "'");
PrintWriter out = new PrintWriter( new BufferedWriter
( new OutputStreamWriter(socket.getOutputStream())),true);

out.println(message);
Log.d("TCP", "C: Sent.");
  Log.d("TCP", "C: Done.");

 } catch(Exception e) {
 Log.e("TCP", "S: Error", e);
} finally {
  socket.close();
}
 } catch (Exception e) {
  Log.e("TCP", "C: Error", e);
 }
}
}


The problem can be seen from the log files

Server:

D/TCP (  700): S: Connecting...

Clinet:

D/TCP (  703): C: Connecting...
D/TCP (  703): C: Sending: 'Hello from Client'
I/global  (  703): Default buffer size used in BufferedWriter
constructor. It would be better to be explicit if an 8k-char buffer is
required.
D/TCP (  703): C: Sent.
D/TCP (  703): C: Done.


Note when i run the program the server has id 5554 and the client id
5556 from the emulators.

I have used ./adb -s 5554 forward tcp: tcp:

However the client message fails to send to the server. Does anyone
have any idea why?

I have tried doing  ./adb -s 5556 forward tcp: tcp: in case
that was the problem but i had no luck.

Help would be very much appreciated.

-- 
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 launch the browser

2009-11-11 Thread Susan
You guys are my heros! I've been trying to overcome this single issue
for about two hours. That's fantastic. It works beautifully. Thanks!

For the sake of posterity (and anybody else who might be trying to
solve this), here's my working code:

(the lines are long so I apologize for the crummy formatting)

 public class Widget extends AppWidgetProvider
 {
 public void onReceive(Context context, Intent intent)
 {
 String action = intent.getAction();
 if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals
(action))
 {

 RemoteViews views = new RemoteViews(
 
context.getPackageName(),R.layout.widget);

 Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse
("http://www.cnn.com";));
 i.addCategory(Intent.CATEGORY_BROWSABLE);
 i.setComponent(new ComponentName
("com.android.browser",
 
"com.android.browser.BrowserActivity"));
 PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, i, 0);
 views.setOnClickPendingIntent(R.id.Widget,
pendingIntent);

 AppWidgetManager.getInstance(context).updateAppWidget
  (intent.getIntArrayExtra
(AppWidgetManager.
   EXTRA_APPWIDGET_IDS),
views);
 }
 }
 }

On Nov 11, 7:33 pm, Jason Proctor 
wrote:
> you can't instantiate a Uri from a string, need to use the parse()
> factory method.
>
> this is how i do it, works for me --
>
> Intent  intent = new Intent ();
>
> intent.setAction ("android.intent.action.VIEW");
> intent.addCategory ("android.intent.category.BROWSABLE");
> intent.setData (Uri.parse ("http://www.cnn.com";));
>
> context.startActivity (intent);
>
> are you happy? :-)
>
> J
>
>
>
> >I am trying to create a widget that, when clicked on, launches the
> >browser and goes to a particular URL. Unfortunately, I have had a lot
> >of problems. I started with a (working) widget that, when clicked,
> >opened the alarm clock. Then, using the code from another Groups post
> >(http://groups.google.com/group/android-developers/msg/
> >11e54b1df3a4d279), I tried to convert it to open the browser instead.
> >Here is my (non-working) code:
>
> >public class Widget extends AppWidgetProvider
> >{
> >     public void onReceive(Context context, Intent intent)
> >     {
> >         String action = intent.getAction();
> >         if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))
> >         {
>
> >             RemoteViews views = new RemoteViews(context.getPackageName
> >(), R.layout.widget);
>
> >             Intent i = new Intent(Intent.ACTION_VIEW).addCategory
> >(Intent.CATEGORY_BROWSABLE).setComponent(new ComponentName
> >("com.android.browser", "com.android.browser.BrowserActivity"));
> >             Uri url = new Uri("http://www.cnn.com";);
> >             i.setData(url);
> >             PendingIntent pendingIntent = PendingIntent.getActivity
> >(context, 0, i, 0);
> >             views.setOnClickPendingIntent(R.id.Widget, pendingIntent);
>
> >             AppWidgetManager.getInstance(context).updateAppWidget
> >(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS),
> >views);
> >         }
> >     }
> >}
>
> >First, I get an error when I try to create the new Uri -- "Cannot
> >instantiate the type Uri." The Groups post I've been referencing uses
> >ContentURI - a class that doesn't seem to exist. There is a class
> >called ContentURIs, but I couldn't figure out a way for that to help
> >me. The section in the dev guide on intents doesn't really say what a
> >Uri is or how to create one, and if there's no constructor I'm rather
> >befuddled.
>
> >My goal is to just launch a web browser, but I inexplicably haven't
> >found a single "Hello, Web Browser!" app anywhere. I'd be happy to
> >abandon this code and start anew or to fix whatever the problem is
> >with a Uri. If anybody has any advice to offer, I'll be the happiest
> >girl in the world. Thanks!
>
> >PS - Unless it's bad advice... then I'll be sad.
>
> >(Note: This code is a modification of the excellent alarm clock widget
> >tutorial at
> >http://nexsoftware.net/wp/2009/07/29/tutorial-creating-a-custom-analo...)
>
> >--
> >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
>
> --
> jason.vp.engineering.particle

-- 
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, 

Re: [android-developers] How to launch the browser

2009-11-11 Thread Jason Proctor
you can't instantiate a Uri from a string, need to use the parse() 
factory method.

this is how i do it, works for me --

Intent  intent = new Intent ();

intent.setAction ("android.intent.action.VIEW");
intent.addCategory ("android.intent.category.BROWSABLE");
intent.setData (Uri.parse ("http://www.cnn.com";));

context.startActivity (intent);

are you happy? :-)

J


>I am trying to create a widget that, when clicked on, launches the
>browser and goes to a particular URL. Unfortunately, I have had a lot
>of problems. I started with a (working) widget that, when clicked,
>opened the alarm clock. Then, using the code from another Groups post
>(http://groups.google.com/group/android-developers/msg/
>11e54b1df3a4d279), I tried to convert it to open the browser instead.
>Here is my (non-working) code:
>
>public class Widget extends AppWidgetProvider
>{
> public void onReceive(Context context, Intent intent)
> {
> String action = intent.getAction();
> if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))
> {
>
> RemoteViews views = new RemoteViews(context.getPackageName
>(), R.layout.widget);
>
> Intent i = new Intent(Intent.ACTION_VIEW).addCategory
>(Intent.CATEGORY_BROWSABLE).setComponent(new ComponentName
>("com.android.browser", "com.android.browser.BrowserActivity"));
> Uri url = new Uri("http://www.cnn.com";);
> i.setData(url);
> PendingIntent pendingIntent = PendingIntent.getActivity
>(context, 0, i, 0);
> views.setOnClickPendingIntent(R.id.Widget, pendingIntent);
>
> AppWidgetManager.getInstance(context).updateAppWidget
>(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS),
>views);
> }
> }
>}
>
>First, I get an error when I try to create the new Uri -- "Cannot
>instantiate the type Uri." The Groups post I've been referencing uses
>ContentURI - a class that doesn't seem to exist. There is a class
>called ContentURIs, but I couldn't figure out a way for that to help
>me. The section in the dev guide on intents doesn't really say what a
>Uri is or how to create one, and if there's no constructor I'm rather
>befuddled.
>
>My goal is to just launch a web browser, but I inexplicably haven't
>found a single "Hello, Web Browser!" app anywhere. I'd be happy to
>abandon this code and start anew or to fix whatever the problem is
>with a Uri. If anybody has any advice to offer, I'll be the happiest
>girl in the world. Thanks!
>
>PS - Unless it's bad advice... then I'll be sad.
>
>(Note: This code is a modification of the excellent alarm clock widget
>tutorial at 
>http://nexsoftware.net/wp/2009/07/29/tutorial-creating-a-custom-analogclock-widget/#)
>
>--
>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


-- 
jason.vp.engineering.particle

-- 
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


Re: [android-developers] How to launch the browser

2009-11-11 Thread Mark Murphy
Susan wrote:
> I am trying to create a widget that, when clicked on, launches the
> browser and goes to a particular URL. Unfortunately, I have had a lot
> of problems. I started with a (working) widget that, when clicked,
> opened the alarm clock. Then, using the code from another Groups post
> (http://groups.google.com/group/android-developers/msg/
> 11e54b1df3a4d279), I tried to convert it to open the browser instead.
> Here is my (non-working) code:
> 
> public class Widget extends AppWidgetProvider
> {
> public void onReceive(Context context, Intent intent)
> {
> String action = intent.getAction();
> if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))
> {
> 
> RemoteViews views = new RemoteViews(context.getPackageName
> (), R.layout.widget);
> 
> Intent i = new Intent(Intent.ACTION_VIEW).addCategory
> (Intent.CATEGORY_BROWSABLE).setComponent(new ComponentName
> ("com.android.browser", "com.android.browser.BrowserActivity"));
> Uri url = new Uri("http://www.cnn.com";);
> i.setData(url);

Change the previous three lines to:

Intent i=new Intent(ACTION_VIEW, Uri.parse("http://www.cnn.com";));

> PendingIntent pendingIntent = PendingIntent.getActivity
> (context, 0, i, 0);
> views.setOnClickPendingIntent(R.id.Widget, pendingIntent);
> 
> AppWidgetManager.getInstance(context).updateAppWidget
> (intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS),
> views);
> }
> }
> }
> 
> First, I get an error when I try to create the new Uri -- "Cannot
> instantiate the type Uri." The Groups post I've been referencing uses
> ContentURI - a class that doesn't seem to exist. 

Check the date. That is probably an 18-month-old post. Uri is in the
android.net package.

> My goal is to just launch a web browser, but I inexplicably haven't
> found a single "Hello, Web Browser!" app anywhere. I'd be happy to
> abandon this code and start anew or to fix whatever the problem is
> with a Uri. If anybody has any advice to offer, I'll be the happiest
> girl in the world. Thanks!

To launch a Web browser from most places, you need:

startActivity(new Intent(ACTION_VIEW, Uri.parse("http://www.cnn.com";)));

In your case, though, you're creating an app widget, which makes things
a wee bit different:

Intent i=new Intent(ACTION_VIEW, Uri.parse("http://www.cnn.com";));
PendingIntent pendingIntent=PendingIntent.getActivity(context, 0, i, 0);
views.setOnClickPendingIntent(R.id.Widget, pi);

That will trigger the Browser when that specific UI widget in the app
widget is tapped.

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

_Android Programming Tutorials_ Version 1.0 In Print!

-- 
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


Re: [android-developers] bluetooth connection - paring required?

2009-11-11 Thread Nick Pelly
On Wed, Nov 11, 2009 at 4:55 PM, Sean Liao  wrote:

> Thanks for the quick response.  Having watching this topic for a long
> time since 1.1, I just cannot help feeling a little down now.
>

I'm sure you'll recover. We're talking about one dialog in the case of
connecting to a new device.


> Not trying to complain, I just want to make sure I did not miss
> anything feature I can utilize.  On top of my head, there was a
> discussion mentioning that using a pre-canned "" pin code on
> remote device to by pass the paring request.  That doesn't go thru on
> the current release either?
>

We only auto-pair using  when:
- the remote device looks like a headset
- the user initiated the connection request through Bluetooth Settings


>
> If someone can confirm this, that will save me some bucks just to buy
> one to try it out.
>
> Thanks in advance and really appreciate it.
>
> Best regards,
> Sean
>
>
>
> On Wed, Nov 11, 2009 at 3:34 PM, Nick Pelly  wrote:
> >
> >
> > On Wed, Nov 11, 2009 at 3:13 PM, Sean Liao 
> wrote:
> >>
> >> Do you mean that if the remote device doesn't require a pin, the android
> >> api will not be able to establish a connection to such remote devices?
> >
> > BluetoothSocket enforces pairing. You'll need to pair before the
> connection
> > can complete.
> >
> >>
> >> Do I have an option to inject the paring key pragmatically if my appl
> >> already know the pin code of the remote device?  Or, if the remote
> device
> >> doesn't require pin code, new new bluetooth api will just connect
> without
> >> user intervention?
> >
> > You'll need to pair before the connection can complete. You cannot inject
> a
> > pin code.
> >
> >>
> >> The idea is that we want to have a background service running without
> user
> >> intervention.
> >
> > Well the user only needs to pair once. If your remote device supports
> > Bluetooth 2.1 then pairing is really easy - the user just hits 'Yes'.
> >
> >>
> >> Please advise.
> >> Sean
> >> On Wed, Nov 11, 2009 at 10:02 AM, Nick Pelly  wrote:
> >>>
> >>>
> >>> On Sun, Nov 8, 2009 at 12:34 PM, Sean Liao 
> >>> wrote:
> 
>  Hi,
> 
>  Before 2.0 released, there were some questions/discussions related to
>  the Bluetooth security, i.e whether paring is required to establish
>  connection.
> 
>  Anyone know the answer or try it out already:  Is paring requirement
>  enforced in the new bluetooth api in SDK 2?  Any public info available
>  related to this topic?
> >>>
> >>> Yes pairing is required. But the OS will handle this in the background.
> >>> For example, if you use BluetoothSocket and BluetoothServerSocket and
> try
> >>> to make an unpaired connection, the OS will provide notifications to
> the
> >>> user that pairing is required. Once they are paired the connection will
> >>> complete. You application does not need to handle pairing.
> >>>
> 
>  Thanks in advance.
>  Sean
> 
>  --
>  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
> >>>
> >>> --
> >>> 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
> >>
> >> --
> >> 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
> >
> > --
> > 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
>
> --
> 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
>

-- 
You

[android-developers] How to launch the browser

2009-11-11 Thread Susan
I am trying to create a widget that, when clicked on, launches the
browser and goes to a particular URL. Unfortunately, I have had a lot
of problems. I started with a (working) widget that, when clicked,
opened the alarm clock. Then, using the code from another Groups post
(http://groups.google.com/group/android-developers/msg/
11e54b1df3a4d279), I tried to convert it to open the browser instead.
Here is my (non-working) code:

public class Widget extends AppWidgetProvider
{
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))
{

RemoteViews views = new RemoteViews(context.getPackageName
(), R.layout.widget);

Intent i = new Intent(Intent.ACTION_VIEW).addCategory
(Intent.CATEGORY_BROWSABLE).setComponent(new ComponentName
("com.android.browser", "com.android.browser.BrowserActivity"));
Uri url = new Uri("http://www.cnn.com";);
i.setData(url);
PendingIntent pendingIntent = PendingIntent.getActivity
(context, 0, i, 0);
views.setOnClickPendingIntent(R.id.Widget, pendingIntent);

AppWidgetManager.getInstance(context).updateAppWidget
(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS),
views);
}
}
}

First, I get an error when I try to create the new Uri -- "Cannot
instantiate the type Uri." The Groups post I've been referencing uses
ContentURI - a class that doesn't seem to exist. There is a class
called ContentURIs, but I couldn't figure out a way for that to help
me. The section in the dev guide on intents doesn't really say what a
Uri is or how to create one, and if there's no constructor I'm rather
befuddled.

My goal is to just launch a web browser, but I inexplicably haven't
found a single "Hello, Web Browser!" app anywhere. I'd be happy to
abandon this code and start anew or to fix whatever the problem is
with a Uri. If anybody has any advice to offer, I'll be the happiest
girl in the world. Thanks!

PS - Unless it's bad advice... then I'll be sad.

(Note: This code is a modification of the excellent alarm clock widget
tutorial at 
http://nexsoftware.net/wp/2009/07/29/tutorial-creating-a-custom-analogclock-widget/#)

-- 
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


Re: [android-developers] hiding a forcibly opened soft keyboard...

2009-11-11 Thread Jason Proctor
this mechanism works for me, however i'm doing it from onClick() on 
my "login" button and using the button's view to get the window 
token. i'm no expert on tokens and there may be some subtlety 
involved between buttons & text views.





>i am attempting to hide a forcibly opened soft keyboard using --
>
> // hide the soft keyboard.
> View view = (View) findViewById(R.id.DebugText);
>   InputMethodManager manager = (InputMethodManager)
>getSystemService(Context.INPUT_METHOD_SERVICE);
> IBinder binder = view.getApplicationWindowToken();
> if (binder != null) {
>   manager.hideSoftInputFromWindow(binder, 0);
> }
>
>
>but it doesn't seem to be working - any ideas?
>
>tia.
>
>--
>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


-- 
jason.vp.engineering.particle

-- 
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] hiding a forcibly opened soft keyboard...

2009-11-11 Thread sdphil
i am attempting to hide a forcibly opened soft keyboard using --

// hide the soft keyboard.
View view = (View) findViewById(R.id.DebugText);
InputMethodManager manager = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
IBinder binder = view.getApplicationWindowToken();
if (binder != null) {
manager.hideSoftInputFromWindow(binder, 0);
}


but it doesn't seem to be working - any ideas?

tia.

-- 
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


Re: [android-developers] bluetooth connection - paring required?

2009-11-11 Thread Sean Liao
Thanks for the quick response.  Having watching this topic for a long
time since 1.1, I just cannot help feeling a little down now.

Not trying to complain, I just want to make sure I did not miss
anything feature I can utilize.  On top of my head, there was a
discussion mentioning that using a pre-canned "" pin code on
remote device to by pass the paring request.  That doesn't go thru on
the current release either?

If someone can confirm this, that will save me some bucks just to buy
one to try it out.

Thanks in advance and really appreciate it.

Best regards,
Sean



On Wed, Nov 11, 2009 at 3:34 PM, Nick Pelly  wrote:
>
>
> On Wed, Nov 11, 2009 at 3:13 PM, Sean Liao  wrote:
>>
>> Do you mean that if the remote device doesn't require a pin, the android
>> api will not be able to establish a connection to such remote devices?
>
> BluetoothSocket enforces pairing. You'll need to pair before the connection
> can complete.
>
>>
>> Do I have an option to inject the paring key pragmatically if my appl
>> already know the pin code of the remote device?  Or, if the remote device
>> doesn't require pin code, new new bluetooth api will just connect without
>> user intervention?
>
> You'll need to pair before the connection can complete. You cannot inject a
> pin code.
>
>>
>> The idea is that we want to have a background service running without user
>> intervention.
>
> Well the user only needs to pair once. If your remote device supports
> Bluetooth 2.1 then pairing is really easy - the user just hits 'Yes'.
>
>>
>> Please advise.
>> Sean
>> On Wed, Nov 11, 2009 at 10:02 AM, Nick Pelly  wrote:
>>>
>>>
>>> On Sun, Nov 8, 2009 at 12:34 PM, Sean Liao 
>>> wrote:

 Hi,

 Before 2.0 released, there were some questions/discussions related to
 the Bluetooth security, i.e whether paring is required to establish
 connection.

 Anyone know the answer or try it out already:  Is paring requirement
 enforced in the new bluetooth api in SDK 2?  Any public info available
 related to this topic?
>>>
>>> Yes pairing is required. But the OS will handle this in the background.
>>> For example, if you use BluetoothSocket and BluetoothServerSocket and try
>>> to make an unpaired connection, the OS will provide notifications to the
>>> user that pairing is required. Once they are paired the connection will
>>> complete. You application does not need to handle pairing.
>>>

 Thanks in advance.
 Sean

 --
 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
>>>
>>> --
>>> 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
>>
>> --
>> 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
>
> --
> 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

-- 
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 can I pull photo from a G1 via 'adb shell'?

2009-11-11 Thread Jason Proctor
and to see a list of files

adb ls /sdcard/dcim/camera

then pull them by full pathname

>Use 'adb pull' instead.
>
>- dave
>
>On Nov 11, 3:08 pm, hap 497  wrote:
>>  Hi,
>>
>>  I took some photos with my G1. How can I pull all the photos from a G1
>>  via 'adb shell'?
>>
>>  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


-- 
jason.vp.engineering.particle

-- 
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] intercept SMS inbound message

2009-11-11 Thread Sean Liao
Hi,
I got a sample code how to intercept SMS inbound message.  It is
really simple, and I really admire android make it so easy:

// declare the intercepter







public class SmsReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
   {
}
}

However, there is a problem.  The message also shows in the system
inbox.  Is there a way really to intercept it (not let the system
receive it)?  Or is there any API I can remove it from system inbox as
soon as I read it from my program?

Thanks in advance.
Sean

-- 
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 can I pull photo from a G1 via 'adb shell'?

2009-11-11 Thread davemac
Use 'adb pull' instead.

- dave

On Nov 11, 3:08 pm, hap 497  wrote:
> Hi,
>
> I took some photos with my G1. How can I pull all the photos from a G1
> via 'adb shell'?
>
> 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: Can someone with a Motorola Droid call AccountManager.getAccounts() please?

2009-11-11 Thread Micah
To reply to your more specific questions, it is my understanding that
the type you see in your log output is the type you would pass in to
most of the AccountManager functions.  The type should be a java style
universally unique name (ie: domain.subdomain.accounttype) in the form
of a string.  So if you wanted to get a Google Auth Token you would
call getAuthToken and pass in "com.google", for facebook you would
pass in "com.facebook.auth.login".

I am working on building my own account authenticator now and it's
quite a bit more work than actually getting the auth token.  Basically
anywhere on your Droid that you see Google, Facebook and Exchange you
could add your own account type, as well as allow applications by
other developers to authenticate with your service.

Here is the flow as I understand it, along with links to documentation
for each part:
http://docs.google.com/View?id=dhhtdbc7_4hhh4whg8

Basically once you have an authenticator written and installed on the
user's phone then the user would first need to create an account with
the authenticator.

One authenticator may track credentials for multiple users.  ex: I may
sign-in to the phone with two Google Accounts, then any app that needs
an auth token for "com.google" would need to prompt the user with both
accounts and ask them which one they would like to use.

Once there is one or more accounts setup with the authenticator you
would then ask the authenticator for an auth token for the desired
account.  The authenticator then may (or may not) prompt the user for
additional credentials or it may pass an intent back to the calling
application (depending on which version of getAuthToken you call) and
leave it up to the calling application to send off the credential
request intent (ex: if you are authenticating in the background it may
be better to wait for the user to switch back to your app before
prompting them, or pop-up a notification).

Once authentication is complete the calling application will get a
callback letting it know the results (auth token or failure).  The
calling application can then use that auth token to access services
provided by "com.google" (or whoever you authenticated with), likely
over an SSL connection, so the auth token isn't stolen.

On Nov 9, 5:00 pm, Nerdrow  wrote:
> I just tried this real quick on my Droid:
>
> AccountManager mgr = AccountManager.get(this);
> Account[] accts = mgr.getAccounts();
> final int count = accts.length;
> Account acct = null;
>
> for(int i=0;i   acct = accts[i];
>   Log.d("ACCT", "eclair account - name="+acct.name+",
> type="+acct.type);
>
> }
>
> These are the results (masked :))
>
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@gmail.com, type=com.google
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@.com, type=com.facebook.auth.login
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@.com, type=com.android.exchange
>
> Do you understand how to actually use the returned Account objects?
> It looks like you have to use an AccountManager instance and call the
> getAuthToken method, but this keeps failing for me since I don't know
> the authTokenType to pass as an input parameter.  The Account object
> itself has no other useful fields as far as I can tell.
>
> Related is the AbstractAccountAuthenticator, where you're supposed to
> be able to add authenticator types to appear on the phone (by default
> on the Droid you get 3, Google, Facebook, and Exchange).  Judging by
> the documentation this would allow you to integrate your app into the
> "quick contact bar" or whatever it's called, as well as use the
> ContactsContract api to facilitate contact syncing, but there's no
> examples around any of this stuff, just the documentation.  I found
> this thread about the ContactsContract, but it doesn't help if I can't
> add my authenticator 
> first:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> Anyone have any ideas?
>
> On Nov 8, 9:21 pm, Micah  wrote:
>
>
>
> > In Android 2.0 there is a new android.accounts.AccountManagerclass
> > has a function getAccounts()
> > see:http://developer.android.com/reference/android/accounts/AccountManage...()
>
> > Unfortunately, as most of you know the SDK doesn't come with any of
> > the Google Apps that utilize the Google Account associated with the
> > phone (Gmail, Google Talk, Calendar, etc.).  This means that when you
> > call getAccounts in an emulator it returns an empty array.
>
> > The *hope* is that Google has modified the Google apps shipped with
> > Android 2.0 to use theAccountManagerAPI instead of whatever internal
> > and super-secret-closed system they were using before.  If this is the
> > case, then 3rd party apps can hopefully gain access to a Google Auth
> > token via theAccountManagerinstead of having to ask the user for
> > their username / password.
>
> > Unfortunately, the only phone that has android 2.0 on it to my
> > knowledge is the Motorola Droid.  So

[android-developers] Re: Can someone with a Motorola Droid call AccountManager.getAccounts() please?

2009-11-11 Thread Micah
Using an already existing account is pretty easy, which means in the
case of Droid Facebook, Google and Exchange.  Writing the actual
account providers is the hard part.

I'm just coding this off the top of my head, since I haven't finished
writing an authenticator yet (and the SDK has no built-in accounts)
but something along the lines of this:

/**
NOTE: This code blocks and is the wrong way to write this if 
you are
doing it in the main thread.  In the main thread you should pass in a
callback and wait for notification of success.  For simplicity of
posting the code to this group though I have written it this way.
**/

AccountManager myAccountManager = AccountManager.get(this);
Account foundGoogleAccount;
// TODO: Do what you did to find a Google account.

AccountManagerFuture myAccountManagerFuture;
// TODO: I *think* that the Activity that getAuthToken is 
asking for
is the activity to launch the intent from, not the actual activity
that the intent will launch.  This means that the intent which leads
to a credential prompt from the user will appear on top of the passed
in Activity in the Activity stack.  However, this is not clear in the
documentation so needs testing.
// TODO: Figure out if "com.google" account type needs any
additional login options passed in.  In this call I don't pass in any
login options but every authenticator has the option of requiring
some.  I assume this would be something like an RSA one-time-password
that can't be stored, though the authenticator could also get that via
a credential prompt instead of as a login option.  It may also be used
if a user can authenticate an account with some set of optional
parameters, such as authenticate for viewing only.
myAccountManagerFuture = myAccountManager.getAuthToken
(foundGoogleAccount, "com.google", null, this, null, null);

// THE FOLLOWING CALL BLOCKS WHILE AUTHENTICATION IS DONE!  
Normally
you would wait for a callback with the result, but for simplicity we
do this instead.
Bundle myAuthTokenBundle;
try
{
myAuthTokenBundle = myAccountManagerFuture.getResult();
}
catch (OperationCanceledException e)
{
e.printStackTrace();
return;
}
catch (AuthenticatorException e)
{
e.printStackTrace();
return;
}
catch (IOException e)
{
e.printStackTrace();
return;
}

if 
(myAuthTokenBundle.getString(AccountManager.KEY_ACCOUNT_TYPE) !=
"com.google")
{
// TODO: Handle auth failure case.
return;
}

String myAccountName = myAuthTokenBundle.getString
(AccountManager.KEY_ACCOUNT_NAME);
String myAccountType = myAuthTokenBundle.getString
(AccountManager.KEY_ACCOUNT_TYPE);
// TODO: Figure out the type of auth token.  Is it always a 
String
or something?  Does it depend on the Authenticator?
Object myGoogleAuthToken = myAuthTokenBundle.get
(AccountManager.KEY_AUTHTOKEN);


On Nov 9, 5:00 pm, Nerdrow  wrote:
> I just tried this real quick on my Droid:
>
> AccountManager mgr = AccountManager.get(this);
> Account[] accts = mgr.getAccounts();
> final int count = accts.length;
> Account acct = null;
>
> for(int i=0;i   acct = accts[i];
>   Log.d("ACCT", "eclair account - name="+acct.name+",
> type="+acct.type);
>
> }
>
> These are the results (masked :))
>
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@gmail.com, type=com.google
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@.com, type=com.facebook.auth.login
> 11-09 16:13:09.143: DEBUG/ACCT(2495): eclair account -
> name=@.com, type=com.android.exchange
>
> Do you understand how to actually use the returned Account objects?
> It looks like you have to use an AccountManager instance and call the
> getAuthToken method, but this keeps failing for me since I don't know
> the authTokenType to pass as an input parameter.  The Account object
> itself has no other useful fields as far as I can tell.
>
> Related is the AbstractAccountAuthenticator, where you're supposed to
> be able to add authenticator types to appear on the phone (by default
> on the Droid you get 3, Google, Facebook, and Exchange).  Judging by
> the documentation this would allow you to integrate your app into the
> "quick contact bar" or whatever it's called, as well as use the
> ContactsContract api to facilitate contact syncing, but there's no
> examples around any of this stuff, just the documentation.  I foun

Re: [android-developers] bluetooth connection - paring required?

2009-11-11 Thread Nick Pelly
On Wed, Nov 11, 2009 at 3:13 PM, Sean Liao  wrote:

> Do you mean that if the remote device doesn't require a pin, the android
> api will not be able to establish a connection to such remote devices?
>

BluetoothSocket enforces pairing. You'll need to pair before the connection
can complete.


>
> Do I have an option to inject the paring key pragmatically if my appl
> already know the pin code of the remote device?  Or, if the remote device
> doesn't require pin code, new new bluetooth api will just connect without
> user intervention?
>

You'll need to pair before the connection can complete. You cannot inject a
pin code.


>
> The idea is that we want to have a background service running without user
> intervention.
>

Well the user only needs to pair once. If your remote device supports
Bluetooth 2.1 then pairing is really easy - the user just hits 'Yes'.


>
> Please advise.
> Sean
>
> On Wed, Nov 11, 2009 at 10:02 AM, Nick Pelly  wrote:
>
>>
>>
>> On Sun, Nov 8, 2009 at 12:34 PM, Sean Liao wrote:
>>
>>> Hi,
>>>
>>> Before 2.0 released, there were some questions/discussions related to the
>>> Bluetooth security, i.e whether paring is required to establish connection.
>>>
>>> Anyone know the answer or try it out already:  Is paring requirement
>>> enforced in the new bluetooth api in SDK 2?  Any public info available
>>> related to this topic?
>>>
>>
>> Yes pairing is required. But the OS will handle this in the background.
>>
>> For example, if you use BluetoothSocket and BluetoothServerSocket and try
>> to make an unpaired connection, the OS will provide notifications to the
>> user that pairing is required. Once they are paired the connection will
>> complete. You application does not need to handle pairing.
>>
>>
>>>
>>> Thanks in advance.
>>> Sean
>>>
>>>  --
>>> 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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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

Re: [android-developers] bluetooth connection - paring required?

2009-11-11 Thread Sean Liao
Do you mean that if the remote device doesn't require a pin, the android api
will not be able to establish a connection to such remote devices?

Do I have an option to inject the paring key pragmatically if my appl
already know the pin code of the remote device?  Or, if the remote device
doesn't require pin code, new new bluetooth api will just connect without
user intervention?

The idea is that we want to have a background service running without user
intervention.

Please advise.
Sean

On Wed, Nov 11, 2009 at 10:02 AM, Nick Pelly  wrote:

>
>
> On Sun, Nov 8, 2009 at 12:34 PM, Sean Liao  wrote:
>
>> Hi,
>>
>> Before 2.0 released, there were some questions/discussions related to the
>> Bluetooth security, i.e whether paring is required to establish connection.
>>
>> Anyone know the answer or try it out already:  Is paring requirement
>> enforced in the new bluetooth api in SDK 2?  Any public info available
>> related to this topic?
>>
>
> Yes pairing is required. But the OS will handle this in the background.
>
> For example, if you use BluetoothSocket and BluetoothServerSocket and try
> to make an unpaired connection, the OS will provide notifications to the
> user that pairing is required. Once they are paired the connection will
> complete. You application does not need to handle pairing.
>
>
>>
>> Thanks in advance.
>> Sean
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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] LG Eve emulator skin now available for Android 2.0 SDK

2009-11-11 Thread Tea Vui Huang
LG Eve emulator skin now available for Android 2.0 SDK
http://teavuihuang.com/android

The LG Eve (LG-GW620) is LG's 1st Android based smartphone and was
officially launched in Canada on November 3rd with Rogers Wireless.
This emulator skin brings the LG Eve to your Android 2.0 SDK in the
original HVGA resolution (320x480, medium density, normal screen). The
emulator skin package, screenshots and installation instructions are
now available at the above website.

Tea Vui Huang's Android Page
[The No.1 website for Google Android Emulator Skins]

-- 
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 remove sms notifications in status bar

2009-11-11 Thread Muhammad Bilal
well  in Cancel you need to specify the id of the alert , but as i
haven't created that alert as it was generated by android framework
itself on the receiving the new sms, i did delete that sms from sms
database and when u open messages you wont see it there but status bar
still shows new sms message and when user clicks on it there wont be
any thread cuz i have already delete that thread from database , could
some person of greater knowledge can help me over here , thnaks

On Nov 11, 2:00 pm, neil  wrote:
> Hi Bilal,
>     You can use the NotificationManager cancel method.
>
> On Nov 11, 6:17 am, Muhammad Bilal  wrote:
>
>
>
> > hi,
>
> > its been a while since i am doing development on android sdk , one of
> > the astonishing i come across that there is np support in the API to
> >removeany notification in thestatusbar, i am working on an
> > application which looks for everySMScoming and on some specificsms
> > deletes them from the inbox till now its working fine , but the
> > notificationbarstill showing that u got a new message despite the
> > fact that u have deleted it formsmsdatabase , couls somebody suggest
> > some solution how i can accomplish this , thanks
>
> > regards
> > MB

-- 
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: Problem with listening to a PhoneStateListener in a service

2009-11-11 Thread GT
Oh, fail... I totally forgot to read that... Thank you!

/im an idiot xD

On Nov 11, 3:56 pm, Mark Murphy  wrote:
> GT wrote:
> > I have a BroadcastReceiver that listens for the BOOT_COMPLETED, that
> > part works I know because I disabled my phone listener and displayed a
> > Toast within. That BroadcastReceiver is supposed to start a service,
> > that also works. I run into Force Close issues when my service
> > attempts to tell my TelephonyManager to listen.
>
> > Any one have any ideas?
>
> If you get a "Force Close", look at the Java stack trace to tell you
> where your code is failing. You can get at the stack trace via adb
> logcat, DDMS, or the DDMS perspective in Eclipse.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 2.8
> Available!

-- 
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


Re: [android-developers] Problem with listening to a PhoneStateListener in a service

2009-11-11 Thread Mark Murphy
GT wrote:
> I have a BroadcastReceiver that listens for the BOOT_COMPLETED, that
> part works I know because I disabled my phone listener and displayed a
> Toast within. That BroadcastReceiver is supposed to start a service,
> that also works. I run into Force Close issues when my service
> attempts to tell my TelephonyManager to listen.
> 
> Any one have any ideas?

If you get a "Force Close", look at the Java stack trace to tell you
where your code is failing. You can get at the stack trace via adb
logcat, DDMS, or the DDMS perspective in Eclipse.

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

_The Busy Coder's Guide to Android Development_ Version 2.8
Available!

-- 
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: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
Ahh yeah that makes total sense now. Can't believe I didn't notice
that

Thanks again

On Nov 11, 10:16 pm, Mark Murphy  wrote:
> Lee Jarvis wrote:
> > Yeah, my bad..
>
> 
>
> > 11-11 21:47:02.280: ERROR/AndroidRuntime(797): Caused by:
> > java.lang.RuntimeException: Can't create handler inside thread that
> > has not called Looper.prepare()
>
> General rule: always look for the "Caused by:" entry in the stack trace.
>
> Your problem isn't the exception, but what you are doing in the
> exception handler. Whatever mActivity.onTaskError(e.getMessage()); may
> be trying to modify the UI, and that's a no-no from a background thread.
> Whatever you're doing, it's not strictly kosher.
>
> What I have done is held onto the Exception object in the AsyncTask
> instance, then used it in onPostExecute(), when it is safe to update the UI.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 1.0 Available!

-- 
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] Problem with listening to a PhoneStateListener in a service

2009-11-11 Thread GT
I have a BroadcastReceiver that listens for the BOOT_COMPLETED, that
part works I know because I disabled my phone listener and displayed a
Toast within. That BroadcastReceiver is supposed to start a service,
that also works. I run into Force Close issues when my service
attempts to tell my TelephonyManager to listen.

Any one have any ideas? Here is my code

StartSeviceAtStartUp.java


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;


public class StartSeviceAtStartUp extends BroadcastReceiver
{
public void onReceive(Context context, Intent intent)
{
  Intent serviceIntent = new Intent(context, listenService.class);
  context.startService(serviceIntent);
}
}

listenService.java

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;

public class listenService extends Service
{

  @Override
  public void onCreate()
  {
super.onCreate();
TelephonyManager telMgr = (TelephonyManager) getSystemService
(Context.TELEPHONY_SERVICE);
telMgr.listen(new CallStateListener(),
PhoneStateListener.LISTEN_CALL_STATE);
  }
  @Override
  public void onStart(Intent i, int startid)
  {

  }

  @Override
  public IBinder onBind(Intent arg0)
  {
// TODO Auto-generated method stub
return null;
  }
}

CallStateListener.java

package com.guysandroidstuff.fcallerid;

import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;

public class CallStateListener extends PhoneStateListener
{
  public void onCallStateChanged(int state, String incomingNumber)
  {
super.onCallStateChanged(state, incomingNumber);
switch(state)
{
  case TelephonyManager.CALL_STATE_IDLE:
  Log.v("DEBUG", "IDLE YO");
  break;
  case TelephonyManager.CALL_STATE_OFFHOOK:
  Log.v("DEBUG", "OFF HOOK");
  break;
  case TelephonyManager.CALL_STATE_RINGING:
  Log.v("DEBUG", "RINGING YO");
  break;
}
  }
}

-- 
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


Re: [android-developers] Re: Dallas Android Developers

2009-11-11 Thread Aniruddh Bajirao
 14th or 21st both are good for me.
How about the others?

On Wed, Nov 11, 2009 at 1:24 PM, Chris Dempsey  wrote:

> How about the 14th or 21st?  I'm in the Plano area but I own a car so
> traveling isn't a problem. :)
>
> On Wed, Nov 11, 2009 at 10:49 AM, Aniruddh Bajirao wrote:
>
>> As PJ suggested 'Dallas Droid Devs'...
>> Lets plan an informal meet and get started... Any suggestions on when n
>> where we can have a meet...
>>
>>
>> On Wed, Nov 11, 2009 at 7:03 AM, Chris Dempsey  wrote:
>>
>>> I am interested in a Dallas Droid developer group.  I think PJ has the
>>> right idea.  Start informal and see where it goes.
>>>
>>>
>>> On Wed, Nov 11, 2009 at 1:22 AM, PJ  wrote:
>>>
 "Dallas Droid Devs".  It's catchy.  Quick, someone reserve the domain!

 I think the biggest barrier to forming a local Android Dev group is
 the fact that developers can hang out in the IRC channel (and this
 Google group) and find lots of discussion there, from the comfort (and
 whim/speed) of their own homes.  So, some people might not feel the
 extra effort is worth it.

 So an important step to creating a successful Dallas Android Dev group
 is to brainstorm and come up with a convincing list of incentives to
 create/join a local group.  Developers will ask, "What can the Dallas
 group offer me that the worldwide community can't?"

 The answer is stuff like:
 * Job placement: When Dallas devs get together, they can share info
 about local opportunities
 * Discuss local interests (like... uh... Dallas Cowboys?
 Whataburger?  hahaha...)
 * Get out of the house and meet in person
 * etc.

 I'm personally not gifted at organizing social events, but I'd
 strongly consider joining/supporting.




 On Nov 10, 9:54 pm, Aniruddh Bajirao  wrote:
 > Anyone interested in having a Dallas Android Group?
 >
 >
 >
 >
 >
 > On Fri, Nov 6, 2009 at 9:42 PM, Aniruddh Bajirao 
 wrote:
 > > If we have enough people interested lets create a Dallas Android
 Dev-group.
 >
 > > We can have planned meets. Will definitely be interesting and useful
 to
 > > share knowledge and experience as well as to get answers to
 questions. Above
 > > all it would be very interesting to meet and network with other
 Android
 > > Enthusiasts.
 >
 > > On Fri, Nov 6, 2009 at 8:51 PM, cpick  wrote:
 >
 > >> You might check the Texas Startup Blog. Alex Muse has a happy hour
 > >> down at the info mart first monday of the month. Usually some
 android
 > >> guys there (although it is more entrepreneur related). They also
 > >> sometimes have the mobile monday meeting in their office space..
 But I
 > >> would not mind getting a bit involved in a Android Dev group. There
 is
 > >> a North Texas PC Users group somewhere (My father is a part of it).
 > >> They meet on a weekend, and have break out groups I think for
 > >> different technologies.. Maybe get  a subgroup started there?
 >
 > >> --
 > >> 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>>> cr...@googlegroups.com>
 > >> For more options, visit this group at
 > >>http://groups.google.com/group/android-developers?hl=en
 >
 > > --
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 > > Great spirits have always found violent opposition from
 mediocrities. The
 > > latter cannot understand it when a man does not thoughtlessly submit
 to
 > > hereditary prejudices but honestly and courageously uses his
 intelligence.
 > > ... Albert Einstein.
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 >
 > > Aniruddh Bajirao
 > >www.ryze.com/Aniruddh
 >
 > --
 > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- --
 > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 > Great spirits have always found violent opposition from mediocrities.
 The
 > latter cannot understand it when a man does not thoughtlessly submit
 to
 > hereditary prejudices but honestly and courageously uses his
 intelligence.
 > ... Albert Einstein.
 > -- -- -- --

[android-developers] Re: How to build apk from multiple Eclipse projects?

2009-11-11 Thread WoodManEXP
Here is how I have solved this riddle; it is a compromise.

It seems pretty much impossible to implement any sort of class/
inheritance structure around the way resources are implemented for the
Android resources via Eclipse. They are tied too tightly with R. and
the special apk builder.

So I've spilt on the boundary between what classes access resources
and what classes do not (the UI classes tend to be the resource
users). Some classes that were light users of resources can be
restructured a bit to have resource info parameterized to them thereby
gaining them a home in reusable .jars.

The stuff that does not use resources can be organized into other
Eclipse Java projects with JRE System library and android.jar on the
Libraries build path.

The classes that implement the UI for a specific app are housed in a
regular Eclipse Android project with a Manifest and menus and such….
It has the Projects and Libraries of the reusable classes on its build
paths.

I had really wanted to push reuse further into the UI but it is a
diminishing returns thing where copy+paste looks more attractive.

Maybe someday Google will share with us an improved way to package
Android resources within jar files.





On Nov 11, 7:29 am, WoodManEXP  wrote:
> Does anyone know of suggestions/recommendations on how to structure
> Eclipse projects in order to build an apk from multiple projects? I
> would like to share classes & resources (strings, layouts, etc…)
> across multiple apps.
>
> Any pointers on how to structure Eclipse projects to do such a thing
> is appreciated!

-- 
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] Application design - using threads

2009-11-11 Thread Neilz
Hi all. I've been reading the developer guide, the sections on
designing for performance and responsiveness. It's great stuff, and
I'm going to go through all my code and refactor everything I can to
meet these suggestions.

One line stood out for me: "For games specifically, do calculations
for moves in a child thread."

Could someone possibly elaborate on this a little? If you had a game
where the screen was being refreshed continuously, with calculations
being made on every refresh, does this mean starting and ending a
thread every time this happens? Or is one thread created at the start,
which stays open for the duration of the game?

And would this be an inner class extending Thread with a run() method
as usual, or are there better ways of handling it? I recently used an
"AsyncTask" to handle a background task, would that be something that
could be of use here?

Many thanks for any help.

-- 
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


Re: [android-developers] Re: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Mark Murphy
Lee Jarvis wrote:
> Yeah, my bad..



> 11-11 21:47:02.280: ERROR/AndroidRuntime(797): Caused by:
> java.lang.RuntimeException: Can't create handler inside thread that
> has not called Looper.prepare()

General rule: always look for the "Caused by:" entry in the stack trace.

Your problem isn't the exception, but what you are doing in the
exception handler. Whatever mActivity.onTaskError(e.getMessage()); may
be trying to modify the UI, and that's a no-no from a background thread.
Whatever you're doing, it's not strictly kosher.

What I have done is held onto the Exception object in the AsyncTask
instance, then used it in onPostExecute(), when it is safe to update the UI.

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

_Android Programming Tutorials_ Version 1.0 Available!

-- 
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] Title bar keeps popping up on AlertDialog presentations despite disabling it in the activity

2009-11-11 Thread Stephen Abrams
Hello all,

I've noticed that if I disable the title bar in my Activity's onCreate
method like so:

   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
   WindowManager.LayoutParams.FLAG_FULLSCREEN);

any AlertDialogs with list that require a scroll down (contents don't
fit the page) will cause the title bar to display momentarily.  I am
managing these dialogs in the Activity in the typical fashion (using
onCreateDialog() and onPrepareDialog()).

Seems to happen in 1.5, 1.6, and 2.0

Is there a way to fix this?

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] title bar keeps popping up despite disabling it in the activity

2009-11-11 Thread Stephen Abrams
Hello all,

I've noticed that if I disable the title bar in my Activity's onCreate
method like so:

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

any AlertDialogs with list that require a scroll down (contents don't
fit the page) will cause the title bar to display momentarily.  I am
managing these dialogs in the Activity in the typical fashion (using
onCreateDialog() and onPrepareDialog()).

Seems to happen in 1.5, 1.6, and 2.0

Is there a way to fix this?

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: Recording direct system audio??

2009-11-11 Thread niko20
Ok one last post.

In AudioRecord, the offset and size are the offset in YOUR buffer.

So this isnt that hard. You can use the same values hardcoded if you
want. All you have to do is make sure you are done enough with your
buffer before reading again. So you set AudioRecord's buffer to bigger
than your own read buffer, then you start an AudioRecorder, then you
read a small chunk (YOUR buffer). Now you use that chunk to do
something. Then you can read the next chunk. You can use the same
offset and size, it will just overwrite the current data in YOUR
buffer. Then you use the buffer quick. The only time you will get
overflow is if you don't read the data fast enough to keep the
AudioRecorder from "looping" around on its own internal buffer (which
you told it to allocate), so a bigger buffer would be better here if
you don't know if you may have some slow downs here and there.
However, even a big buffer won't help if you dont use the data fast
enough because eventually Audiorecord will catch up to you if you
aren't quick enough - so still you cant be doing tons of processing on
the data because you need to read it and get out! So the recorder can
keep going.

This is the same way that Audiotrack works on output, you have to
write faster than it consumes (or at least AS fast - you can do that
no problem because write() blocks until data is needed, so technically
your audio write thread should be sitting waiting to write most of the
time, if not, you are going to get more audio gapping).

Hope that helps.

-niko

On Nov 11, 3:51 pm, niko20  wrote:
> In fact what I meant to say as well is in Audiotrack's case, you want
> a seperate thread that keeps pushing out new data. The write() method
> will block until new data is needed, which is fine. So as long as your
> thread can write the data fast enough to keep the buffer full you are
> golden.
>
> Now as far as AudioRecord I haven't used it much just yet (but soon
> will). I'm assuming it's similar only the "reverse".
>
> By the way PJ, I do use a looped output buffer in my AudioTrack output
> and I handle it myself.
>
> -niko
>
> On Nov 11, 3:48 pm, niko20  wrote:
>
>
>
> > I've worked with the audio a lot (especially AudioTrack) and I believe
> > you have everything correct PJ.
>
> > Yesterday I had put together a test app to try playback/record at the
> > same time and it worked just fine.
>
> > You shouldn't get buffer overflow errors if you make a large buffer
> > and then read from it as small chunks more quickly. That way you
> > consume the buffer fast enough so it never gets full.
>
> > It's the same way on AudioTrack for output, you make a buffer large
> > enough, and then you write in small chunks fast enough to keep it
> > full. However, in AudioTrack's case, you WILL get a delay the first
> > time. I've found that AudioTrack won't play until the buffer is full
> > for the first time. But I suspect that is how Audio buffers work on
> > any platform.
>
> > -niko
>
> > On Nov 11, 3:09 pm, PJ  wrote:
>
> > > If you are worried about delay, you could probably use a small data
> > > chunk size and a large buffer size.
>
> > > (In my examples, I always used zero for the offset, but you could have
> > > a large buffer and process the data in small chunks.  You would
> > > process the chunk at offset=0 first, then process the chunk with
> > > offset = "chunk size", then "chunk size times 2", etc.  Eventually you
> > > have to wrap around back to the beginning of the buffer.  I have no
> > > idea if the API methods handle any of that for you automatically or
> > > not.)
>
> > > Anyway, that's makes sense in my head, but I don't have that much
> > > experience with high-performant audio processing.  Maybe some experts
> > > can correct me and/or elaborate on what the proper solution is.
>
> > > -- PJ
>
> > > On Nov 10, 11:23 pm, Bytes  wrote:
>
> > > > Hi,
>
> > > > Thanks for your mails.
>
> > > > I pressume you did in Java.
>
> > > > Ofcourse, we can do the same thing in C++ also.
>
> > > > But the problem is...
>
> > > > "Buffer Overflow ".
>
> > > > By simply increasing the buffer size won't solve the whole issue.
>
> > > > It may apparently solve buffer overflow, but it will add delay in
> > > > playing
>
> > > > By the way do you know any good documentation about Android Audio
> > > > internals.
>
> > > > I'm also waiting for Android OS/Audio Expert feedback about this
> > > > implementation.
>
> > > > Sometimeback, I've posted my audio experiences on another thread
>
> > > >http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> > > > Hopefully this time I can have success.

-- 
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-de

[android-developers] Re: Recording direct system audio??

2009-11-11 Thread niko20
In fact what I meant to say as well is in Audiotrack's case, you want
a seperate thread that keeps pushing out new data. The write() method
will block until new data is needed, which is fine. So as long as your
thread can write the data fast enough to keep the buffer full you are
golden.

Now as far as AudioRecord I haven't used it much just yet (but soon
will). I'm assuming it's similar only the "reverse".

By the way PJ, I do use a looped output buffer in my AudioTrack output
and I handle it myself.


-niko

On Nov 11, 3:48 pm, niko20  wrote:
> I've worked with the audio a lot (especially AudioTrack) and I believe
> you have everything correct PJ.
>
> Yesterday I had put together a test app to try playback/record at the
> same time and it worked just fine.
>
> You shouldn't get buffer overflow errors if you make a large buffer
> and then read from it as small chunks more quickly. That way you
> consume the buffer fast enough so it never gets full.
>
> It's the same way on AudioTrack for output, you make a buffer large
> enough, and then you write in small chunks fast enough to keep it
> full. However, in AudioTrack's case, you WILL get a delay the first
> time. I've found that AudioTrack won't play until the buffer is full
> for the first time. But I suspect that is how Audio buffers work on
> any platform.
>
> -niko
>
> On Nov 11, 3:09 pm, PJ  wrote:
>
>
>
> > If you are worried about delay, you could probably use a small data
> > chunk size and a large buffer size.
>
> > (In my examples, I always used zero for the offset, but you could have
> > a large buffer and process the data in small chunks.  You would
> > process the chunk at offset=0 first, then process the chunk with
> > offset = "chunk size", then "chunk size times 2", etc.  Eventually you
> > have to wrap around back to the beginning of the buffer.  I have no
> > idea if the API methods handle any of that for you automatically or
> > not.)
>
> > Anyway, that's makes sense in my head, but I don't have that much
> > experience with high-performant audio processing.  Maybe some experts
> > can correct me and/or elaborate on what the proper solution is.
>
> > -- PJ
>
> > On Nov 10, 11:23 pm, Bytes  wrote:
>
> > > Hi,
>
> > > Thanks for your mails.
>
> > > I pressume you did in Java.
>
> > > Ofcourse, we can do the same thing in C++ also.
>
> > > But the problem is...
>
> > > "Buffer Overflow ".
>
> > > By simply increasing the buffer size won't solve the whole issue.
>
> > > It may apparently solve buffer overflow, but it will add delay in
> > > playing
>
> > > By the way do you know any good documentation about Android Audio
> > > internals.
>
> > > I'm also waiting for Android OS/Audio Expert feedback about this
> > > implementation.
>
> > > Sometimeback, I've posted my audio experiences on another thread
>
> > >http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> > > Hopefully this time I can have success.

-- 
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: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
Yeah, my bad..

11-11 21:47:01.811: INFO/InetAddress(797): Unknown host
thishostdoesntexist.net, throwing UnknownHostException
11-11 21:47:02.270: ERROR/AndroidRuntime(797): Uncaught handler:
thread AsyncTask #1 exiting due to uncaught exception
11-11 21:47:02.260: WARN/dalvikvm(797): threadid=15: thread exiting
with uncaught exception (group=0x4001aa28)
11-11 21:47:02.270: ERROR/AndroidRuntime(797): Uncaught handler:
thread AsyncTask #1 exiting due to uncaught exception
11-11 21:47:02.280: ERROR/AndroidRuntime(797):
java.lang.RuntimeException: An error occured while executing
doInBackground()
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
android.os.AsyncTask$3.done(AsyncTask.java:200)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:
234)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.FutureTask.run(FutureTask.java:122)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:648)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:673)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.lang.Thread.run(Thread.java:1060)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): Caused by:
java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare()
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
android.os.Handler.(Handler.java:121)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
android.widget.Toast.(Toast.java:68)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
android.widget.Toast.makeText(Toast.java:231)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
foo.bar.MainActivity.onTaskError(MainActivity.java:113)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
foo.bar.MainActivity.access$2(MainActivity.java:110)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
foo.bar.MainActivity$GenerateMangaTitles.doInBackground
(MainActivity.java:223)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
foo.bar.MainActivity$GenerateMangaTitles.doInBackground
(MainActivity.java:1)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
android.os.AsyncTask$2.call(AsyncTask.java:185)
11-11 21:47:02.280: ERROR/AndroidRuntime(797): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)


On 11 Nov, 21:24, Mark Murphy  wrote:
> Lee Jarvis wrote:
> > So I've been sifting through example after example of android code,
> > and I see most web requests don't actually catch that many exceptions,
> > maybe because their path is hard coded so there is no room for user
> > error?
>
> > I'm still confused as the best way to exit my background task
> > gracefully if my get() method raises an exception, at the moment
> > getting anything but a force close just isn't happening
>
> Without a stack trace, it will be difficult for anyone to give you
> advice on this issue.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_
> Version 1.2 Available!

-- 
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: Recording direct system audio??

2009-11-11 Thread niko20
I've worked with the audio a lot (especially AudioTrack) and I believe
you have everything correct PJ.

Yesterday I had put together a test app to try playback/record at the
same time and it worked just fine.

You shouldn't get buffer overflow errors if you make a large buffer
and then read from it as small chunks more quickly. That way you
consume the buffer fast enough so it never gets full.

It's the same way on AudioTrack for output, you make a buffer large
enough, and then you write in small chunks fast enough to keep it
full. However, in AudioTrack's case, you WILL get a delay the first
time. I've found that AudioTrack won't play until the buffer is full
for the first time. But I suspect that is how Audio buffers work on
any platform.

-niko

On Nov 11, 3:09 pm, PJ  wrote:
> If you are worried about delay, you could probably use a small data
> chunk size and a large buffer size.
>
> (In my examples, I always used zero for the offset, but you could have
> a large buffer and process the data in small chunks.  You would
> process the chunk at offset=0 first, then process the chunk with
> offset = "chunk size", then "chunk size times 2", etc.  Eventually you
> have to wrap around back to the beginning of the buffer.  I have no
> idea if the API methods handle any of that for you automatically or
> not.)
>
> Anyway, that's makes sense in my head, but I don't have that much
> experience with high-performant audio processing.  Maybe some experts
> can correct me and/or elaborate on what the proper solution is.
>
> -- PJ
>
> On Nov 10, 11:23 pm, Bytes  wrote:
>
>
>
> > Hi,
>
> > Thanks for your mails.
>
> > I pressume you did in Java.
>
> > Ofcourse, we can do the same thing in C++ also.
>
> > But the problem is...
>
> > "Buffer Overflow ".
>
> > By simply increasing the buffer size won't solve the whole issue.
>
> > It may apparently solve buffer overflow, but it will add delay in
> > playing
>
> > By the way do you know any good documentation about Android Audio
> > internals.
>
> > I'm also waiting for Android OS/Audio Expert feedback about this
> > implementation.
>
> > Sometimeback, I've posted my audio experiences on another thread
>
> >http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> > Hopefully this time I can have success.

-- 
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: Multitouch support in Android 2.0

2009-11-11 Thread PJ
I'm seriously considering installing a special mouse driver that
allows two mice at once on the screen (they do exist), and trying to
see if the emulator responds to simultaneous clicks as multi-touch.
Someone please try this and let me know if it works.  Or maybe I'll
get around to it in a couple of weeks...



On Nov 10, 9:06 am, "gratiancutule...@yahoo.com"
 wrote:
> On Oct 27, 6:45 pm, Dianne Hackborn  wrote:
>
>
>
>
>
> > It's basically just some new APIs on MotionEvent:
>
> >http://developer.android.com/reference/android/view/MotionEvent.html
>
> > Hmmm
> >  and I'm not sure why, but in the doc all of those new APIs are in gray, so
> > they should be easy to see. :)
>
> > Or  here is the API diff report:
>
> >http://developer.android.com/sdk/api_diff/5/changes.html
>
> >  I see that I
> > didn't get around to writing documentation in MotionEvent on the way
> > multi-touch works; sorry about that.  Basically there are new actions that
> > tell you when additional fingers go down and up, and each MotionEvent you
> > receive allows you to query for the number of pointers in the event as well
> > as the x, y, size, and pressure of each of those points (and the historical
> > data for all those points as well if you want to collect all data since the
> > last motion event you received).
>
> > So it should be pretty straight-forward.  The main thing to watch out for is
> > the difference between the index in the current event for a pointer's data
> > vs. the pointer ID for that pointer:
>
> >http://developer.android.com/reference/android/view/MotionEvent.html#...
>
> > The
> > pointer ID allows you to keep track of the individual fingers across
> > multiple motion events.  For example, if the user touches finger 1, then
> > finger 2, then releases 1, then touches 1 again, you would see:
>
> > Finger 1 down: MotionEvent ACTION_DOWN with one pointer, whose ID is 0.
>
> > Finger 2 down: MotionEvent ACTION_POINTER_2_DOWN with two pointers, whose
> > IDs are 0 and 1.
>
> > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is
> > 1.
>
> > Finger 1 down: MotionEvent ACTION_POINTER_1_DOWN with two pointers, whose
> > IDs are 0 and 1.
>
> > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is
> > 1.
>
> > Finger 2 up: MotionEvent ACTION_UP with one pointer, whose ID is 1.
>
> > (And inspite of what the update documentation says, the API allows for an
> > arbitrary number of fingers, not just 3.  I just happened to define
> > convenience constants for the first 3 finger down/up actions, but given
> > their weird naming as seen above and the finger ID mask is actually 255, it
> > is perhaps best just to ignore those constants. :p)
>
> > On Tue, Oct 27, 2009 at 9:29 AM, Streets Of Boston
> > wrote:
>
> > > Kind-a burried inside the blog-post on developer.android.com (http://
> > > developer.android.com/sdk/android-2.0-highlights.html), i saw that
> > > multi-touch is now supported:
>
> > > Android virtual keyboard
> > > •An improved keyboard layout to makes it easier to hit the correct
> > > characters and improve typing speed.
> > > •The ***framework's multi-touch support*** ensures that key presses
> > > aren't missed while typing rapidly with two fingers.
> > > •A smarter dictionary learns from word usage and automatically
> > > includes contact names as suggestions.
> > > <<
>
> > > I'm really curious how multi-touch is supported in the API.
>
> > --
> > 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.
>
> Hello,
> Could you give me a more detailed example. I'm still not sure what is
> the difference between the pointer's ID and the pointer's index.
> Thanks!- 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


Re: [android-developers] Re: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Mark Murphy
Lee Jarvis wrote:
> So I've been sifting through example after example of android code,
> and I see most web requests don't actually catch that many exceptions,
> maybe because their path is hard coded so there is no room for user
> error?
> 
> I'm still confused as the best way to exit my background task
> gracefully if my get() method raises an exception, at the moment
> getting anything but a force close just isn't happening

Without a stack trace, it will be difficult for anyone to give you
advice on this issue.

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.2 Available!

-- 
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: AsyncTask and ProgressDialog

2009-11-11 Thread PJ
I have a similar problem.  The fact that the Activity is destroyed and
re-created every time the orientation changes doesn't make sense to
me.

Mark Murphy's second suggestion (overriding the default orientation-
handling code, so your activity is not destroyed and recreated)
actually makes the most sense, and part of me thinks that it should be
the default behavior.  In my personal opinion, the only thing that an
activity should need to do when the orientation changes is to re-draw
whatever UI components are already being shown.  All this extra work
of stopping and restarting dialogs, background tasks, etc. seems
unnecessary and extremely bug-prone.

Has anyone tried this strategy?  If so, how easy was it to re-draw the
UI?  And what other challenges did you face with this solution?

-- PJ



On Nov 11, 4:16 am, Lee Jarvis  wrote:
> Ahh! That makes total sense, I was trying to do more or less the same
> thing but it got tricky a there were a few flaws, this is great. I
> have a much better understanding of things now.
>
> Thanks
>
> On 11 Nov, 01:22, Lance Nanek  wrote:
>
>
>
> > Here's a quick attempt at rewriting it without a static. Turned out
> > more complex than I'd like. Pastebin version:http://pastebin.com/m7b8b184
>
> > Inline version:
> > public class MyActivity extends Activity {
>
> >         private final static String LOG_TAG = MyActivity.class.getSimpleName
> > ();
>
> >         private final static int DIALOG_ID = 1;
>
> >         private Task mTask;
>
> >         private boolean mShownDialog;
>
> >         @Override
> >         protected void onPrepareDialog(int id, Dialog dialog) {
> >                 super.onPrepareDialog(id, dialog);
>
> >                 if ( id == DIALOG_ID ) {
> >                         mShownDialog = true;
> >                 }
> >         }
>
> >         private void onTaskCompleted() {
> >                 Log.i(LOG_TAG, "Activity " + this + " has been notified the 
> > task is
> > complete.");
>
> >                 //Check added because dismissDialog throws an exception if 
> > the
> > current
> >                 //activity hasn't shown it. This Happens if task finishes 
> > early
> > enough
> >                 //before an orientation change that the dialog is already 
> > gone when
> >                 //the previous activity bundles up the dialogs to reshow.
> >                 if ( mShownDialog ) {
> >                         dismissDialog(DIALOG_ID);
> >                         Toast.makeText(this, "Finished..", 
> > Toast.LENGTH_LONG).show();
> >                 }
> >         }
>
> >         @Override
> >         protected void onCreate(Bundle savedInstanceState) {
> >                 super.onCreate(savedInstanceState);
> >                 setContentView(R.layout.main);
>
> >                 Object retained = getLastNonConfigurationInstance();
> >                 if ( retained instanceof Task ) {
> >                         Log.i(LOG_TAG, "Reclaiming previous background 
> > task.");
> >                         mTask = (Task) retained;
> >                         mTask.setActivity(this);
> >                 } else {
> >                         Log.i(LOG_TAG, "Creating new background task.");
> >                         mTask = new Task(this);
> >                         mTask.execute();
> >                 }
> >         }
>
> >         @Override
> >         public Object onRetainNonConfigurationInstance() {
> >                 mTask.setActivity(null);
> >                 return mTask;
> >         }
>
> >         @Override
> >         protected Dialog onCreateDialog(int id) {
> >                 switch (id) {
> >                         case DIALOG_ID:
> >                                 ProgressDialog dialog = new 
> > ProgressDialog(this);
> >                                 dialog.setMessage("Loading stuff..");
> >                                 dialog.setCancelable(true);
> >                                 return dialog;
> >                 }
> >                 return super.onCreateDialog(id);
> >         }
>
> >         private static class Task extends AsyncTask {
>
> >                 private MyActivity activity;
>
> >                 private boolean completed;
>
> >                 private Task(MyActivity activity) {
> >                         this.activity = activity;
> >                 }
>
> >                 @Override
> >                 protected void onPreExecute() {
> >                         activity.showDialog(DIALOG_ID);
> >                 }
>
> >                 @Override
> >                 protected Void doInBackground(Void... unused) {
> >                         try {
> >                                 Log.i(LOG_TAG, "Background thread starting 
> > sleep.");
> >                                 Thread.sleep(15 * 1000);
> >                         } catch (InterruptedException e) {
> >                                 Log.e(LOG_TAG, "Thread interrupted:", e);
> >                         }
> >                         Log.i(LOG_TAG, 

[android-developers] Re: Reading from database/file

2009-11-11 Thread PJ
Also you can look at the Notepad tutorial, which is a very simple but
helpful tutorial that covers how to use a SQLite3 database and how to
use a cursor object to automatically populate a UI list:

http://developer.android.com/guide/tutorials/notepad/index.html



On Nov 10, 9:18 pm, Stephen Abrams  wrote:
> Hi Artem,
>
> I think this might help:
>
> http://www.anddev.org/working_with_the_sqlite-database_-_cursors-t319...
>
> Accessing the db 
> directly:http://developer.android.com/guide/developing/tools/adb.html(section
> "Examining sqlite3 Databases from a Remote Shell")
>
> As a new Android developer, you might want to spend some time pouring
> over the Framework Topics here:http://developer.android.com/guide/index.html
>
> HTH
> Steve
>
> On Nov 10, 9:44 pm, Artem  wrote:
>
>
>
> > I'm new to Android development so I don't really know how all this
> > works.  I know a lot of web languages but they're a lot different from
> > java (which is what Android uses, I believe). I'm trying to create a
> > small application but can't figure out how to populate a list or
> > select box with data.  How do I store the data so when you install the
> > application it will read it from some database/file and display it?
> > Do I need to use SQLite for this? If yes, how do I populate it before
> > exporting the application? Sorry, I'm new...- 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] Re: Android developer add your software on All In One Pocket PC

2009-11-11 Thread Jeffrey
Why isn't the email address @allinonepocketpc.com? It seems like you
are not affiliated with them and just want to steal other people's
work...

On Nov 11, 5:51 am, Stefano Zucchelli 
wrote:
> All In One Pocket PC, if you are a developer visit the 
> sitehttp://www.allinonepocketpc.comand click on “Developers area” where
> you will find all of the information for selling your software for
> mobile devices.
> Each piece of software sold will result in 80% of the price going to
> the developer! This is the highest percentage to be found on the web.
> In order to insert your applications send an e-mail to the address
> allinone.zucche...@gmail.com attaching the program file, the operating
> system, a brief description and a picture which will appear in the
> catalogue.

-- 
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: Recording direct system audio??

2009-11-11 Thread PJ
If you are worried about delay, you could probably use a small data
chunk size and a large buffer size.

(In my examples, I always used zero for the offset, but you could have
a large buffer and process the data in small chunks.  You would
process the chunk at offset=0 first, then process the chunk with
offset = "chunk size", then "chunk size times 2", etc.  Eventually you
have to wrap around back to the beginning of the buffer.  I have no
idea if the API methods handle any of that for you automatically or
not.)

Anyway, that's makes sense in my head, but I don't have that much
experience with high-performant audio processing.  Maybe some experts
can correct me and/or elaborate on what the proper solution is.

-- PJ



On Nov 10, 11:23 pm, Bytes  wrote:
> Hi,
>
> Thanks for your mails.
>
> I pressume you did in Java.
>
> Ofcourse, we can do the same thing in C++ also.
>
> But the problem is...
>
> "Buffer Overflow ".
>
> By simply increasing the buffer size won't solve the whole issue.
>
> It may apparently solve buffer overflow, but it will add delay in
> playing
>
> By the way do you know any good documentation about Android Audio
> internals.
>
> I'm also waiting for Android OS/Audio Expert feedback about this
> implementation.
>
> Sometimeback, I've posted my audio experiences on another thread
>
> http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> Hopefully this time I can have success.

-- 
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


Re: [android-developers] Phone to phone/emulator comminication

2009-11-11 Thread Michael Budas
Thanks I saw this in passing but it a bit confession to me, do I have to
change the code in the system or just redirect from the command line. Can
this be done in eclipse or is it only from command line.

On Wed, Nov 11, 2009 at 8:47 PM, Mark Murphy wrote:

> Mike88 wrote:
> > Hello what i am doing is creating a program that will let me allow two
> > android phones to communicate over TCP.
>
> 
>
> > E/TCP (  700): java.net.ConnectException: /127.0.0.1: -
> > Connection refused
>
> Bear in mind that 127.0.0.1 is the emulator itself, not another emulator.
>
>
> http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking
>
> --
> 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

-- 
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: Moving to 2.0 from 1.6 -> error reported of a violation of a core library class that doesn't exist in app

2009-11-11 Thread Sam
Okay, I figured it out. Basically there's 2 steps.
1. In Eclipse under the project Properties -> Android -> Android 2.0.
This is suppose to swap the Android Library files under Java Build
Path. I had originally deleted the 1.6 Library, and manually added the
android.jar in the Android 2.0 platform and that is incorrect. The
system has to switch the library packages.
2. If still having some problems, right click on the projects folder -
> Android Tools -> Fix Project Properties.

These 2 steps got my 2.0 to finally run.

On Nov 11, 3:27 pm, Sam  wrote:
> Hi,
>
> I just updated and ran into the issue. Can you please provide step by
> step what you did to solve this?
>
> Sam
>
> On Nov 5, 4:03 am, vachudj  wrote:
>
> > Hi,
> > I had the same problem.
> > I solved it by removing 1.6libraryand appending 2.0library.
> > The just changing the 2.0's android.jar file instead of 1.6libraryis
> > not sufficient.
> > The android.jar file must be represented in project as newlibrary.
>
> > Hopefully it helps... .
>
> > On Oct 30, 5:01 am, JP  wrote:
>
> > > OK fixed.
> > > I've toyed around a little more and, in Eclipse, applied Android Tools> 
> > > Fix Project Properties.
>
> > > That created a single Google APIs [Android 2.0] entry in Libraries, as
> > > opposed to the two individual entries android.jar and maps.jar
> > > For future reference. Hope this helps someone else.
>
> > > On Oct 29, 7:51 pm, JP  wrote:
>
> > > > After getting comfy with the Android 2.0 environment and emulator (for
> > > > the most part), I took the next step to bind  against the
> > > > latest Android 2.0 jars: android.jar and maps.jar
>
> > > > The existing code (working in Android 1.6) did not need any changes to
> > > > compile, but the app doesn't build due to a weird error message that
> > > > prevents the build. See snippet below, drawn from the Eclipse
> > > > Console.
> > > > I have no aspirations to run up against anycorelibraryclasses, and
> > > > I am not aware I do. In other words, I am not implementing
> > > > SealedObject (or any othercoreclassthat I am aware of) that would
> > > > run up against Dalvik. Not in the javax, java or any other namespace.
> > > > Anybody got any pointers what's going on here?
>
> > > > <- Snippet >
>
> > > > [2009-10-29 19:37:42 - ]
> > > > trouble processing "javax/crypto/SealedObject.class":
> > > > [2009-10-29 19:37:42 - ]
> > > > Attempt to include acoreclass(java.* or javax.*) in something other
> > > > than acorelibrary. It is likely that you have attempted to include
> > > > in an application thecorelibrary(or a part thereof) from a desktop
> > > > virtual machine. This will most assuredly not work. At a minimum, it
> > > > jeopardizes the compatibility of your app with future versions of the
> > > > platform. It is also often of questionable legality.
>
> > > > If you really intend to build acorelibrary-- which is only
> > > > appropriate as part of creating a full virtual machine distribution,
> > > > as opposed to compiling an application -- then use the
> > > > "--core-library" option to suppress this error message.
>
> > > > If you go ahead and use "--core-library" but are in fact building an
> > > > application, then be forewarned that your application will still fail
> > > > to build or run, at some point. Please be prepared for angry customers
> > > > who find, for example, that your application ceases to function once
> > > > they upgrade their operating system. You will be to blame for this
> > > > problem.
>
> > > > If you are legitimately using some code that happens to be in acore
> > > > package, then the easiest safe alternative you have is to repackage
> > > > that code. That is, move the classes in question into your own package
> > > > namespace. This means that they will never be in conflict withcore
> > > > system classes. If you find that you cannot do this, then that is an
> > > > indication that the path you are on will ultimately lead to pain,
> > > > suffering, grief, and lamentation.
>
> > > > [2009-10-29 19:37:42 - ]1 error; aborting
> > > > [2009-10-29 19:37:42 - ]Conversion to Dalvik format failed with
> > > > error 1
>
> > > > <--- Snippet >

-- 
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: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
So I've been sifting through example after example of android code,
and I see most web requests don't actually catch that many exceptions,
maybe because their path is hard coded so there is no room for user
error?

I'm still confused as the best way to exit my background task
gracefully if my get() method raises an exception, at the moment
getting anything but a force close just isn't happening

On 11 Nov, 18:43, Lee Jarvis  wrote:
> I have the following code...
>
>         @Override
>         protected Void doInBackground(Void... unused) {
>                 Log.i(TAG, "invoking background thread");
>
>                         try {
>                                 mClient.get("http://thishostdoesntexist";);
>                         } catch (RuntimeException e) {
>                                 mActivity.onTaskError(e.getMessage());
>                         } catch (HttpResponseException e) {
>                                 mActivity.onTaskError(e.getMessage());
>                         } catch (ClientProtocolException e) {
>                                 mActivity.onTaskError(e.getMessage());
>                         } catch (UnknownHostException e) {
>                                 mActivity.onTaskError(e.getMessage());
>                         } catch (IOException e) {
>                                 mActivity.onTaskError(e.getMessage());
>                         }
>
>                 Log.i(TAG, "exiting background thread");
>                 return null;
>         }
>
> My mClient get method is a simple HttpClient execute with an output
> buffer to read the input stream, so it's very trivial. Everytime I
> execute this task UnknownHostException will be triggered which will in
> turn call onTaskError on my currect Activity, but I still get a
> RuntimeException, but I don't see why. Maybe it's because it's late
> and i've done about 12 hours of writing code so it's something simple
> I just can't see?
>
> What should I be looking for?
>
> 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: outgoing call data stream / channel

2009-11-11 Thread Roman ( T-Mobile USA)
Here is a pretty good link which talks about the intercommunication of
baseband and AP

http://www.embedded.com/columns/technicalinsights/187203124?_requestid=22

--
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 Nov 11, 12:06 pm, "Roman ( T-Mobile USA)"  wrote:
> Hi Joachim,
>
> That's kind of correct. The so called baseband processor (which runs
> the cellular low level stuff, RF, modem functionality, ...), has to
> expose whatever would be needed from higher level. You might be able
> to get some additional radio property information using AT commands
> but getting a handle for the voice stream is much more complex.
>
> If you want to find out more about this google for interprocess
> communication between application and baseband processors.
>
> --
> 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 Nov 10, 10:17 am, Joachim Neumann  wrote:
>
> > Hi Dianne,
>
> > I am also struggling with this issue and would like to understand the
> > limitations in current Android hardware.
>
> > My present understanding is that in on current Android phones there is
> > a GSM/3G chip that
> > 1. receives the *analogue* GSM/3G antenna signal
> > 2. receives modem-like AT commands from Android to initiate phone
> > calls, send text messages, etc.
> > 3. routes the *analog* audio signal from the GSM/3G antenna to the
> > amplifier/speaker or bluetooth headset.
>
> > In such a setup, the audio signal of the phone call would exist in
> > digital form within the GMS/3G chip, but it would be out of reach for
> > the android OS. Outside the GMS/3G chip, the call signa would only
> > exist in analog form - while being routed to the amplifier/speaker or
> > to the bluetooth chip.
>
> > In this case, the only hope for software access to the audio signal
> > during a phone call would be a completely new design that implements
> > the mobile phone functionality in software.
>
> > Is that correct?
>
> > Dr. Joachim Neumann
>
> > P.S.: I would like to implement a hearing aid in software, 
> > seewww.amplicell.com
>
>

-- 
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


  1   2   3   >