[android-beginners] Re: how to i check if an EditText is empty

2009-10-20 Thread Jeffrey Blattman
toString().length() == 0?

On Oct 20, 2009 1:48 PM, "JasonMP"  wrote:


using "if(someEditText.getText().toString == null) " doesnt work

im passing information from this editText into a database.  Ive
already limited it to 2 characters and numbers only in the xml file,
but i need to run a check to fill its defaults to 0 if nothing is
entered.  I could set its default to 0, but then my hint text would
show up.  Could someone give me a hand with this?

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



[android-beginners] Re: How to make a child activity?

2009-10-18 Thread niko20

I dont understand why everyone makes this so complicated.

First of all, this is a phone, you don't want to be using tons of data
structures. There is nothing wrong with some global variables/
functions.

If you want to store data that will be shared between activities, just
simply use a static class with all static methods. Then you don't need
a singleton or anything else fancy. It will act as a global reference,
with the benefit of having its own namespace too.

There is no need to do all this fancy programming stuff when you are
writing for an embedded device! Master View Controller is way
overboard! Just do code to get the job done (but still clean code of
course). Just because you CAN do something doesn't mean you should. Or
even if it's "recommended" that it's the best way to do it, especially
on a mobile platform. Windows C++ programming techniques are not
really portable to this platform.

-niko

On Oct 16, 7:00 pm, Paul Turchenko  wrote:
> Another way you can use to share common data between activities is
> having it in the Application's instance. Just create your own
> Application - derived class, tell Android via manifest to use it and
> you can easily access it from any context. Say you have MyApplication
> extending Application, then (after specifying that in manifest) you
> can access your MyApplication's instance via (MyApplication)
> getApplication() call from any of your activities. Perhaps the
> singleton pattern is more handy in your design, but just consider this
> approach FYI.
>
> On Oct 16, 11:22 am, vchris80  wrote:
>
> > thanks, I feel a bit over complicate and bug-prone to manage views
> > manually via setContentView, so I simply changed the architecture,
> > putting the common classes of interest in a singleton (luckily this
> > solution fits with my app design). This way I can decouple the
> > activities and keep a common business class, leaving Android manage
> > the views.
>
> > On 15 Ott, 20:45, "Yusuf Saib (T-Mobile USA)" 
> > Mobile.com> wrote:
> > > If you are more specific about what the 3+ buttons are supposed to do,
> > > we may be able to suggest alternatives.
>
> > > To answer your question, setContentView is needed with ActivityGroup.
>
> > > Yusuf Saib
> > > Android
> > > ·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.
>
> > > P.S. You can only make a child activity when a mommy activity and a
> > > daddy activity love each other very much enough to get married first.
>
> > > On Oct 15, 12:50 am, vchris80  wrote:
>
> > > > hi james, thanx for reply. I try to explain what I want to achieve.
>
> > > > It is actually very simple, but maybe I am walking on the wrong path
> > > > since I "think in the Windows way" other than in the "Android way" :)
>
> > > > My app is a window with 3 buttons (can't use tab since the buttons
> > > > will increase in the future and since this is a porting from other
> > > > platform and I have to follow the same UI guidelines as far as
> > > > possible). Each button launch an activity and needs a reference to the
> > > > main activity (parent) in order to use some common utility classes.
>
> > > > I thought to do so by implementing the main activity as an
> > > > ActivityGroup (thank to you first suggestion) and launch each child
> > > > activity by getLocalActivityManager().startActivity() as I said in the
> > > > previous post. But, as said, this doesn't update the screen with the
> > > > new activity view. I have to explicitly call setContentView and put
> > > > the child activity view (obtained by getDecorView()). Is this the
> > > > right way or am I doing a mess? Then, when I finish() the child I
> > > > restore the old view.
>
> > > > On 14 Ott, 20:50, James Yum  wrote:
>
> > > > > Hi,
> > > > > I'm still not sure what you're trying to achieve. Are you really 
> > > > > trying to
> > > > > embed an activity within another? You can look at the TabActivity 
> > > > > source for
> > > > > a pretty clean example:
>
> > > > >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > > > > 
> > > > > Cheers,
> > > > > James
>
> > > > > On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:
>
> > > > > > thank for your reply, but I still have some troubles:
>
> > > > > > now I have my main activiy been a ActivityGroup and the child 
> > > > > > activity
> > > > > > been a simple Activity.
>
> > > > > > I start the child with this code:
>
> > > > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > > > ChildActivity.class);
> > > > > > getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> > > > > > startIntent);
>
> > > > > > this way, in the onCreate of the child activity, I can get the 
> > > > > > parent
> > > > > > and the activity results child of s

[android-beginners] Re: How to make a child activity?

2009-10-16 Thread Paul Turchenko

Another way you can use to share common data between activities is
having it in the Application's instance. Just create your own
Application - derived class, tell Android via manifest to use it and
you can easily access it from any context. Say you have MyApplication
extending Application, then (after specifying that in manifest) you
can access your MyApplication's instance via (MyApplication)
getApplication() call from any of your activities. Perhaps the
singleton pattern is more handy in your design, but just consider this
approach FYI.

On Oct 16, 11:22 am, vchris80  wrote:
> thanks, I feel a bit over complicate and bug-prone to manage views
> manually via setContentView, so I simply changed the architecture,
> putting the common classes of interest in a singleton (luckily this
> solution fits with my app design). This way I can decouple the
> activities and keep a common business class, leaving Android manage
> the views.
>
> On 15 Ott, 20:45, "Yusuf Saib (T-Mobile USA)" 
> Mobile.com> wrote:
> > If you are more specific about what the 3+ buttons are supposed to do,
> > we may be able to suggest alternatives.
>
> > To answer your question, setContentView is needed with ActivityGroup.
>
> > Yusuf Saib
> > Android
> > ·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.
>
> > P.S. You can only make a child activity when a mommy activity and a
> > daddy activity love each other very much enough to get married first.
>
> > On Oct 15, 12:50 am, vchris80  wrote:
>
> > > hi james, thanx for reply. I try to explain what I want to achieve.
>
> > > It is actually very simple, but maybe I am walking on the wrong path
> > > since I "think in the Windows way" other than in the "Android way" :)
>
> > > My app is a window with 3 buttons (can't use tab since the buttons
> > > will increase in the future and since this is a porting from other
> > > platform and I have to follow the same UI guidelines as far as
> > > possible). Each button launch an activity and needs a reference to the
> > > main activity (parent) in order to use some common utility classes.
>
> > > I thought to do so by implementing the main activity as an
> > > ActivityGroup (thank to you first suggestion) and launch each child
> > > activity by getLocalActivityManager().startActivity() as I said in the
> > > previous post. But, as said, this doesn't update the screen with the
> > > new activity view. I have to explicitly call setContentView and put
> > > the child activity view (obtained by getDecorView()). Is this the
> > > right way or am I doing a mess? Then, when I finish() the child I
> > > restore the old view.
>
> > > On 14 Ott, 20:50, James Yum  wrote:
>
> > > > Hi,
> > > > I'm still not sure what you're trying to achieve. Are you really trying 
> > > > to
> > > > embed an activity within another? You can look at the TabActivity 
> > > > source for
> > > > a pretty clean example:
>
> > > >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > > > 
> > > > Cheers,
> > > > James
>
> > > > On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:
>
> > > > > thank for your reply, but I still have some troubles:
>
> > > > > now I have my main activiy been a ActivityGroup and the child activity
> > > > > been a simple Activity.
>
> > > > > I start the child with this code:
>
> > > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > > ChildActivity.class);
> > > > > getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> > > > > startIntent);
>
> > > > > this way, in the onCreate of the child activity, I can get the parent
> > > > > and the activity results child of something by calling isChild()
> > > > > method. Fine. But the screen actually doesn't appear. The
> > > > > documentation of startActivity of LocalActivityManager says that "The
> > > > > caller needs to take care of adding this window to a view hierarchy",
> > > > > but I can't figure out how to do that. I watched the WindowManager for
> > > > > a suitable method but with no luck.
>
> > > > > On 13 Ott, 19:09, James Yum  wrote:
> > > > > > Hi,
> > > > > > Those are meant for an ActivityGroup and its embedded activities, 
> > > > > > for
> > > > > > example a TabActivity.
>
> > > > > > What you might want to look into, is this introduction on opening 
> > > > > > screens
> > > > > > (activities):
>
> > > > > >http://developer.android.com/guide/appendix/faq/commontasks.html#open...
>
> > > > > > Cheers,
> > > > > > James
>
> > > > > > On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
>
> > > > > > > Hi all, I have a simple question: how I make an activity that is 
> > > > > > > child
> > > > > > > of another?
>
> > > > > > > I use this code to start an activity from another:
>
> > > > > > > Intent startIntent 

[android-beginners] Re: How to convert oid program? java programs:zoneaandd.java and clock.javato Android program?

2009-10-16 Thread Nancy Forbes
I understand you were using horde software for dalecarnegie. I understand we
can use through web based. Do we need to install something to do it if
someone is going to start using HORDE? How would we do this


"Forbes and Associates - Web Design, Web Redesign, Web Updates, Logo,
business card , brochure design and all kinds of web marketing. If your
website can not be found in the search engines or is not getting the results
you want to SEE, please talk to me l www.forbesandassociates.com l
na...@forbesandassociates.com l Office 407 657 9069 l

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



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-16 Thread KK

ahI've not been deep into linux, and i have no sense on how to
handle linux gui, and I think it's pretty easy once you know how to
hookup ICON interface.
the aapt source is there and open :D

I'll keep update when I'm doing research aapt tool. :D

On 10月15日, 下午9时03分, Sean Hodges  wrote:
> Very interesting, thanks for keeping us up to date.
>
> Any chance your shell extension implementation might be ported to Linux?
>
> 2009/10/15 KK :
>
>
>
>
>
> > actually, the code of extractioniconis inside aapt which is from
> > base package of android source code.
> > I create a .net dll to displayiconin explorer, for now, I easily
> > include aapt.exe into resorce, extract it and run it when needed.
> > I will transform the code into native .net language (hopefully)...
>
> > try it if you are interested.
> >http://code.google.com/p/apkshellext/
>
> > On 10月8日, 下午2时54分, KK  wrote:
> >> Hi,
>
> >> I found the path is stored in resources.arsc, but where to indicates
> >> the index?
>
> >> BR,
> >> KK
>
> >> On Oct 7, 11:48 am, KK  wrote:
>
> >> > Sorry, I'm NOT using android API
>
> >> > On Oct 7, 11:40 am, KK  wrote:
>
> >> > > Actually I'm doing a shell extension for windows, showing theiconof
> >> > > apk files in windows, isn't it a good idea? :D
> >> > > so I want to know where theiconlocated in apk file, and I'm using
> >> > > android API...
>
> >> > > Thanks for your tip, at least I can go and see the source code of
> >> > > packagemanager..
>
> >> > > BR,
> >> > > KK
>
> >> > > On Oct 7, 2:58 am, Justin Anderson  wrote:
>
> >> > > > What exactly are you trying to do with thisicon?
>
> >> > > > You can get theiconof an installed application on your phone via
> >> > > > PackageManager.getActivityIcon() or 
> >> > > > PackageManager.getApplicationIcon().
>
> >> > > >http://developer.android.com/reference/android/content/pm/PackageMana...
>
> >> > > > Thanks,
> >> > > > Justin
>
> >> > > > --
> >> > > > There are only 10 types of people in the world...
> >> > > > Those who know binary and those who don't.
> >> > > > --
>
> >> > > > On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>
> >> > > > > Hi,
>
> >> > > > > I'm trying to get theiconfrom an apk file, but I found not every 
> >> > > > > app
> >> > > > > use the theicon.png under res/, and androidmanifest.xml is compiled
> >> > > > > inside apk, where I can get the position information?
>
> >> > > > > Thx & BR,
> >> > > > > KK- Hide quoted text -
>
> >> > > > - Show quoted text -- Hide quoted text -
>
> >> > > - Show quoted text -- Hide quoted text -
>
> >> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make a child activity?

2009-10-16 Thread vchris80

thanks, I feel a bit over complicate and bug-prone to manage views
manually via setContentView, so I simply changed the architecture,
putting the common classes of interest in a singleton (luckily this
solution fits with my app design). This way I can decouple the
activities and keep a common business class, leaving Android manage
the views.

On 15 Ott, 20:45, "Yusuf Saib (T-Mobile USA)"  wrote:
> If you are more specific about what the 3+ buttons are supposed to do,
> we may be able to suggest alternatives.
>
> To answer your question, setContentView is needed with ActivityGroup.
>
> Yusuf Saib
> Android
> ·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.
>
> P.S. You can only make a child activity when a mommy activity and a
> daddy activity love each other very much enough to get married first.
>
> On Oct 15, 12:50 am, vchris80  wrote:
>
> > hi james, thanx for reply. I try to explain what I want to achieve.
>
> > It is actually very simple, but maybe I am walking on the wrong path
> > since I "think in the Windows way" other than in the "Android way" :)
>
> > My app is a window with 3 buttons (can't use tab since the buttons
> > will increase in the future and since this is a porting from other
> > platform and I have to follow the same UI guidelines as far as
> > possible). Each button launch an activity and needs a reference to the
> > main activity (parent) in order to use some common utility classes.
>
> > I thought to do so by implementing the main activity as an
> > ActivityGroup (thank to you first suggestion) and launch each child
> > activity by getLocalActivityManager().startActivity() as I said in the
> > previous post. But, as said, this doesn't update the screen with the
> > new activity view. I have to explicitly call setContentView and put
> > the child activity view (obtained by getDecorView()). Is this the
> > right way or am I doing a mess? Then, when I finish() the child I
> > restore the old view.
>
> > On 14 Ott, 20:50, James Yum  wrote:
>
> > > Hi,
> > > I'm still not sure what you're trying to achieve. Are you really trying to
> > > embed an activity within another? You can look at the TabActivity source 
> > > for
> > > a pretty clean example:
>
> > >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > > 
> > > Cheers,
> > > James
>
> > > On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:
>
> > > > thank for your reply, but I still have some troubles:
>
> > > > now I have my main activiy been a ActivityGroup and the child activity
> > > > been a simple Activity.
>
> > > > I start the child with this code:
>
> > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > ChildActivity.class);
> > > > getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> > > > startIntent);
>
> > > > this way, in the onCreate of the child activity, I can get the parent
> > > > and the activity results child of something by calling isChild()
> > > > method. Fine. But the screen actually doesn't appear. The
> > > > documentation of startActivity of LocalActivityManager says that "The
> > > > caller needs to take care of adding this window to a view hierarchy",
> > > > but I can't figure out how to do that. I watched the WindowManager for
> > > > a suitable method but with no luck.
>
> > > > On 13 Ott, 19:09, James Yum  wrote:
> > > > > Hi,
> > > > > Those are meant for an ActivityGroup and its embedded activities, for
> > > > > example a TabActivity.
>
> > > > > What you might want to look into, is this introduction on opening 
> > > > > screens
> > > > > (activities):
>
> > > > >http://developer.android.com/guide/appendix/faq/commontasks.html#open...
>
> > > > > Cheers,
> > > > > James
>
> > > > > On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
>
> > > > > > Hi all, I have a simple question: how I make an activity that is 
> > > > > > child
> > > > > > of another?
>
> > > > > > I use this code to start an activity from another:
>
> > > > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > > > ChildActivity.class);
> > > > > > startActivity(startIntent);
>
> > > > > > but on the onCreate method of ChildActivity, if I watch for 
> > > > > > getParent
> > > > > > () I get null, and if I ask for isChild() I get false,... so what I
> > > > > > miss?
>
> > > > > > thank you
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~---

[android-beginners] Re: How to make a child activity?

2009-10-15 Thread Yusuf Saib (T-Mobile USA)

If you are more specific about what the 3+ buttons are supposed to do,
we may be able to suggest alternatives.

To answer your question, setContentView is needed with ActivityGroup.



Yusuf Saib
Android
·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.


P.S. You can only make a child activity when a mommy activity and a
daddy activity love each other very much enough to get married first.



On Oct 15, 12:50 am, vchris80  wrote:
> hi james, thanx for reply. I try to explain what I want to achieve.
>
> It is actually very simple, but maybe I am walking on the wrong path
> since I "think in the Windows way" other than in the "Android way" :)
>
> My app is a window with 3 buttons (can't use tab since the buttons
> will increase in the future and since this is a porting from other
> platform and I have to follow the same UI guidelines as far as
> possible). Each button launch an activity and needs a reference to the
> main activity (parent) in order to use some common utility classes.
>
> I thought to do so by implementing the main activity as an
> ActivityGroup (thank to you first suggestion) and launch each child
> activity by getLocalActivityManager().startActivity() as I said in the
> previous post. But, as said, this doesn't update the screen with the
> new activity view. I have to explicitly call setContentView and put
> the child activity view (obtained by getDecorView()). Is this the
> right way or am I doing a mess? Then, when I finish() the child I
> restore the old view.
>
> On 14 Ott, 20:50, James Yum  wrote:
>
>
>
> > Hi,
> > I'm still not sure what you're trying to achieve. Are you really trying to
> > embed an activity within another? You can look at the TabActivity source for
> > a pretty clean example:
>
> >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > 
> > Cheers,
> > James
>
> > On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:
>
> > > thank for your reply, but I still have some troubles:
>
> > > now I have my main activiy been a ActivityGroup and the child activity
> > > been a simple Activity.
>
> > > I start the child with this code:
>
> > > Intent startIntent = new Intent(MyMainActivity.this,
> > > ChildActivity.class);
> > > getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> > > startIntent);
>
> > > this way, in the onCreate of the child activity, I can get the parent
> > > and the activity results child of something by calling isChild()
> > > method. Fine. But the screen actually doesn't appear. The
> > > documentation of startActivity of LocalActivityManager says that "The
> > > caller needs to take care of adding this window to a view hierarchy",
> > > but I can't figure out how to do that. I watched the WindowManager for
> > > a suitable method but with no luck.
>
> > > On 13 Ott, 19:09, James Yum  wrote:
> > > > Hi,
> > > > Those are meant for an ActivityGroup and its embedded activities, for
> > > > example a TabActivity.
>
> > > > What you might want to look into, is this introduction on opening 
> > > > screens
> > > > (activities):
>
> > > >http://developer.android.com/guide/appendix/faq/commontasks.html#open...
>
> > > > Cheers,
> > > > James
>
> > > > On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
>
> > > > > Hi all, I have a simple question: how I make an activity that is child
> > > > > of another?
>
> > > > > I use this code to start an activity from another:
>
> > > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > > ChildActivity.class);
> > > > > startActivity(startIntent);
>
> > > > > but on the onCreate method of ChildActivity, if I watch for getParent
> > > > > () I get null, and if I ask for isChild() I get false,... so what I
> > > > > miss?
>
> > > > > thank you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-15 Thread Sean Hodges

Very interesting, thanks for keeping us up to date.

Any chance your shell extension implementation might be ported to Linux?


2009/10/15 KK :
>
> actually, the code of extraction icon is inside aapt which is from
> base package of android source code.
> I create a .net dll to display icon in explorer, for now, I easily
> include aapt.exe into resorce, extract it and run it when needed.
> I will transform the code into native .net language (hopefully)...
>
> try it if you are interested.
> http://code.google.com/p/apkshellext/
>
> On 10月8日, 下午2时54分, KK  wrote:
>> Hi,
>>
>> I found the path is stored in resources.arsc, but where to indicates
>> the index?
>>
>> BR,
>> KK
>>
>> On Oct 7, 11:48 am, KK  wrote:
>>
>>
>>
>> > Sorry, I'm NOT using android API
>>
>> > On Oct 7, 11:40 am, KK  wrote:
>>
>> > > Actually I'm doing a shell extension for windows, showing theiconof
>> > > apk files in windows, isn't it a good idea? :D
>> > > so I want to know where theiconlocated in apk file, and I'm using
>> > > android API...
>>
>> > > Thanks for your tip, at least I can go and see the source code of
>> > > packagemanager..
>>
>> > > BR,
>> > > KK
>>
>> > > On Oct 7, 2:58 am, Justin Anderson  wrote:
>>
>> > > > What exactly are you trying to do with thisicon?
>>
>> > > > You can get theiconof an installed application on your phone via
>> > > > PackageManager.getActivityIcon() or 
>> > > > PackageManager.getApplicationIcon().
>>
>> > > >http://developer.android.com/reference/android/content/pm/PackageMana...
>>
>> > > > Thanks,
>> > > > Justin
>>
>> > > > --
>> > > > There are only 10 types of people in the world...
>> > > > Those who know binary and those who don't.
>> > > > --
>>
>> > > > On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>>
>> > > > > Hi,
>>
>> > > > > I'm trying to get theiconfrom an apk file, but I found not every app
>> > > > > use the theicon.png under res/, and androidmanifest.xml is compiled
>> > > > > inside apk, where I can get the position information?
>>
>> > > > > Thx & BR,
>> > > > > KK- Hide quoted text -
>>
>> > > > - Show quoted text -- Hide quoted text -
>>
>> > > - Show quoted text -- Hide quoted text -
>>
>> > - Show quoted text -
> >
>

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



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-15 Thread KK

actually, the code of extraction icon is inside aapt which is from
base package of android source code.
I create a .net dll to display icon in explorer, for now, I easily
include aapt.exe into resorce, extract it and run it when needed.
I will transform the code into native .net language (hopefully)...

try it if you are interested.
http://code.google.com/p/apkshellext/

On 10月8日, 下午2时54分, KK  wrote:
> Hi,
>
> I found the path is stored in resources.arsc, but where to indicates
> the index?
>
> BR,
> KK
>
> On Oct 7, 11:48 am, KK  wrote:
>
>
>
> > Sorry, I'm NOT using android API
>
> > On Oct 7, 11:40 am, KK  wrote:
>
> > > Actually I'm doing a shell extension for windows, showing theiconof
> > > apk files in windows, isn't it a good idea? :D
> > > so I want to know where theiconlocated in apk file, and I'm using
> > > android API...
>
> > > Thanks for your tip, at least I can go and see the source code of
> > > packagemanager..
>
> > > BR,
> > > KK
>
> > > On Oct 7, 2:58 am, Justin Anderson  wrote:
>
> > > > What exactly are you trying to do with thisicon?
>
> > > > You can get theiconof an installed application on your phone via
> > > > PackageManager.getActivityIcon() or PackageManager.getApplicationIcon().
>
> > > >http://developer.android.com/reference/android/content/pm/PackageMana...
>
> > > > Thanks,
> > > > Justin
>
> > > > --
> > > > There are only 10 types of people in the world...
> > > > Those who know binary and those who don't.
> > > > --
>
> > > > On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>
> > > > > Hi,
>
> > > > > I'm trying to get theiconfrom an apk file, but I found not every app
> > > > > use the theicon.png under res/, and androidmanifest.xml is compiled
> > > > > inside apk, where I can get the position information?
>
> > > > > Thx & BR,
> > > > > KK- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to call a function after taking snap from camera?? plz help

2009-10-15 Thread jbrohan

try http://code.google.com/p/android-playground-erdao/wiki/SnapFace
This is how I got my project like yours going. Basically there is a
callback after the picture is taken.
John

On Oct 14, 8:58 pm, wahib  wrote:
> Hi!! I am stuck with this issue. When i press a button in my custom
> app the built-in camera app executes but after taking snap i want to
> run my code on the image taken but the camera preview doesnt
> vanishes:S I just want to exit the preview and run my code. Being a
> newbie i am really confused how to do it.
>
> This is the code in onclick() function for button -
>
> Intent intent = new Intent();
> intent.setClassName
> ("com.android.camera",                "com.android.camera.Camera");
>                                 
> intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> startActivity(intent);
>
> myfunction() ;   ///what i want to call
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to call a function after taking snap from camera?? plz help

2009-10-15 Thread Chris

Have you tried using StartActivityForResult then calling the myfunction
() in an override of onActivityResult?

Chris.

On Oct 15, 1:58 am, wahib  wrote:
> Hi!! I am stuck with this issue. When i press a button in my custom
> app the built-in camera app executes but after taking snap i want to
> run my code on the image taken but the camera preview doesnt
> vanishes:S I just want to exit the preview and run my code. Being a
> newbie i am really confused how to do it.
>
> This is the code in onclick() function for button -
>
> Intent intent = new Intent();
> intent.setClassName
> ("com.android.camera",                "com.android.camera.Camera");
>                                 
> intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> startActivity(intent);
>
> myfunction() ;   ///what i want to call
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make a child activity?

2009-10-15 Thread vchris80

hi james, thanx for reply. I try to explain what I want to achieve.

It is actually very simple, but maybe I am walking on the wrong path
since I "think in the Windows way" other than in the "Android way" :)

My app is a window with 3 buttons (can't use tab since the buttons
will increase in the future and since this is a porting from other
platform and I have to follow the same UI guidelines as far as
possible). Each button launch an activity and needs a reference to the
main activity (parent) in order to use some common utility classes.

I thought to do so by implementing the main activity as an
ActivityGroup (thank to you first suggestion) and launch each child
activity by getLocalActivityManager().startActivity() as I said in the
previous post. But, as said, this doesn't update the screen with the
new activity view. I have to explicitly call setContentView and put
the child activity view (obtained by getDecorView()). Is this the
right way or am I doing a mess? Then, when I finish() the child I
restore the old view.





On 14 Ott, 20:50, James Yum  wrote:
> Hi,
> I'm still not sure what you're trying to achieve. Are you really trying to
> embed an activity within another? You can look at the TabActivity source for
> a pretty clean example:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> 
> Cheers,
> James
>
> On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:
>
> > thank for your reply, but I still have some troubles:
>
> > now I have my main activiy been a ActivityGroup and the child activity
> > been a simple Activity.
>
> > I start the child with this code:
>
> > Intent startIntent = new Intent(MyMainActivity.this,
> > ChildActivity.class);
> > getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> > startIntent);
>
> > this way, in the onCreate of the child activity, I can get the parent
> > and the activity results child of something by calling isChild()
> > method. Fine. But the screen actually doesn't appear. The
> > documentation of startActivity of LocalActivityManager says that "The
> > caller needs to take care of adding this window to a view hierarchy",
> > but I can't figure out how to do that. I watched the WindowManager for
> > a suitable method but with no luck.
>
> > On 13 Ott, 19:09, James Yum  wrote:
> > > Hi,
> > > Those are meant for an ActivityGroup and its embedded activities, for
> > > example a TabActivity.
>
> > > What you might want to look into, is this introduction on opening screens
> > > (activities):
>
> > >http://developer.android.com/guide/appendix/faq/commontasks.html#open...
>
> > > Cheers,
> > > James
>
> > > On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
>
> > > > Hi all, I have a simple question: how I make an activity that is child
> > > > of another?
>
> > > > I use this code to start an activity from another:
>
> > > > Intent startIntent = new Intent(MyMainActivity.this,
> > > > ChildActivity.class);
> > > > startActivity(startIntent);
>
> > > > but on the onCreate method of ChildActivity, if I watch for getParent
> > > > () I get null, and if I ask for isChild() I get false,... so what I
> > > > miss?
>
> > > > thank you
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make a child activity?

2009-10-14 Thread James Yum
Hi,
I'm still not sure what you're trying to achieve. Are you really trying to
embed an activity within another? You can look at the TabActivity source for
a pretty clean example:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/app/TabActivity.java;h=033fa0c8bf87b50f9400e457f64141d7ebad221a;hb=HEAD


Cheers,
James

On Wed, Oct 14, 2009 at 1:31 AM, vchris80  wrote:

>
> thank for your reply, but I still have some troubles:
>
> now I have my main activiy been a ActivityGroup and the child activity
> been a simple Activity.
>
> I start the child with this code:
>
> Intent startIntent = new Intent(MyMainActivity.this,
> ChildActivity.class);
> getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
> startIntent);
>
> this way, in the onCreate of the child activity, I can get the parent
> and the activity results child of something by calling isChild()
> method. Fine. But the screen actually doesn't appear. The
> documentation of startActivity of LocalActivityManager says that "The
> caller needs to take care of adding this window to a view hierarchy",
> but I can't figure out how to do that. I watched the WindowManager for
> a suitable method but with no luck.
>
> On 13 Ott, 19:09, James Yum  wrote:
> > Hi,
> > Those are meant for an ActivityGroup and its embedded activities, for
> > example a TabActivity.
> >
> > What you might want to look into, is this introduction on opening screens
> > (activities):
> >
> > http://developer.android.com/guide/appendix/faq/commontasks.html#open...
> >
> > Cheers,
> > James
> >
> > On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
> >
> > > Hi all, I have a simple question: how I make an activity that is child
> > > of another?
> >
> > > I use this code to start an activity from another:
> >
> > > Intent startIntent = new Intent(MyMainActivity.this,
> > > ChildActivity.class);
> > > startActivity(startIntent);
> >
> > > but on the onCreate method of ChildActivity, if I watch for getParent
> > > () I get null, and if I ask for isChild() I get false,... so what I
> > > miss?
> >
> > > thank you
> >
>

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



[android-beginners] Re: How to clean intermediary build files

2009-10-14 Thread Mark Murphy

Carl wrote:
> Hello all,
> 
> When I was building some source code there was an error with resource
> files. I fixed the problem, but when I try to build again the source
> code using the command line, the same error shows up.
> 
> I presume the builder is using the same intermediary files, made in
> the previous build, so I would like to ask how I can either clean the
> module in question (without cleaning all the modules) or, where can I
> find and delete the intermediary files generated by a previous build.

Project > Clean in Eclipse, or delete the contents of bin/ and gen/ in
your project, such as via this Ant target:










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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-beginners] Re: How to add a view to application layout programmatically

2009-10-14 Thread Alan Cassar
Title: Alan Cassar, Software Developer | Tel: +356 21334457 | Fax: +356
21
334156





The mistake is in the following lines of code: 

LinearLayout main = (LinearLayout)
AndroidTest.this.findViewById(R.layout.main);


Your layout is not called R.layout.main, that is a reference to the
whole layout file. Give the layout an id like so: 

"http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layout_main"			<-- add this line
>



Then call:
LinearLayout main = (LinearLayout)
AndroidTest.this.findViewById(R.id.layout_main);














Alan Cassar, Software
Engineer | Tel: +356 21334457 | Fax: +356 21 334156
ricston Ltd., Northfields Suite 4, Independence Avenue,
Mosta MST9026 - MALTA
email:  alan.cas...@ricston.com
| web:ricston.com

--
Disclaimer
- This email and any files transmitted with it are confidential and
contain
privileged or copyright information. You must not present this message
to
another party without first gaining permission from the sender. If you
are not
the intended recipient you must not copy, distribute or use this email
or the
information contained in it for any purpose other than to notify us. If
you
have received this message in error, please notify the sender
immediately and
delete this email from your system. We do not guarantee that this
material is
free from viruses or any other defects although due care has been taken
to minimise
the risk. Any views stated in this communication are those of the
actual sender
and not necessarily those of Ricston Ltd.
or its
subsidiaries.
 




Sven wrote:

  Hi Justin,

my main.xml looks as follows:


"http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>





I'd really like to get around having to declare a separate imageView
in the XML layout. Isn't there a way of instantiating such an object
by hand and adding it to the application's layout at runtime?

Best,

Sven

On Oct 13, 5:28 am, Justin Anderson  wrote:
  
  
What does the XML for your res/layout/main.xml look like?

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--

On Mon, Oct 12, 2009 at 9:28 AM, Sven  wrote:



  Hi,
  


  I want to add an ImageView to my layout when a button has been
pressed. Sadly, I cannot get a handle to the main application's
linearlayout, I always get a null pointer error when trying to
retrieve the layout using findViewByID.
  


  Here's the code that ought to display the image when button b has been
pressed, but I think I have missed something obious:
  


  package com.foo.bar;
  


  import android.app.*;
import android.os.Bundle;
import android.view.*;
import android.view.ViewGroup.LayoutParams;
import android.widget.*;
import android.content.*;
import android.util.Log;
  


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


      // assign flag.png to the button, loading correct flag image for
current locale
       Button b;
       b = (Button)findViewById
(R.id.flag_button) ;//.setBackgroundDrawable(this.getResources
().getDrawable(R.drawable.developers));
  


         // build dialog box to display when user clicks the flag
       AlertDialog.Builder builder = new AlertDialog.Builder(this);
       builder.setMessage(R.string.dialog_text)
           .setCancelable(false)
           .setTitle(R.string.dialog_title)
           .setPositiveButton("Done", new
DialogInterface.OnClickListener() {
               public void onClick(DialogInterface dialog, int id) {
               dialog.dismiss();
               }
           });
       final AlertDialog alert = builder.create();
  


         // set click listener on the flag to show the dialog box
       b.setOnClickListener(new View.OnClickListener() {
           public void onClick(View v) {
               // alert.show();
               ImageView image;
               image = new ImageView(v.getContext());
               image.setImageDrawable(v.getResources().getDrawable
(R.drawable.developers));
  


                 LinearLayout main = (LinearLayout)
AndroidTest.this.findViewById(R.layout.main);
               // some debug code
               if (main == null)
               {
                       Log.v("abc", "Main is null");
                       }
               else
               {
               mai

[android-beginners] Re: How to add a view to application layout programmatically

2009-10-14 Thread Sven

Hi Justin,

my main.xml looks as follows:


http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>





I'd really like to get around having to declare a separate imageView
in the XML layout. Isn't there a way of instantiating such an object
by hand and adding it to the application's layout at runtime?

Best,

Sven

On Oct 13, 5:28 am, Justin Anderson  wrote:
> What does the XML for your res/layout/main.xml look like?
>
> Thanks,
> Justin
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
> On Mon, Oct 12, 2009 at 9:28 AM, Sven  wrote:
>
> > Hi,
>
> > I want to add an ImageView to my layout when a button has been
> > pressed. Sadly, I cannot get a handle to the main application's
> > linearlayout, I always get a null pointer error when trying to
> > retrieve the layout using findViewByID.
>
> > Here's the code that ought to display the image when button b has been
> > pressed, but I think I have missed something obious:
>
> > package com.foo.bar;
>
> > import android.app.*;
> > import android.os.Bundle;
> > import android.view.*;
> > import android.view.ViewGroup.LayoutParams;
> > import android.widget.*;
> > import android.content.*;
> > import android.util.Log;
>
> > public class AndroidTest extends Activity {
> >    /** Called when the activity is first created. */
> >   �...@override
> >    public void onCreate(Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.main);
>
> >     // assign flag.png to the button, loading correct flag image for
> > current locale
> >        Button b;
> >        b = (Button)findViewById
> > (R.id.flag_button) ;//.setBackgroundDrawable(this.getResources
> > ().getDrawable(R.drawable.developers));
>
> >        // build dialog box to display when user clicks the flag
> >        AlertDialog.Builder builder = new AlertDialog.Builder(this);
> >        builder.setMessage(R.string.dialog_text)
> >            .setCancelable(false)
> >            .setTitle(R.string.dialog_title)
> >            .setPositiveButton("Done", new
> > DialogInterface.OnClickListener() {
> >                public void onClick(DialogInterface dialog, int id) {
> >                dialog.dismiss();
> >                }
> >            });
> >        final AlertDialog alert = builder.create();
>
> >        // set click listener on the flag to show the dialog box
> >        b.setOnClickListener(new View.OnClickListener() {
> >            public void onClick(View v) {
> >                // alert.show();
> >                ImageView image;
> >                image = new ImageView(v.getContext());
> >                image.setImageDrawable(v.getResources().getDrawable
> > (R.drawable.developers));
>
> >                LinearLayout main = (LinearLayout)
> > AndroidTest.this.findViewById(R.layout.main);
> >                // some debug code
> >                if (main == null)
> >                {
> >                        Log.v("abc", "Main is null");
> >                        }
> >                else
> >                {
> >                main.addView(image, 200, 200);
> >                }
> >            }
> >            });
>
> >    }
> > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make a child activity?

2009-10-14 Thread vchris80

thank for your reply, but I still have some troubles:

now I have my main activiy been a ActivityGroup and the child activity
been a simple Activity.

I start the child with this code:

Intent startIntent = new Intent(MyMainActivity.this,
ChildActivity.class);
getLocalActivityManager().startActivity("and.mypackage.ChildActivity",
startIntent);

this way, in the onCreate of the child activity, I can get the parent
and the activity results child of something by calling isChild()
method. Fine. But the screen actually doesn't appear. The
documentation of startActivity of LocalActivityManager says that "The
caller needs to take care of adding this window to a view hierarchy",
but I can't figure out how to do that. I watched the WindowManager for
a suitable method but with no luck.

On 13 Ott, 19:09, James Yum  wrote:
> Hi,
> Those are meant for an ActivityGroup and its embedded activities, for
> example a TabActivity.
>
> What you might want to look into, is this introduction on opening screens
> (activities):
>
> http://developer.android.com/guide/appendix/faq/commontasks.html#open...
>
> Cheers,
> James
>
> On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:
>
> > Hi all, I have a simple question: how I make an activity that is child
> > of another?
>
> > I use this code to start an activity from another:
>
> > Intent startIntent = new Intent(MyMainActivity.this,
> > ChildActivity.class);
> > startActivity(startIntent);
>
> > but on the onCreate method of ChildActivity, if I watch for getParent
> > () I get null, and if I ask for isChild() I get false,... so what I
> > miss?
>
> > thank you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to display List in homescreen app widget ?

2009-10-13 Thread Justin Anderson
AFAIK, you can only use views supported by RemoteViews.  You might consider
using a live folder (not sure if that is exactly what it is called but that
is what Docs To Go calls it) instead, since that allows you to display a
list when you open the folder.

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Oct 13, 2009 at 3:36 PM, Harshit Mapara  wrote:

>
> Hi,
>
> I can't find how to display a list in the app widget.
>
> I have created one app-widget which fetches the database table
> information and I want to display all the icon:text into app-widget.
> Remoteviews doesn't have any list functionality.
>
> How can I do it, please help
>
> Thanks
> Harshit
> >
>

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



[android-beginners] Re: How to add external jar without Eclipse?

2009-10-13 Thread jotobjects

use "android create project" to create the build script and directory
tree and put your jar files in the libs directory that is created.
The ant script will package the classes in your jars with the
application. One thing to watch out for is whether any of your jared
classes have dependencies (such as J2SE classes that are not part of
the Android runtime).

On Oct 13, 3:01 am, kitfox  wrote:
> I'm trying to port an application in J2SE to Andriod (which I am just
> learning).  My application is broken into several jars.  I'm using the
> NetBeans Andriod API, not Eclipse, so I will probably have to do any
> jar wranging the hard way.
>
> I have access to all the sources I need and right now have build
> scripts for all of them that produce J2SE code.  What would I need to
> do to make Android jars?  How would I include them in my Android
> application when I build it?  Do they become part of the apk, or do I
> need to ship them separately?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make a child activity?

2009-10-13 Thread James Yum
Hi,
Those are meant for an ActivityGroup and its embedded activities, for
example a TabActivity.

What you might want to look into, is this introduction on opening screens
(activities):

http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen

Cheers,
James

On Tue, Oct 13, 2009 at 7:25 AM, vchris80  wrote:

>
> Hi all, I have a simple question: how I make an activity that is child
> of another?
>
> I use this code to start an activity from another:
>
> Intent startIntent = new Intent(MyMainActivity.this,
> ChildActivity.class);
> startActivity(startIntent);
>
> but on the onCreate method of ChildActivity, if I watch for getParent
> () I get null, and if I ask for isChild() I get false,... so what I
> miss?
>
> thank you
>
> >
>

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



[android-beginners] Re: How to add a view to application layout programmatically

2009-10-12 Thread Justin Anderson
What does the XML for your res/layout/main.xml look like?

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Mon, Oct 12, 2009 at 9:28 AM, Sven  wrote:

>
> Hi,
>
>
> I want to add an ImageView to my layout when a button has been
> pressed. Sadly, I cannot get a handle to the main application's
> linearlayout, I always get a null pointer error when trying to
> retrieve the layout using findViewByID.
>
> Here's the code that ought to display the image when button b has been
> pressed, but I think I have missed something obious:
>
> package com.foo.bar;
>
> import android.app.*;
> import android.os.Bundle;
> import android.view.*;
> import android.view.ViewGroup.LayoutParams;
> import android.widget.*;
> import android.content.*;
> import android.util.Log;
>
>
> public class AndroidTest extends Activity {
>/** Called when the activity is first created. */
>@Override
>public void onCreate(Bundle savedInstanceState) {
>super.onCreate(savedInstanceState);
>setContentView(R.layout.main);
>
> // assign flag.png to the button, loading correct flag image for
> current locale
>Button b;
>b = (Button)findViewById
> (R.id.flag_button) ;//.setBackgroundDrawable(this.getResources
> ().getDrawable(R.drawable.developers));
>
>// build dialog box to display when user clicks the flag
>AlertDialog.Builder builder = new AlertDialog.Builder(this);
>builder.setMessage(R.string.dialog_text)
>.setCancelable(false)
>.setTitle(R.string.dialog_title)
>.setPositiveButton("Done", new
> DialogInterface.OnClickListener() {
>public void onClick(DialogInterface dialog, int id) {
>dialog.dismiss();
>}
>});
>final AlertDialog alert = builder.create();
>
>// set click listener on the flag to show the dialog box
>b.setOnClickListener(new View.OnClickListener() {
>public void onClick(View v) {
>// alert.show();
>ImageView image;
>image = new ImageView(v.getContext());
>image.setImageDrawable(v.getResources().getDrawable
> (R.drawable.developers));
>
>
>LinearLayout main = (LinearLayout)
> AndroidTest.this.findViewById(R.layout.main);
>// some debug code
>if (main == null)
>{
>Log.v("abc", "Main is null");
>}
>else
>{
>main.addView(image, 200, 200);
>}
>}
>});
>
>}
> }
>
> >
>

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



[android-beginners] Re: how to drop call???

2009-10-12 Thread Roman ( T-Mobile USA)

Could you rephrase your question?

If you want to drop programmatically a call, you cannot do this
"officially" with the Android SDK.

If you try to get the duration of a call, try to capture Call state
changes.

--
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 Oct 12, 8:27 am, midoub  wrote:
> Hi,
> I want to fix duration of call, someone have ideas how I can do
> This???
>
> Thanks for your help.
>
> Regards,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to hide activity from menu?

2009-10-12 Thread f...@r@0n


Yeah, removing LAUNCHER category works fine. This is what I need.

Such kind of things always happen when copy-paste code without clear
understanding what you are doing. Will try to avoid this in future :)

Thanks again!

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



[android-beginners] Re: How to modify the default Android splash screen in source code?

2009-10-11 Thread sp...@droidshow

This might help ...
http://www.ryebrye.com/blog/2008/12/08/replacing-the-splash-screen-on-a-t-mobile-g1-dev-phone/


On Oct 9, 3:46 pm, smallzz  wrote:
> Hi...
>
> I want to have my image as the splash image instead of the default
> Android splash image.
> Could someone advise how to customise the default android splash
> screen in the source code?
> Is it true that I need to change initlogo.rle? If yes, how to do that?
>
> Thank you in advance... :)
>
> Cheers,
> Smallzz
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to hide activity from menu?

2009-10-11 Thread Mark Murphy

f...@r@0n wrote:
> 
> Hello guys,
> 
> Does anybody know how to hide activity icon from menu? I am trying to
> write simple multiview application. So, I have two activities there,
> the first (main) activity starts the second one. However, my second
> activity icon is visible in installed apps menu grid and can be
> started from menu as separate standalone app :)
> Is there any special activity tag I can use in manifest to hide icon?

In the AndroidManifest.xml file, both of your activities probably have
an  element that looks like:






That tells Android to put an icon in the Launcher for that activity.
Remove that  from any activity that is not supposed to be
in the Launcher.

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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-beginners] Re: how to load the related Bitmap according to input

2009-10-10 Thread 天地间有我在行走
Thanks for your quick reply. Sounds like a good way for both of your solutions. 
Yes, I just tried to find a temporary solution:
int rid = 0x7f02 + input; 
 
Not sure if it is transplantable?




在2009-10-07,"Balwinder Kaur (T-Mobile USA)"  写道:
>
>int rid = getResources().getIdentifier("pic_" + input, "drawable",
>"your_package_name");
>Drawable d = getResources().getDrawable(rid);
>
>You may check out the file MBellishClipartSelector.java   from
>http://codecamp.pbworks.com/EmbellishYourPictures-BuildanApplicationforanAndroidPhone-2009
>
>Balwinder Kaur
>Mobile.Software.Development
>·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 Oct 7, 4:14?am, I82Much  wrote:
>> I suppose you could also do something like
>>
>> int[] iconRefs = {
>> ? ? R.drawable.pic_1,
>> ? ? ...
>> ? ? R.drawable.pic_n
>>
>> }
>>
>> if (input >= 0 && input < n) {
>> ? ? // Account for 0 based indexing
>> ? ? return iconRefs[input - 1];
>>
>> }
>>
>> This code gets the reference out (I might be wrong in how you
>> reference it, maybe R.res.drawable, don't have my eclipse handy);
>> you'd have to use the standard way of actually getting that drawable
>> image.
>>
>> On Oct 5, 11:08?pm, wine  wrote:
>>
>> > hi,
>>
>> > I have met an issue.
>> > There are some pics in the res/drawable named as pic_1.png, pic_2.png,
>> > pic_3.png, pic_4.png I want to load someone according to the
>> > input.
>> > For instance, if I input 2, I want to load pic_2.png. If input 3, will
>> > load the pic_3.png
>> > How to achieve? Need your expert help here...
>>

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



[android-beginners] Re: How to get resource path?

2009-10-10 Thread Kevin Grant

mediaplayer mp = new mediaplayer();
mp.getResources().openRawResources(myfilename);
mp.start();
mp.stop();

On Oct 9, 7:08 pm, abhi  wrote:
> Thank you, Balwinder. But I just have a string for the name of the
> song and so, its not possible to get the ID for it using: .
>
> Please find my code below:
>
> String songFile =  "NameOfSong.mp3";
> MediaPlayer mp = new MediaPlayer(songFile); //This is not working
> since I don't have the entire path to the music file which is stored
> inside the .APK file
>
> Maybe I am using a wrong approach here.
>
> On Oct 8, 10:32 am, "Balwinder Kaur (T-Mobile USA)" 
>
>
> mobile.com> wrote:
> > getResources().openRawResourceFd(int id)
>
> > Get the FileDescriptor for the file and use MediaPlayer.setDataSource
> > (FileDescriptor fd) method.
>
> > Balwinder Kaur
> > Mobile.Software.Development
> > ·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 Oct 8, 12:55 am, abhi  wrote:
>
> > > Hi,
>
> > > I have included three MP3 file in the R.raw folder. Now I am able to
> > > get the file name of the MP3 file, but I need to find out the complete
> > > path of the file in order to play the file using MediaPlayer.
>
> > > I am using MediaPlayer.setDataSource(String path) to set the path to
> > > the file. When I set the path as just the file name, the MediaPlayer
> > > does not play it.
>
> > > Is there any way to get the full path of the MP3 file in resources? Or
> > > else, can I  use some other implementation of MediaPlayer.setDataSource
> > > ()?
>
> > > Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to get resource path?

2009-10-09 Thread abhi

Thank you, Balwinder. But I just have a string for the name of the
song and so, its not possible to get the ID for it using: .

Please find my code below:

String songFile =  "NameOfSong.mp3";
MediaPlayer mp = new MediaPlayer(songFile); //This is not working
since I don't have the entire path to the music file which is stored
inside the .APK file

Maybe I am using a wrong approach here.



On Oct 8, 10:32 am, "Balwinder Kaur (T-Mobile USA)"  wrote:
> getResources().openRawResourceFd(int id)
>
> Get the FileDescriptor for the file and use MediaPlayer.setDataSource
> (FileDescriptor fd) method.
>
> Balwinder Kaur
> Mobile.Software.Development
> ·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 Oct 8, 12:55 am, abhi  wrote:
>
> > Hi,
>
> > I have included three MP3 file in the R.raw folder. Now I am able to
> > get the file name of the MP3 file, but I need to find out the complete
> > path of the file in order to play the file using MediaPlayer.
>
> > I am using MediaPlayer.setDataSource(String path) to set the path to
> > the file. When I set the path as just the file name, the MediaPlayer
> > does not play it.
>
> > Is there any way to get the full path of the MP3 file in resources? Or
> > else, can I  use some other implementation of MediaPlayer.setDataSource
> > ()?
>
> > Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to use the Network Manager?

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

Based on your preferred interface list, I would first do a scan on
Wifi. Look for open Wifi networks to connect without security codes.
Otherwise open a dialog that the user can enter the security
information for the secured network.

If no Wifi network is available turn off Wifi which automatically
triggers to connect to cellular data. Have a broadcast receiver
implemented to check for network changes. When you receive a network
change you can use the code below to find out what your actual network
is.

To find out about your current connection:

ConnectivityManager connection =  (ConnectivityManager)
mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connection.getActiveNetworkInfo();
Log.d(TAG,"type:"+networkInfo.getTypeName());

To connect to a wifi network you have to create a WifiConfiguration.
After adding your configuration to the WifiMgr with

   mWifiMgr.addNetwork(wifiConfiguration);

you can connect to the network with

boolean successConnected = mWifiMgr.enableNetwork(inetId, true);

In your broadcast receiver you should receive an intent about the
network status change.

--
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 Oct 8, 3:29 am, Gautam Tripathi  wrote:
> I need to connect my device to the network.
> I have a preference order of Wifi/GPRS/dial-up modem in sequence.
> How do I go about it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to use the Network Manager?

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

Based on your preferred interface list, I would first do a scan on
Wifi. Look for open Wifi networks to connect without security codes.
Otherwise open a dialog that the user can enter the security
information for the secured network.

If no Wifi network is available turn off Wifi which automatically
triggers to connect to cellular data. Have a broadcast receiver
implemented to check for network changes. When you receive a network
change you the code below to find out what your actual network is.


To find out about what your current connection is do

ConnectivityManager connection =  (ConnectivityManager)
mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connection.getActiveNetworkInfo();
Log.d(TAG,"type:"+networkInfo.getTypeName());

To connect to a wifi network you have to create a WifiConfiguration.
After adding your configuration to the WifiMgr with

   mWifiMgr.addNetwork(wifiConfiguration);

You can connect to the network with

boolean successConnected = mWifiMgr.enableNetwork(inetId, true);


In your broadcast receiver you should receive an intent about the
network status change.

--
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 Oct 8, 3:29 am, Gautam Tripathi  wrote:
> I need to connect my device to the network.
> I have a preference order of Wifi/GPRS/dial-up modem in sequence.
> How do I go about it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to access the files on SD card through emulator?

2009-10-08 Thread Jason Van Anden

Instructions here:

http://developer.android.com/guide/developing/tools/emulator.html#diskimages

j

On Thu, Oct 8, 2009 at 8:46 AM, Abhi  wrote:
>
> Hi,
>      I need to search for certain type of files (like .mp3) and
> populate the list of files present in that particular category from
> the SD card. Can anyone help me with this?
>
> -Regards Abhi.
>
> >
>

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



[android-beginners] Re: How to get resource path?

2009-10-08 Thread Balwinder Kaur (T-Mobile USA)

getResources().openRawResourceFd(int id)

Get the FileDescriptor for the file and use MediaPlayer.setDataSource
(FileDescriptor fd) method.

Balwinder Kaur
Mobile.Software.Development
·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 Oct 8, 12:55 am, abhi  wrote:
> Hi,
>
> I have included three MP3 file in the R.raw folder. Now I am able to
> get the file name of the MP3 file, but I need to find out the complete
> path of the file in order to play the file using MediaPlayer.
>
> I am using MediaPlayer.setDataSource(String path) to set the path to
> the file. When I set the path as just the file name, the MediaPlayer
> does not play it.
>
> Is there any way to get the full path of the MP3 file in resources? Or
> else, can I  use some other implementation of MediaPlayer.setDataSource
> ()?
>
> Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to find permissions required

2009-10-08 Thread sDroid

The hint for needing permission in the manifest is whenever using
system calls. I agree w/ you that missing the documentation in the SDK
for required permission at class level make it less useful or just
plain annoying.

On Oct 8, 4:13 am, Chris  wrote:
> I am trying to see if some of the classes I am using require any
> permissions to be set on the manifest.  How can I tell if a given
> Class requires a permission.  Example I know PowerManager.WakeLock
> needs the WAKE_LOCK permission but the documentation on
> PowerManager.WakeLock makes no reference to any permissions required.
> How would I have found this with out the example code I found telling
> me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to find permissions required

2009-10-08 Thread Chris

I take it this would need to be done on a real device not the
emulator?

On Oct 8, 10:38 am, jbrohan  wrote:
> I've found that there is an error reported in the logcat which is
> quite clear about a missing permission. Just keep going and look at
> the logcat output.
> John
>
> On Oct 8, 5:13 am, Chris  wrote:
>
> > I am trying to see if some of the classes I am using require any
> > permissions to be set on the manifest.  How can I tell if a given
> > Class requires a permission.  Example I know PowerManager.WakeLock
> > needs the WAKE_LOCK permission but the documentation on
> > PowerManager.WakeLock makes no reference to any permissions required.
> > How would I have found this with out the example code I found telling
> > me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to find permissions required

2009-10-08 Thread jbrohan

I've found that there is an error reported in the logcat which is
quite clear about a missing permission. Just keep going and look at
the logcat output.
John

On Oct 8, 5:13 am, Chris  wrote:
> I am trying to see if some of the classes I am using require any
> permissions to be set on the manifest.  How can I tell if a given
> Class requires a permission.  Example I know PowerManager.WakeLock
> needs the WAKE_LOCK permission but the documentation on
> PowerManager.WakeLock makes no reference to any permissions required.
> How would I have found this with out the example code I found telling
> me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-07 Thread KK

Hi,

I found the path is stored in resources.arsc, but where to indicates
the index?

BR,
KK

On Oct 7, 11:48 am, KK  wrote:
> Sorry, I'm NOT using android API
>
> On Oct 7, 11:40 am, KK  wrote:
>
>
>
> > Actually I'm doing a shell extension for windows, showing the icon of
> > apk files in windows, isn't it a good idea? :D
> > so I want to know where the icon located in apk file, and I'm using
> > android API...
>
> > Thanks for your tip, at least I can go and see the source code of
> > packagemanager..
>
> > BR,
> > KK
>
> > On Oct 7, 2:58 am, Justin Anderson  wrote:
>
> > > What exactly are you trying to do with this icon?
>
> > > You can get the icon of an installed application on your phone via
> > > PackageManager.getActivityIcon() or PackageManager.getApplicationIcon().
>
> > >http://developer.android.com/reference/android/content/pm/PackageMana...
>
> > > Thanks,
> > > Justin
>
> > > --
> > > There are only 10 types of people in the world...
> > > Those who know binary and those who don't.
> > > --
>
> > > On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>
> > > > Hi,
>
> > > > I'm trying to get the icon from an apk file, but I found not every app
> > > > use the the icon.png under res/, and androidmanifest.xml is compiled
> > > > inside apk, where I can get the position information?
>
> > > > Thx & BR,
> > > > KK- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to load the related Bitmap according to input

2009-10-07 Thread Balwinder Kaur (T-Mobile USA)

int rid = getResources().getIdentifier("pic_" + input, "drawable",
"your_package_name");
Drawable d = getResources().getDrawable(rid);

You may check out the file MBellishClipartSelector.java   from
http://codecamp.pbworks.com/EmbellishYourPictures-BuildanApplicationforanAndroidPhone-2009

Balwinder Kaur
Mobile.Software.Development
·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 Oct 7, 4:14 am, I82Much  wrote:
> I suppose you could also do something like
>
> int[] iconRefs = {
>     R.drawable.pic_1,
>     ...
>     R.drawable.pic_n
>
> }
>
> if (input >= 0 && input < n) {
>     // Account for 0 based indexing
>     return iconRefs[input - 1];
>
> }
>
> This code gets the reference out (I might be wrong in how you
> reference it, maybe R.res.drawable, don't have my eclipse handy);
> you'd have to use the standard way of actually getting that drawable
> image.
>
> On Oct 5, 11:08 pm, wine  wrote:
>
> > hi,
>
> > I have met an issue.
> > There are some pics in the res/drawable named as pic_1.png, pic_2.png,
> > pic_3.png, pic_4.png I want to load someone according to the
> > input.
> > For instance, if I input 2, I want to load pic_2.png. If input 3, will
> > load the pic_3.png
> > How to achieve? Need your expert help here...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to remove/hide the notification bar?

2009-10-07 Thread Mark Murphy

> Solution:
> http://www.androidsnippets.org/snippets/27/

Be sure to scroll down on that page: using
android:theme="@android:style/Theme.NoTitleBar.Fullscreen", as mentioned
in a comment, is a better solution.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-beginners] Re: how to load the related Bitmap according to input

2009-10-07 Thread I82Much

I suppose you could also do something like

int[] iconRefs = {
R.drawable.pic_1,
...
R.drawable.pic_n
}

if (input >= 0 && input < n) {
// Account for 0 based indexing
return iconRefs[input - 1];
}

This code gets the reference out (I might be wrong in how you
reference it, maybe R.res.drawable, don't have my eclipse handy);
you'd have to use the standard way of actually getting that drawable
image.

On Oct 5, 11:08 pm, wine  wrote:
> hi,
>
> I have met an issue.
> There are some pics in the res/drawable named as pic_1.png, pic_2.png,
> pic_3.png, pic_4.png I want to load someone according to the
> input.
> For instance, if I input 2, I want to load pic_2.png. If input 3, will
> load the pic_3.png
> How to achieve? Need your expert help here...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to load the related Bitmap according to input

2009-10-07 Thread I82Much

I take it you're looking for something a little more scalable than the
naive solution:

switch (input) {
case 1:
return R.drawable.pic_1;
. . .
case n:
return R.drawable.pic_n;
}

I see the problem; you need to append an arbitrary number to the end
of a string, and then turn that into the R.drawable. ___ reference.
I'm stumped

On Oct 5, 11:08 pm, wine  wrote:
> hi,
>
> I have met an issue.
> There are some pics in the res/drawable named as pic_1.png, pic_2.png,
> pic_3.png, pic_4.png I want to load someone according to the
> input.
> For instance, if I input 2, I want to load pic_2.png. If input 3, will
> load the pic_3.png
> How to achieve? Need your expert help here...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to remove/hide the notification bar?

2009-10-07 Thread Luis Estrada

Solution:
http://www.androidsnippets.org/snippets/27/

On Oct 5, 2:57 pm, Luis Estrada  wrote:
> How to remove/hide the notification bar?
>
> I am trying to run a GLSurfaceView in full screen but the notification
> bar is in the way.
>
> Thanks,
>
> Luis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-06 Thread KK

Sorry, I'm NOT using android API

On Oct 7, 11:40 am, KK  wrote:
> Actually I'm doing a shell extension for windows, showing the icon of
> apk files in windows, isn't it a good idea? :D
> so I want to know where the icon located in apk file, and I'm using
> android API...
>
> Thanks for your tip, at least I can go and see the source code of
> packagemanager..
>
> BR,
> KK
>
> On Oct 7, 2:58 am, Justin Anderson  wrote:
>
>
>
> > What exactly are you trying to do with this icon?
>
> > You can get the icon of an installed application on your phone via
> > PackageManager.getActivityIcon() or PackageManager.getApplicationIcon().
>
> >http://developer.android.com/reference/android/content/pm/PackageMana...
>
> > Thanks,
> > Justin
>
> > --
> > There are only 10 types of people in the world...
> > Those who know binary and those who don't.
> > --
>
> > On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>
> > > Hi,
>
> > > I'm trying to get the icon from an apk file, but I found not every app
> > > use the the icon.png under res/, and androidmanifest.xml is compiled
> > > inside apk, where I can get the position information?
>
> > > Thx & BR,
> > > KK- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-06 Thread KK

Actually I'm doing a shell extension for windows, showing the icon of
apk files in windows, isn't it a good idea? :D
so I want to know where the icon located in apk file, and I'm using
android API...

Thanks for your tip, at least I can go and see the source code of
packagemanager..

BR,
KK

On Oct 7, 2:58 am, Justin Anderson  wrote:
> What exactly are you trying to do with this icon?
>
> You can get the icon of an installed application on your phone via
> PackageManager.getActivityIcon() or PackageManager.getApplicationIcon().
>
> http://developer.android.com/reference/android/content/pm/PackageMana...
>
> Thanks,
> Justin
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
>
> On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:
>
> > Hi,
>
> > I'm trying to get the icon from an apk file, but I found not every app
> > use the the icon.png under res/, and androidmanifest.xml is compiled
> > inside apk, where I can get the position information?
>
> > Thx & BR,
> > KK- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to extract ICON from an APK file?

2009-10-06 Thread Justin Anderson
What exactly are you trying to do with this icon?

You can get the icon of an installed application on your phone via
PackageManager.getActivityIcon() or PackageManager.getApplicationIcon().

http://developer.android.com/reference/android/content/pm/PackageManager.html

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Oct 6, 2009 at 12:50 AM, KK  wrote:

>
> Hi,
>
> I'm trying to get the icon from an apk file, but I found not every app
> use the the icon.png under res/, and androidmanifest.xml is compiled
> inside apk, where I can get the position information?
>
> Thx & BR,
> KK
>
> >
>

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



[android-beginners] Re: how to keep an application awake

2009-10-06 Thread James Yum
Hi Martin,
http://developer.android.com/reference/android/os/PowerManager.html

Please
note this warning:

*"Device battery life will be significantly affected by the use of this API.
* Do not acquire WakeLocks unless you really need them, use the minimum
levels possible, and be sure to release it as soon as you can."

And I do think you'll want to use a Service.

Cheers,
James

On Tue, Oct 6, 2009 at 7:16 AM, martin  wrote:

>
> Hi
>
> I try to develope a fitness application (with music playing and
> showing the training time), everthing works fine until the phone goes
> into the sleep mode. How can i keep the application (and of course the
> phone) awake? Solve this by using a service is probably not useful
> cause it's a interval training app and i think the user wants always
> to now how much time he has left in the current sequence.
>
> Thx'n'Grz
> Martin
>
> >
>

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



[android-beginners] Re: How to remove/hide the notification bar?

2009-10-06 Thread Justin Anderson
A quick google search and I found this:

http://tinyurl.com/yay4xhf

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Mon, Oct 5, 2009 at 12:57 PM, Luis Estrada wrote:

>
> How to remove/hide the notification bar?
>
> I am trying to run a GLSurfaceView in full screen but the notification
> bar is in the way.
>
> Thanks,
>
> Luis
>
> >
>

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



[android-beginners] Re: How to set button background color?

2009-10-05 Thread Mark Murphy

> The default button background is not a color, but rather a 9-patch png
> image.  Your best bet would be to create a similar 9-patch png image in
> your
> favorite image editing software that has a red background.

It's not even just a 9-patch. It is a StateListDrawable of many 9-patch
images (regular, pressed, focused, selected, disabled, etc.).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-beginners] Re: How to set button background color?

2009-10-05 Thread Justin Anderson
The default button background is not a color, but rather a 9-patch png
image.  Your best bet would be to create a similar 9-patch png image in your
favorite image editing software that has a red background.

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Sun, Oct 4, 2009 at 7:33 PM, Nicholas Key
wrote:

>
> Hi group members,
>
> I have a question about setting the background color for buttons.
> When I am using btn.setBackgroundColor(Color.RED), the entire button
> turns into a red rectangle.
>
> Is there actually a workaround to achieve this?
>
> Also what can I do to revert back to the default color of the button
> (the typical plain greysh background).
>
> Thanks,
>
> Nicholas
>
> >
>

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



[android-beginners] Re: How to receive an incoming call programmatically?

2009-10-05 Thread Yusuf Saib (T-Mobile USA)

Sorry, no.



Yusuf Saib
Android
·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 Oct 2, 10:47 pm, Nemat  wrote:
> I mean when we have an incoming call,phone should not be notified and
> call should be received automatically
>
> On Oct 1, 11:47 am, naG  wrote:
>
>
>
> > can you explain it more...
>
> > On Sep 30, 4:12 am, Nemat  wrote:
>
> > > is it possible to intercept an incoming call?
>
> > > I want my application to receive the call automatically through
> > > programming.Can we do this in SDK-1.6?
>
> > > Thanks
> > > Nemat- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-04 Thread Alexander Kazanin

Now I see. I will suggest a following solution. Suppose we have an
activity. Lets create a handler. Than add to our "channel up" button
View.OnTouchListener. Each time user presses the button, we will
increase channel number and send a message to handler with FIRST_DELAY
delay time. And when user releases button we will tell handler to
dispose all of the queued messages. Handler, on it's part, will
receive a message, increase channel, and send a message to itself with
delay CONT_DELAY. Generally this two delays can be the same, but I
think user will be more comfortable if automatic channel switching
starts in a while, not immediatly. So this piece of mind above can be
expressed in the following code:

public class ChannelSwitcherActivity extends Activity
{
private static final long FIRST_DELAY = 500;
private static final long CONT_DELAY = 200;

private static final int MESSAGE_INCREASE_CHANNEL = 1;

private Handler switchHandler = new Handler()
{
@Override
public void handleMessage(Message message)
{
if( MESSAGE_INCREASE_CHANNEL == message.what )
{
channelUp();
sendEmptyMessageDelayed( 
MESSAGE_INCREASE_CHANNEL, CONT_DELAY);
}
}
};

@Override
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);

final Button btn = (Button)findViewById( R.id.channel_up_btn);
btn.setOnTouchListener( new View.OnTouchListener()
{
public boolean onTouch(View view, MotionEvent event)
{
if( view instanceof Button )
{
if( MotionEvent.ACTION_DOWN == 
event.getAction() )
{
channelUp();

switchHandler.sendEmptyMessageDelayed( MESSAGE_INCREASE_CHANNEL,
FIRST_DELAY);
return true;
}
else if( MotionEvent.ACTION_UP == 
event.getAction() )
{
switchHandler.removeMessages( 
MESSAGE_INCREASE_CHANNEL);
return true;
}
}
return false;
}
});
}

private void channelUp()
{
//this is where you place your logic to increase channel by one
position
}
}

Hope this helps.

~
Regards,
Alexander Kazanin
http://sites.google.com/site/piggybanksoftwarehomepage

On Oct 4, 7:49 am, Shude Zheng  wrote:
> Hi, Alexander,
>
> Thank you. I have not describe the question clearly.
>
> I want change the channel by pressing button. But press button once and the
> callback is called once. The channel only one channel up. But I want to
> change more channels. So I press the button and hold it. The callback will
> call a function change_channel(1). This function will increase the channel
> for every 0.2s. When user release the button the button state is changed
> again so the callback will kill the change_channel(0) and stop the channel
> change.
>
> I found OnFocusChangeListener did not work for pressing and hold of button.
> It only works when cursor moving by direction key.
>
> Shude
>
> On Fri, Oct 2, 2009 at 4:25 AM, Alexander Kazanin <
>
> alexander.kaza...@gmail.com> wrote:
>
> > Hi.
>
> > If I understood your intentions correctly you should set
> > OnLongClickListener.
> > Button button = (Button) findViewById(R.id.*channel_up*);
>
> > button.setOnFocusChangeListener(new View.OnLongClickListener()
> >                        {
> >                                public boolean onLongClick(View view)
> >                                {
> >                                        return false;
> >                                }
> >                        });
>
> > method onLongClick in this anonymous class will be called when user
> > presses and holds "cannnel_up" button for about 2 seconds
>
> > On 2 окт, 03:08, Shude Zheng  wrote:
> > > I want to add some code when user press and hold the button. I try use
> > > change the focus function. I wrote the similar code like onClick. But it
> > was
> > > never called when I moved curer to button and it was focused.
>
> > > Button button = (Button) findViewById(R.id.*channel_up*);
>
> > > button.setOnFocusChangeListener(*new* Button.OnFocusChangeListener() {
>
> > > *public* *void* onFocusChange(View v, *boolean* hasFocus) {
>
> > > }
>
>

[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-03 Thread Shude Zheng
Hi, Alexander,

Thank you. I have not describe the question clearly.

I want change the channel by pressing button. But press button once and the
callback is called once. The channel only one channel up. But I want to
change more channels. So I press the button and hold it. The callback will
call a function change_channel(1). This function will increase the channel
for every 0.2s. When user release the button the button state is changed
again so the callback will kill the change_channel(0) and stop the channel
change.

I found OnFocusChangeListener did not work for pressing and hold of button.
It only works when cursor moving by direction key.

Shude



On Fri, Oct 2, 2009 at 4:25 AM, Alexander Kazanin <
alexander.kaza...@gmail.com> wrote:

>
> Hi.
>
> If I understood your intentions correctly you should set
> OnLongClickListener.
> Button button = (Button) findViewById(R.id.*channel_up*);
>
> button.setOnFocusChangeListener(new View.OnLongClickListener()
>{
>public boolean onLongClick(View view)
>{
>return false;
>}
>});
>
> method onLongClick in this anonymous class will be called when user
> presses and holds "cannnel_up" button for about 2 seconds
>
> On 2 окт, 03:08, Shude Zheng  wrote:
> > I want to add some code when user press and hold the button. I try use
> > change the focus function. I wrote the similar code like onClick. But it
> was
> > never called when I moved curer to button and it was focused.
> >
> > Button button = (Button) findViewById(R.id.*channel_up*);
> >
> > button.setOnFocusChangeListener(*new* Button.OnFocusChangeListener() {
> >
> > *public* *void* onFocusChange(View v, *boolean* hasFocus) {
> >
> > }
> >
> > Thanks
> >
> > Shude
>
> >
>

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



[android-beginners] Re: How to receive an incoming call programmatically?

2009-10-02 Thread Nemat

I mean when we have an incoming call,phone should not be notified and
call should be received automatically

On Oct 1, 11:47 am, naG  wrote:
> can you explain it more...
>
> On Sep 30, 4:12 am, Nemat  wrote:
>
>
>
> > is it possible to intercept an incoming call?
>
> > I want my application to receive the call automatically through
> > programming.Can we do this in SDK-1.6?
>
> > Thanks
> > Nemat- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to receive callback when press and hold button for a longer time.

2009-10-02 Thread Alexander Kazanin

Hi.

If I understood your intentions correctly you should set
OnLongClickListener.
Button button = (Button) findViewById(R.id.*channel_up*);

button.setOnFocusChangeListener(new View.OnLongClickListener()
{
public boolean onLongClick(View view)
{
return false;
}
});

method onLongClick in this anonymous class will be called when user
presses and holds "cannnel_up" button for about 2 seconds

On 2 окт, 03:08, Shude Zheng  wrote:
> I want to add some code when user press and hold the button. I try use
> change the focus function. I wrote the similar code like onClick. But it was
> never called when I moved curer to button and it was focused.
>
> Button button = (Button) findViewById(R.id.*channel_up*);
>
> button.setOnFocusChangeListener(*new* Button.OnFocusChangeListener() {
>
> *public* *void* onFocusChange(View v, *boolean* hasFocus) {
>
> }
>
> Thanks
>
> Shude

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



[android-beginners] Re: How to receive an incoming call programmatically?

2009-10-01 Thread naG

can you explain it more...

On Sep 30, 4:12 am, Nemat  wrote:
> is it possible to intercept an incoming call?
>
> I want my application to receive the call automatically through
> programming.Can we do this in SDK-1.6?
>
> Thanks
> Nemat

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



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-28 Thread Mark Murphy

mjc147 wrote:
> I'll refrain from saying "Wow, thanks Mark!" because you probably get
> that all the time :)

That depends on whether what I'm saying is what somebody wants to hear.
But, thanks!

> I just looked at a bunch of apps that came with the Hero and the only
> one other than the Market using this cross, is Google Maps. I couldn't
> see anything like that in Internet, People, Mail, Google Talk or
> Messages apps.

Hm...OK. I would have expected broader use. Thanks for the info!

> Here's wishing they add a flag to EditText in 2.0...

That's not out of the question. HTC contributes lots of code to Android.
Whether or not this is considered truly part of "HTC Sense" would
probably dictate whether HTC offered it to the core Android team.

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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-28 Thread mjc147

I'll refrain from saying "Wow, thanks Mark!" because you probably get
that all the time :)

I just looked at a bunch of apps that came with the Hero and the only
one other than the Market using this cross, is Google Maps. I couldn't
see anything like that in Internet, People, Mail, Google Talk or
Messages apps.

Out of interest, my EditText is single line so when the text is longer
than the width of the widget it simply scrolls away to the left as you
would hope/expect. In other words, there is no reshifting of the cross
- when using the code I posted previously.

In the Market app, when you press on the cross, it changes to a
lighter shade of grey giving you the chance to drag away (and so
cancel).

I think its a really nice way of allowing the user to clear the text,
so if you do make a canned widget, I'm sure it will be hugely popular.

Here's wishing they add a flag to EditText in 2.0...

On Sep 28, 3:53 pm, Mark Murphy  wrote:
> mjc147 wrote:
> > To answer my own question...
>
> > Use TextView.setCompoundDrawables(null, null, null, null) to hide the
> > cross.
>
> > Next thing is to detect when the cross is pressed on.
>
> > Currently I do this:
>
> > mEditText.setOnTouchListener(new OnTouchListener() {
> >    public boolean onTouch(View v, MotionEvent event) {
> >            if (mEditText.getCompoundDrawables()[2] == null) {
> >                    // cross is not being shown so no need to handle
> >                    return false;
> >            }
> >            if (event.getAction() != MotionEvent.ACTION_DOWN) {
> >                    // only respond to the down type
> >                    return false;
> >            }
> >            if (event.getX() > mEditText.getMeasuredWidth() -
> > mEditText.getPaddingRight() - x.getIntrinsicWidth()) {
> >                    mEditText.setText("");
> >                    return true;
> >            }
> >            else {
> >                    return false;
> >            }
> >    }
> > });
>
> > This works but feels rather messy to me. Also, I'm not sure about the
> > mEditText.getPaddingRight()...
>
> > Is there a better way?
>
> Possibly, now that you sent the screenshot (thanks!). BTW, what you are
> seeing may be part of the HTC Sense UI -- it's certainly not what you
> get in ordinary Android.
>
> Regardless, here is how I would proceed to try to get this to work:
>
> Step #1: Keep your current Drawable code, but replace your X with a 100%
> transparent image of the same size. There might be a better way to
> accomplish this step, but I can't think of one off the top of my head.
> Basically, I am guessing that if you type a lot into that field on your
> Hero, the text does not wind up under the X, so you need a placeholder
> to keep the text to the left.
>
> Step #2: Wrap your EditText in a RelativeLayout. Put whatever layout
> rules you presently have on the EditText (layout_width, etc.) on the
> RelativeLayout, and set the EditText to be fill_parent/fill_parent for
> width/height.
>
> Step #3: In the same RelativeLayout, *after* the EditText in the XML,
> add an ImageView with your X, with layout_alignParentLeft="true" and
> enough paddingRight to have it positioned properly. RelativeLayout, like
> FrameLayout, supports "vertically" stacking widgets, so by having your
> ImageView be after the EditText in the XML, it will "float" over the
> EditText and be visible/touchable.
>
> Step #4: Add an OnTouchListener to the ImageView in your code.
>
> A variation on this approach would be to use the X image in Step #1 and
> a transparent View in Step #3. This is the old "hot-spot" trick from a
> byegone programming era -- a background provides the image and you have
> something floating over top where things are touchable. If you specify a
> View with background=#, it should be invisible, and if you
> size/position it properly, it will sit over top your X. It's a bit more
> difficult to debug, though you could temporarily use a translucent
> background (say, #22FF for a slight red effect) until you get the
> hot-spot positioned properly.
>
> These approaches have the advantage of avoiding the OnTouchListener
> calculations you are doing in the EditText, which might have problems if
> EditText changes behavior in future releases. On the other hand, these
> approaches add a few more widgets and therefore take up a bit more memory.
>
> If the X appears to actually "click" when tapped on your Hero, then they
> may be using an ImageButton with a custom set of backgrounds rather than
> an ImageView. That is also possible to implement independently but gets
> decidedly more painful.
>
> Once I get my hands on an HTC Sense-ible device, I may try to cook up
> some canned widgets to offer some of their looks, like this one, in
> plug-and-play form.
>
> A question for you: does this "X" effect show up in places other than
> the Android Market search app on your Hero? Thanks!
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/co

[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-28 Thread Mark Murphy

mjc147 wrote:
> To answer my own question...
> 
> Use TextView.setCompoundDrawables(null, null, null, null) to hide the
> cross.
> 
> Next thing is to detect when the cross is pressed on.
> 
> Currently I do this:
> 
> mEditText.setOnTouchListener(new OnTouchListener() {
>   public boolean onTouch(View v, MotionEvent event) {
>   if (mEditText.getCompoundDrawables()[2] == null) {
>   // cross is not being shown so no need to handle
>   return false;
>   }
>   if (event.getAction() != MotionEvent.ACTION_DOWN) {
>   // only respond to the down type
>   return false;
>   }
>   if (event.getX() > mEditText.getMeasuredWidth() -
> mEditText.getPaddingRight() - x.getIntrinsicWidth()) {
>   mEditText.setText("");
>   return true;
>   }
>   else {
>   return false;
>   }
>   }
> });
> 
> This works but feels rather messy to me. Also, I'm not sure about the
> mEditText.getPaddingRight()...
> 
> Is there a better way?

Possibly, now that you sent the screenshot (thanks!). BTW, what you are
seeing may be part of the HTC Sense UI -- it's certainly not what you
get in ordinary Android.

Regardless, here is how I would proceed to try to get this to work:

Step #1: Keep your current Drawable code, but replace your X with a 100%
transparent image of the same size. There might be a better way to
accomplish this step, but I can't think of one off the top of my head.
Basically, I am guessing that if you type a lot into that field on your
Hero, the text does not wind up under the X, so you need a placeholder
to keep the text to the left.

Step #2: Wrap your EditText in a RelativeLayout. Put whatever layout
rules you presently have on the EditText (layout_width, etc.) on the
RelativeLayout, and set the EditText to be fill_parent/fill_parent for
width/height.

Step #3: In the same RelativeLayout, *after* the EditText in the XML,
add an ImageView with your X, with layout_alignParentLeft="true" and
enough paddingRight to have it positioned properly. RelativeLayout, like
FrameLayout, supports "vertically" stacking widgets, so by having your
ImageView be after the EditText in the XML, it will "float" over the
EditText and be visible/touchable.

Step #4: Add an OnTouchListener to the ImageView in your code.

A variation on this approach would be to use the X image in Step #1 and
a transparent View in Step #3. This is the old "hot-spot" trick from a
byegone programming era -- a background provides the image and you have
something floating over top where things are touchable. If you specify a
View with background=#, it should be invisible, and if you
size/position it properly, it will sit over top your X. It's a bit more
difficult to debug, though you could temporarily use a translucent
background (say, #22FF for a slight red effect) until you get the
hot-spot positioned properly.

These approaches have the advantage of avoiding the OnTouchListener
calculations you are doing in the EditText, which might have problems if
EditText changes behavior in future releases. On the other hand, these
approaches add a few more widgets and therefore take up a bit more memory.

If the X appears to actually "click" when tapped on your Hero, then they
may be using an ImageButton with a custom set of backgrounds rather than
an ImageView. That is also possible to implement independently but gets
decidedly more painful.

Once I get my hands on an HTC Sense-ible device, I may try to cook up
some canned widgets to offer some of their looks, like this one, in
plug-and-play form.

A question for you: does this "X" effect show up in places other than
the Android Market search app on your Hero? Thanks!

-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-28 Thread mjc147

To answer my own question...

Use TextView.setCompoundDrawables(null, null, null, null) to hide the
cross.

Next thing is to detect when the cross is pressed on.

Currently I do this:

mEditText.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (mEditText.getCompoundDrawables()[2] == null) {
// cross is not being shown so no need to handle
return false;
}
if (event.getAction() != MotionEvent.ACTION_DOWN) {
// only respond to the down type
return false;
}
if (event.getX() > mEditText.getMeasuredWidth() -
mEditText.getPaddingRight() - x.getIntrinsicWidth()) {
mEditText.setText("");
return true;
}
else {
return false;
}
}
});

This works but feels rather messy to me. Also, I'm not sure about the
mEditText.getPaddingRight()...

Is there a better way?

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



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-27 Thread mjc147

On Sep 28, 12:43 am, Jack Ha  wrote:
>     Drawable x = getResources().getDrawable(R.drawable.x);
>     x.setBounds(0, 0, x.getIntrinsicWidth(), x.getIntrinsicHeight());
>     mEditText.setCompoundDrawables(null, null, x, null);

Thanks Jack - visually, that works exactly as I wanted.

However, I'm trying to hide the cross when the text is empty/blank.
I've tried using Drawable.setVisible() but this doesn't seem to make a
difference.

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



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-27 Thread mjc147

On Sep 27, 10:37 pm, Mark Murphy  wrote:
> Could you perhaps post a screenshot somewhere?

Hi Mark - here is the screenshot (taken from my HTC Hero):
http://www.mediafire.com/?sharekey=e574c08de66edfe8c79b87b207592a1ce04e75f6e8ebb871

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



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-27 Thread Jack Ha

Try:

Drawable x = getResources().getDrawable(R.drawable.x);
x.setBounds(0, 0, x.getIntrinsicWidth(), x.getIntrinsicHeight());
mEditText.setCompoundDrawables(null, null, x, null);


--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together
The coverage you need at the price you want

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 Sep 27, 7:20 am, mjc147  wrote:
> I want to build a very simple view which looks exactly like the top
> section of the Android Market search activity (i.e. search EditText
> view and search button). Ideally I'd like it to look EXACTLY the same.
> Maybe there is some layout XML and/or code I can reuse?
>
> Writing it fresh is also fine but I am not clear how to get the "X"
> button (which appears inside the EditText view when the user enters
> some text) functionality. That's there to allow the user to quickly
> clear the text.
>
> Any tips?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to build EditText view like that in Android Market where "X" button appears for clearing text?

2009-09-27 Thread Mark Murphy

mjc147 wrote:
> I want to build a very simple view which looks exactly like the top
> section of the Android Market search activity (i.e. search EditText
> view and search button). Ideally I'd like it to look EXACTLY the same.
> Maybe there is some layout XML and/or code I can reuse?

The Android Market is not open source, unfortunately.

> Writing it fresh is also fine but I am not clear how to get the "X"
> button (which appears inside the EditText view when the user enters
> some text) functionality. That's there to allow the user to quickly
> clear the text.

On my T-Mobile G1, I opened the Android Market, clicked on Search, and
entered text into the search field. I do not get an "X" button.

Could you perhaps post a screenshot somewhere?

-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to..

2009-09-25 Thread Justin Anderson
Use a real phone... Of course, that would make debugging your app a little
difficult...

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Thu, Sep 24, 2009 at 2:26 AM, Sourabh Pandit <
sourabhshyampan...@gmail.com> wrote:

>
> Hi,
> I'm writting an application that has to interact with an external
> hardware using USB.
> As emulator doesn't support USB port connection. Is there any
> workaround for this??
>
> Thanks
> Sourabh Pandit
>
> >
>

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



[android-beginners] Re: How to send JSONObject by HttpPost?

2009-09-25 Thread Alok Kulkarni
Enjoy
  URL url = new URL(serverURL);

// open the conncetion
HttpURLConnection connection =
(HttpURLConnection)url.openConnection();

// Let the run-time system (RTS) know that we want input.
connection.setDoInput(true);
// Let the RTS know that we want to do output
connection.setDoOutput(true);
// No caching, we want the real thing
connection.setUseCaches(false);
// set the content type property
connection.setRequestProperty("Content-type",strContenttype);

// set request method
connection.setRequestMethod("POST");
// create the post body to send
String content = credDevPair.toString();
Log.i("Request ... ",content);
DataOutputStream printout = new DataOutputStream (
connection.getOutputStream () );

// send the data
printout.writeBytes(content);
printout.flush();
printout.close();
String output =
convertStreamToString(connection.getInputStream());
Log.i("Response 1... ",output);
// A Simple JSONObject Creation
JSONObject json=new JSONObject(output);

Log.i("Praeda","\n"+json.toString()+"\n");

// A Simple JSONObject Parsing
JSONArray nameArray=json.names();
JSONArray valArray=json.toJSONArray(nameArray);
for(int i=0; i\n"+nameArray.getString(i)+"\n\n"


+"\n"+valArray.getString(i)+"\n");
}
//BufferedReader input = new BufferedReader ( new
InputStreamReader(connection.getInputStream()) );

}catch (ClientProtocolException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }catch (IOException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();

}catch(Exception ex)
{

}
}

  private static String convertStreamToString(InputStream is) {
/*
 * To convert the InputStream to String we use the
BufferedReader.readLine()
 * method. We iterate until the BufferedReader return null which
means
 * there's no more data to read. Each line will appended to a
StringBuilder
 * and returned as String.
 */
BufferedReader reader = new BufferedReader(new
InputStreamReader(is));
StringBuilder sb = new StringBuilder();

String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}

Please put in the requred content type, server url..
Thanks, Alok

On Fri, Sep 25, 2009 at 2:01 AM, veen  wrote:

>
> I need to send http request with the following view:
>
> POST /device/api/login HTTP/1.1
> Content-Type: text/json
>
> {"login":"LOGIN","password":"PASSWORD"}
>
> [my code]
>DefaultHttpClient hClient = new
> DefaultHttpClient();
>HttpPost post = new HttpPost(host +
> "/device/api/login");
>
>post.setHeader("Content-Type", "text/json");
>
>JSONObject jo = new JSONObject();
>jo.put("login", login);
>jo.put("password", password);
>String  joSt = jo.toString();
>
>BasicHttpEntity be = new BasicHttpEntity();
>byte bytes[] = joSt.getBytes();
>
>be.setContent(new ByteArrayInputStream(bytes));
>post.setEntity(be);
>
>HttpResponse response = hClient.execute(post);
>
>hClient.getConnectionManager().shutdown();
> [/my code]
> It doesn't work. Could you help me to figure out what's wrong?
>
> >
>

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



[android-beginners] Re: How to launch android emulator

2009-09-24 Thread jotobjects

At the command line you can start the emulator like this -

emulator -avd android1.5_maps -logcat "v:*"

In this case, I first created an AVD named "android1.5_maps". Read how
to create an AVD in the Dev Guide.


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



[android-beginners] Re: How to launch android emulator

2009-09-24 Thread Roman ( T-Mobile USA)

You can run the emulator using the Eclipse IDE or via command line.

Follow the instructions on http://developer.android.com/sdk/1.6_r1/index.html
for the latest SDK version.

Make sure that you download the Android package for the correct
platform.

If you add more information what exactly you are doing, this would be
helpful!

--
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 Sep 24, 11:21 am, Android_n00b  wrote:
> You have to be more specific. Did you create an avd?
>
> On Sep 24, 12:31 pm, Androidbeginner  wrote:
>
> > I followed the instruction to load Android in  (http://
> > source.android.com/download). I am using Ubuntu ver9.03. I am having
> > trouble to launch emulator. Message I got: emulator:cannot excute
> > binary file. Anyone has ideas why?
>
> > Thanks
> > Androidbeginner.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to launch android emulator

2009-09-24 Thread Android_n00b

You have to be more specific. Did you create an avd?

On Sep 24, 12:31 pm, Androidbeginner  wrote:
> I followed the instruction to load Android in  (http://
> source.android.com/download). I am using Ubuntu ver9.03. I am having
> trouble to launch emulator. Message I got: emulator:cannot excute
> binary file. Anyone has ideas why?
>
> Thanks
> Androidbeginner.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to start an Android project in Eclipse?

2009-09-24 Thread Sudheesh J

Make sure that you have set the path to the Android SDK under Window-
>Preferences->Android
See configurin eclipse at:
http://developer.android.com/sdk/1.6_r1/installing.html#InstallingADT

Sudheesh

On Sep 23, 5:43 pm, Jaakko  wrote:
> I tried to install Android in Eclipse. I followed instructions from
> the sites  
> http://www.howtoforge.com/installing-google-android-sdk1.0-on-ubuntu8...
> andhttp://developer.android.com/guide/tutorials/hello-world.html.
> Now, as I start Eclipse and an Android project, it says that "An SDK
> Target must be specified." But in the window, the whole "Built Target"
> - box is inactive so I can't activate the "Target Name". How can I fix
> the problem?
>
> I installed today the latest version of Java available in Xubuntu and
> downloaded Eclipse and Android from the web so I guess my tools are
> not out of date.

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



[android-beginners] Re: How to call built-in camera application from my app??

2009-09-23 Thread Balwinder Kaur (T-Mobile USA)

There are a lot of good tutorials/examples on the web on using
Intents.

If you post your code using Intents, someone will help you get
started. If you are using Android, you should be familiar with
Intents.

Thanks,
Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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


On Sep 23, 11:18 am, wahib  wrote:
> Hi !! I am a newbie and thinking about doing barcode scanning thing a
> little different way. I have tested a code which decode a stored image
> in res folder using zxing library. I am thinking to first call built-
> in camera app from my app in start, once the image of barcode is taken
> and stored in gallery ... my app will then read the latest added image
> and will run the decode function on it. I know it look a little old-
> fashioned plan of action though i can use intents. But i was just
> wondering if i can do this way. Coz i was finding difficulty doing it
> with intent way as i dont have a phone and doing it with emulator is
> little confusing rite now :S
>
> Any guidance is appreciated.
>
> Regards,
> wahib
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to connect to the internet behind proxy ?

2009-09-22 Thread Roman ( T-Mobile USA)

Can you connect with a normal browser to the internet or do you need
already a proxy in your desktop browser?

If you have no proxy configured in your normal browser on your
desktop, there is no need to add any proxy stuff on the Android
emulator.

--
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 Sep 22, 3:28 pm, "tinyang"  wrote:
> Can you connect to the internet without the proxy on the emulator?
>
> -Original Message-
> From: android-beginners@googlegroups.com
>
> [mailto:android-beginn...@googlegroups.com] On Behalf Of rcy
> Sent: Thursday, September 17, 2009 7:02 AM
> To: Android Beginners
> Subject: [android-beginners] How to connect to the internet behind proxy ?
>
> Hi All,
>
> Not recently I installed the android SDK for the first time. After playing
> with the emulator I notice that I can’t log in to the internet via the
> browser application.
> I looked for a and found the following command : “emulator -avd em15 -
> http-proxy ”
>
> For the  I copy the prams’ from the browser (Tools à Internet Option
> à Connection à Lan settings ) but still I can’t see any WebPages via the
> browser.
>
> Any suggestion ?
>
> Thanks
>
> No virus found in this incoming message.
> Checked by AVG -http://www.avg.com
> Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/17/2009
> 3:55 PM
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to connect to the internet behind proxy ?

2009-09-22 Thread tinyang

Can you connect to the internet without the proxy on the emulator? 

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of rcy
Sent: Thursday, September 17, 2009 7:02 AM
To: Android Beginners
Subject: [android-beginners] How to connect to the internet behind proxy ?


Hi All,

Not recently I installed the android SDK for the first time. After playing
with the emulator I notice that I can’t log in to the internet via the
browser application.
I looked for a and found the following command : “emulator -avd em15 -
http-proxy ”

For the  I copy the prams’ from the browser (Tools à Internet Option
à Connection à Lan settings ) but still I can’t see any WebPages via the
browser.

Any suggestion ?

Thanks


No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/17/2009
3:55 PM


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



[android-beginners] Re: How to run system cam in Android Simulator in Ubuntu

2009-09-22 Thread tinyang

This is the second post I've seen from you about this, but I'm unclear as to
what you want to do.  Would this help you?

 http://www.tomgibara.com/android/camera-source

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Sushant
Sent: Monday, September 14, 2009 2:44 PM
To: Android Beginners
Subject: [android-beginners] How to run system cam in Android Simulator in
Ubuntu


I am not able to connect my PC camera with Android Simulator camera in
ecllipse on Ubuntu Machine.
Can somebody suggest me a solution for that.Please help me i was stuck with
these problem for long time

Sushant


No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/16/2009
5:49 PM


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



[android-beginners] Re: How to end a application completely?

2009-09-17 Thread kapnkore
Active only can be finished by useing the finish(); with help of this i
think you may also end your application completally

On Tue, Sep 15, 2009 at 7:55 AM, FeatherElf  wrote:

>
> I'm new in the Android World.
> I wanna that how to end a application completely?
> And also,
> I wanna how to only end a active alone?
>
> >
>

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



[android-beginners] Re: How to access wireless toggle functionality

2009-09-17 Thread Bartłomiej Nowak
2009/9/14 Carl 

>
> Hello all,
>
> I would like to create an application that allows the user to quickly
> toggle wireless connections ON/OFF. I found the API for wi-fi
> (android.net.wifi.WifiManager) but I am not able to find any API for
> Bluetooth and airplane modes.
> Do you have any idea where I can find such APIs or how can I have
> access to the switching functionality?
>
> Regards
>
> carl
>
> >
>

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



[android-beginners] Re: how to change text in a Button

2009-09-17 Thread Bartłomiej Nowak
2009/9/15 cellurl 

>
> Hi,
>
> On the fly, I want to change the text shown in a Button.
>
> Q: How do I do that.
>
> My teacher held me back a year from Android school ;-)
> (newbie again)
> jim
>
> >
>

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



[android-beginners] Re: How to change the Typeface of ListView and Spinner

2009-09-17 Thread Mark Murphy

andu wrote:
> How are you all!
> 
> I am developing android application. currently I am creating a user
> interface in my language, Amharic. I can change the font for Textview,
> button and other controls. But I can change the font for ListView and
> Spinner control. When I search the internet I found out that Listview
> and spinner has their own textview to keep the text. But I don't know
> how to access the textview component of this controls.
> 
> 1. How can I change the typeface of Listview and Spinner? or
> 2. How can I access the built-in textview of these component so that I
> can change the typeface for the textview?

You will need to take control over what goes into the ListView and
Spinner. I have not experimented with these techniques on Spinner, but
on ListView, you will need to override getView() (on ArrayAdapter) or
newView() and bindView() (on CursorAdapter).

Here is a free excerpt from one of my books that demonstrates the technique:

http://commonsware.com/Android/excerpt.pdf

In your case, you would use your Typeface object to update the font used
by the TextView widgets in your rows.

In principle, you could do this via a wrapping adapter -- this would be
more reusable but a bit slower. I have an AdapterWrapper base class here:

http://github.com/commonsguy/cwac-adapter

and some projects that use it here:

http://github.com/commonsguy/cwac-endless
http://github.com/commonsguy/cwac-thumbnail

-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to use MediaStore to get content URI of audio file saved in sdcard ?

2009-09-16 Thread Balwinder Kaur (T-Mobile USA)

Environment.getExternalStorageDirectory() to get a File.
And Uri.fromFile(File f) to get the Uri.

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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



On Sep 15, 12:35 pm, Harshit Mapara  wrote:
> Hi All,
>
> I searched this , but can't find any related info.
> Here is what I want to do:
>
> In  /sdcard/downloads  folder, there is a xyz.mp3 file.
> I want to save the content URI of xyz.mp3 file into my database.
> xyz.mp3 is huge, so it can't be saved in database, but I want to save
> it's URI in database with other records in row. So always I can get
> the URI string and using content resolver I can get the xyz.mp3 file
> by providing its content URI. ( I guess using openOuputStream method
> of contentResolver)
>
> So the question is, how do I do this?? how can I get content URI of
> xyz.mp3 ? I guess it can be done using MediaStore, but I don't get
> enough help from documentation to accomplish this.
>
> Please help
> Thanks
> Harshit
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to change text in a Button

2009-09-16 Thread Mark Murphy

cellurl wrote:
> Heres my code.
> I don't see a .setText for View.

Button is a subclass of View.

>private void findViews
>   // Set up click listeners for all the buttons
>   View aboutButton25 = findViewById(R.id.about_button25);

Button aboutButton25=(Button)findViewById(R.id.about_button25);

-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to disable connection to internet in android phone?

2009-09-15 Thread kiro

ok, thanks

On Sep 16, 3:34 am, "Roman ( T-Mobile USA)"  wrote:
> There are already several threads on this topic. For example
>
> http://groups.google.com/group/android-developers/browse_thread/threa...
>
> Also look for "changing the APN settings".
>
> --
> 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 Sep 15, 7:42 am, kiro  wrote:
>
> > b.c. it costly by my provider and eats battery
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to change text in a Button

2009-09-15 Thread cellurl

thanks

On Sep 15, 11:12 pm, Justin Anderson  wrote:
> Don't make it a View... Make it a Button.  Button inherits from 
> TextView.http://developer.android.com/reference/android/widget/Button.html
>
> Thanks,
> Justin
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
> On Tue, Sep 15, 2009 at 8:01 PM, cellurl  wrote:
>
> > Heres my code.
> > I don't see a .setText for View.
> > I guess I am confusing button and view.
> > thanks for any help.
> > jp
>
> > AndroidManifest.xml--
>
> >         >                android:label="@string/about_title"
> >                android:theme="@android:style/Theme.Dialog">
> >        
>
> > ---Translate.java
>
> >   private void findViews
> >      // Set up click listeners for all the buttons
> >      View aboutButton25 = findViewById(R.id.about_button25);
> >      aboutButton25.setOnClickListener(this);
>
> >      broke here <>
> >      if(mph) {
> >         aboutButton25.setText("25 Mph");
> >      } else {
> >         aboutButton25.setText("25 Kph");
> >      }
>
> >   }
>
> >   public void onClick(View v) {
>
> >      switch (v.getId()) {
>
> >      case R.id.about_button25:
> >         Intent i25 = new Intent(this, About25.class);
> >         startActivity(i25);
> >         break;
> >   }
>
> > --About25.java---
>
> > public class About25 extends Activity {
>
> > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to change text in a Button

2009-09-15 Thread Justin Anderson
Don't make it a View... Make it a Button.  Button inherits from TextView.
http://developer.android.com/reference/android/widget/Button.html

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Sep 15, 2009 at 8:01 PM, cellurl  wrote:

>
> Heres my code.
> I don't see a .setText for View.
> I guess I am confusing button and view.
> thanks for any help.
> jp
>
>
> AndroidManifest.xml--
>
>android:label="@string/about_title"
>android:theme="@android:style/Theme.Dialog">
>
>
>
> ---Translate.java
>
>
>   private void findViews
>  // Set up click listeners for all the buttons
>  View aboutButton25 = findViewById(R.id.about_button25);
>  aboutButton25.setOnClickListener(this);
>
>  broke here <>
>  if(mph) {
> aboutButton25.setText("25 Mph");
>  } else {
> aboutButton25.setText("25 Kph");
>  }
>
>   }
>
>
>   public void onClick(View v) {
>
>  switch (v.getId()) {
>
>  case R.id.about_button25:
> Intent i25 = new Intent(this, About25.class);
> startActivity(i25);
> break;
>   }
>
>
> --About25.java---
>
>
> public class About25 extends Activity {
>
> }
>
>
>
>
> >
>

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



[android-beginners] Re: how to change text in a Button

2009-09-15 Thread cellurl

Heres my code.
I don't see a .setText for View.
I guess I am confusing button and view.
thanks for any help.
jp


AndroidManifest.xml--





---Translate.java


   private void findViews
  // Set up click listeners for all the buttons
  View aboutButton25 = findViewById(R.id.about_button25);
  aboutButton25.setOnClickListener(this);

  broke here <>
  if(mph) {
 aboutButton25.setText("25 Mph");
  } else {
 aboutButton25.setText("25 Kph");
  }

   }


   public void onClick(View v) {

  switch (v.getId()) {

  case R.id.about_button25:
 Intent i25 = new Intent(this, About25.class);
 startActivity(i25);
 break;
   }


--About25.java---


public class About25 extends Activity {

}




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



[android-beginners] Re: How to disable connection to internet in android phone?

2009-09-15 Thread Roman ( T-Mobile USA)

There are already several threads on this topic. For example

http://groups.google.com/group/android-developers/browse_thread/thread/752a2e56dce42123

Also look for "changing the APN settings".

--
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 Sep 15, 7:42 am, kiro  wrote:
> b.c. it costly by my provider and eats battery
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to disable sms notification?

2009-09-15 Thread Yusuf Saib (T-Mobile USA)

If all you want to do is intercept some SMS messages meant for your
app, you can do that in Android. One tutorial that explains how is
here: http://mobiforge.com/developing/story/sms-messaging-android



Yusuf Saib
Android
·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 Sep 13, 8:57 pm, zhy  wrote:
> You can change the Mms at packages/apps/Mms.
> Or write your BroadcastReceiver.  when received sms, cancel the
> notification.
>
> 在 2009-09-09三的 13:08 +0800,Henry Shang写道:
>
>
>
> > I'm trying to use my own app to handle one incoming message
> > with some specific characters in it. And I don't want the system's
> > default sms notifications to show up.
>
> > How can I do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to change text in a Button

2009-09-15 Thread Jack Ha

Please refer to the Android Developer Guide.

button.setText()

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together
The coverage you need at the price you want

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 Sep 15, 9:34 am, cellurl  wrote:
> Hi,
>
> On the fly, I want to change the text shown in a Button.
>
> Q: How do I do that.
>
> My teacher held me back a year from Android school ;-)
> (newbie again)
> jim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to add my own menu item into the already existing menu in the sms application

2009-09-15 Thread Jack Ha

Here is an example and you probably can make it to work with SMS.

http://www.anddev.org/viewtopic.php?p=25639

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together
The coverage you need at the price you want

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 Sep 15, 5:13 am, Oskar  wrote:
> Hi,
>
> I would like to add my own menu item into the already existing menu in
> the sms application.
>
> E.g when the user is reading a sms and highlights an attached link to
> a web page and pressing menu. Is it then possible for me to add my own
> menu item in this already existing menu. I would like to use the
> attached link and send it to my application when selecting my menu
> item from the already existing SMS menu.
>
> I would appreciate very much if someone could give me some hints
> regarding what I need and how to get started. Maybe such things are
> described somewhere?
>
> Thanks,
>
> Oskar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to debug crash on rotate

2009-09-14 Thread Michael Dorin

Thanks,
That did help.
That was it.
-Mike

On Sun, Sep 13, 2009 at 10:47 PM, sume  wrote:
>
> I'm not familiar with the framework you're using, but do you have this
> attribute android:configChanges=”orientation" in the activity that's
> casing the crash? if not you can handle that event with  the
> onConfigurationChanged() handler.
>
> Hope this helps
>
>
> On Sep 12, 10:30 pm, Romain Guy  wrote:
>> Hi,
>>
>> Have you looked at the logs to see the exact stack trace?
>>
>>
>>
>> On Sat, Sep 12, 2009 at 7:24 PM, Michael Dorin  wrote:
>>
>> > I have an application that crashes when the phone is rotated.
>> > It is based on the quickconnect framework.
>> > Sorry for the vagueness of this  message, but how would I begin to
>> > debug what is happening?
>> > What should I look for? How do I gather a trace?
>>
>> > It seems the crash comes at the onSuspend event.
>>
>> > Thanks for any ideas.
>>
>> > -Mike
>>
>> --
>> 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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to access wireless toggle functionality

2009-09-14 Thread Yusuf Saib (T-Mobile USA)

This fellow seems to have code that works:
http://www.mail-archive.com/android-beginners@googlegroups.com/msg06083.html



Yusuf Saib
Android
·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 Sep 13, 5:53 pm, Carl  wrote:
> Hello all,
>
> I would like to create an application that allows the user to quickly
> toggle wireless connections ON/OFF. I found the API for wi-fi
> (android.net.wifi.WifiManager) but I am not able to find any API for
> Bluetooth and airplane modes.
> Do you have any idea where I can find such APIs or how can I have
> access to the switching functionality?
>
> Regards
>
> carl
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to debug crash on rotate

2009-09-14 Thread sume

I'm not familiar with the framework you're using, but do you have this
attribute android:configChanges=”orientation" in the activity that's
casing the crash? if not you can handle that event with  the
onConfigurationChanged() handler.

Hope this helps


On Sep 12, 10:30 pm, Romain Guy  wrote:
> Hi,
>
> Have you looked at the logs to see the exact stack trace?
>
>
>
> On Sat, Sep 12, 2009 at 7:24 PM, Michael Dorin  wrote:
>
> > I have an application that crashes when the phone is rotated.
> > It is based on the quickconnect framework.
> > Sorry for the vagueness of this  message, but how would I begin to
> > debug what is happening?
> > What should I look for? How do I gather a trace?
>
> > It seems the crash comes at the onSuspend event.
>
> > Thanks for any ideas.
>
> > -Mike
>
> --
> 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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to disable sms notification?

2009-09-14 Thread zhy

You can change the Mms at packages/apps/Mms.
Or write your BroadcastReceiver.  when received sms, cancel the
notification.

在 2009-09-09三的 13:08 +0800,Henry Shang写道:
> I'm trying to use my own app to handle one incoming message 
> with some specific characters in it. And I don't want the system's 
> default sms notifications to show up. 
> 
> 
> How can I do this?
> 
> > 


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



[android-beginners] Re: How to debug crash on rotate

2009-09-14 Thread sume

I'm not familiar with the framework you're using, but do you have this
attribute android:configChanges=”orientation" in the activity that's
casing the crash? if not you can handle that event with  the
onConfigurationChanged() handler.

Hope this helps


On Sep 12, 10:30 pm, Romain Guy  wrote:
> Hi,
>
> Have you looked at the logs to see the exact stack trace?
>
>
>
> On Sat, Sep 12, 2009 at 7:24 PM, Michael Dorin  wrote:
>
> > I have an application that crashes when the phone is rotated.
> > It is based on the quickconnect framework.
> > Sorry for the vagueness of this  message, but how would I begin to
> > debug what is happening?
> > What should I look for? How do I gather a trace?
>
> > It seems the crash comes at the onSuspend event.
>
> > Thanks for any ideas.
>
> > -Mike
>
> --
> 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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to get the orange border with TextView ?

2009-09-13 Thread iPaul Pro

Hi,

First you will want to make the TextView clickable and focusable.
(android:clickable="true", android:focusable="true")

If you want the TextView to link to an address, phone number, website,
or email address you can use the AutoLink feature. (eg.
android:autoLink="web"; or android:autoLink="all")

I am not aware of the xml file that the browser uses for links. But
you can recreate this yourself. If you are looking to set custom click
listeners it will involve creating images for each of the states and
referencing them in a resource xml file. You then set this xml file as
the background of the TextView.

For example, this is the background of a standard EditText View
(platforms/android-1.5/data/res/drawable/edit_text.xml):




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









If you are going to use a custom background I would suggest using this
as a template and use the Draw 9-patch tool to assign stretchable
regions to your drawables. (http://developer.android.com/guide/
developing/tools/draw9patch.html)

Hope this helps,

Paul

On Sep 9, 6:59 am, Falcon24  wrote:
> Hello,
> I'm currently beginning in java for android and I'm asking your help.
> I would like make some link in my program like phone number, mail
> etc.. with this border when the user clic on it.
> Well, when I create a WebView, the clicable link appears like that 
> :http://www.fro2.eu/Ayabame/border_android.bmp
> My questions are:
> What's the method who provide this border and can I use it with
> TextView and linkify ?
> Can we control it in xml file or just in .java file ?
>
> Thank in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to debug crash on rotate

2009-09-12 Thread Romain Guy

Hi,

Have you looked at the logs to see the exact stack trace?

On Sat, Sep 12, 2009 at 7:24 PM, Michael Dorin  wrote:
>
> I have an application that crashes when the phone is rotated.
> It is based on the quickconnect framework.
> Sorry for the vagueness of this  message, but how would I begin to
> debug what is happening?
> What should I look for? How do I gather a trace?
>
> It seems the crash comes at the onSuspend event.
>
> Thanks for any ideas.
>
> -Mike
>
> >
>



-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to receive general IO events ?

2009-09-12 Thread Jack Ha

Maybe FileObserver is what you are looking for:

http://developer.android.com/reference/android/os/FileObserver.html

--
Jack Ha
Open Source Development Center
·T· · ·Mobile· stick together
The coverage you need at the price you want

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 Sep 10, 11:26 am, daemonserj  wrote:
> Hello All!
> Is it possible to be notified about general IO in system ?
> For example I want to receive some file reading events and blinking
> with some indicator...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to import packages in android?

2009-09-11 Thread Roman ( T-Mobile USA)

If you have a jar package or  the source code you can always add a
dependency to the project settings.

When you open the properties of your project and check  the Java build
path you can add libraries or Java Projects as additional
dependency.


--
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 Sep 11, 6:39 am, mmkr  wrote:
> Hai,
>
> In my application in need to use the java.image.io package, but it is
> not suppoted by android. Is there any way i can import packages into
> android. Please help me.
>
> I need to do the image processing in my app, which can be done through
> image.io. If it is not really possible please let me know. It would be
> helpful for me.
>
> Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to unsubscribe from the e-mail list

2009-09-10 Thread Venky

How do I unsubscribe from non google account say a...@yahoo.com.
Sending mail to android-beginners-unsubscr...@googlegroups.com returns
with a message not able to deliver.

On Sep 9, 9:03 am, Justin Anderson  wrote:
> Log in to google groups and edit your membership with the group
>
> --
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> --
>
>
>
> On Sat, Sep 5, 2009 at 9:18 PM, metefk  wrote:
>
> > I sent an empty e-mail to android-beginbers-
> > unsubscr...@googlegroups.com to remove my e-mail address, but all of
> > them failed. Can you please let me know how to unsubscribe?
>
> > Thanks,
>
> > -- Forwarded message --
> > From: Mail Delivery Subsystem 
> > Date: Sat, Sep 5, 2009 at 8:13 PM
> > Subject: Delivery Status Notification (Failure)
> > To: mete.fikirl...@gmail.com
>
> > This is an automatically generated Delivery Status Notification
>
> > Delivery to the following recipient failed permanently:
>
> >    android-beginners-unsubscr...@googlegroups.com
>
> > Technical details of permanent failure:
> > Google tried to deliver your message, but it was rejected by the
> > recipient domain. We recommend contacting the other email provider for
> > further information about the cause of this error. The error that the
> > other server returned was: 550 550-5.1.1 The email account that you
> > tried to reach does not exist. Please try
> > 550-5.1.1 double-checking the recipient's email address for typos or
> > 550-5.1.1 unnecessary spaces. Learn more at
> > 550 5.1.1http://mail.google.com/support/bin/answer.py?answer=6596
> > 19si310008qyk.0 (state 14).
>
> >  - Original message -
>
> > MIME-Version: 1.0
> > Received: by 10.220.105.148 with SMTP id t20mr9710503vco.
> > 96.1252206810578;
> >       Sat, 05 Sep 2009 20:13:30 -0700 (PDT)
> > Date: Sat, 5 Sep 2009 20:13:30 -0700
> > Message-ID:
> > <1cf64a670909052013n58ed84ddo821debd80f6a0...@mail.gmail.com>
> > Subject: unsubscribe
> > From: Mete Fikirlier 
> > To: android-beginners-unsubscr...@googlegroups.com
> > Content-Type: multipart/alternative;
> > boundary=0016e646925c213f560472e01e53
>
> > --0016e646925c213f560472e01e53
> > Content-Type: text/plain; charset=ISO-8859-1
>
> > unsubscribe
>
> > --0016e646925c213f560472e01e53
> > Content-Type: text/html; charset=ISO-8859-1
>
> > unsubscribe
>
> >  - Message truncated -- Hide quoted text -
>
> - Show quoted text -

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



[android-beginners] RE: How to open application program AlarmClock in Eclipse IDE

2009-09-10 Thread anantha.javali


Hi,

I downloaded the AlarmClock app program from source.android.com. I would
like to know how I can open this in Eclipse IDE on a Windows
environment.
I tried creating new project. I was not successful.

Thanks
Anantha

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



[android-beginners] Re: How to compile a multilanguage version of android?

2009-09-10 Thread elegos

What about closed-source applications? I mean Gmail, Market and other
Google closed-source programs. How is I've got it, i.e. in Italian,
English and other languages while other people have it only in
English?

On 10 Set, 14:45, Nanard  wrote:
> Add different strings.xml one for each language in the resource
> directory.
> All languages will then be in your .apk.
>
> On the phone (emulator also), you can change the locale settings, and
> choose another language.
>
> This way, you can test your application in several languages.
>
> No need to recompile anything !
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to compile a multilanguage version of android?

2009-09-10 Thread Nanard

Add different strings.xml one for each language in the resource
directory.
All languages will then be in your .apk.


On the phone (emulator also), you can change the locale settings, and
choose another language.

This way, you can test your application in several languages.

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



[android-beginners] Re: how to read sms from inbox

2009-09-10 Thread Mark Murphy

kapnk...@gmail.com wrote:
> Does it also mean that there is knowway to do this?

I am not aware of a documented and supported way to access the SMS inbox.

-- 
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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



<    1   2   3   4   5   6   7   8   9   10   >