Re: [android-developers] Re: Is there any way of knowing the screen size before rotation occurs?

2013-03-05 Thread Piren
Still not seeing how is this an issue :)... Do the rotation, then access 
the cloud server.

On Tuesday, March 5, 2013 9:46:43 AM UTC+2, AndroidCompile wrote:

 It is important since the cloud server I am working with needs to know the 
 layout I am using before I start my session.


 On Mon, Mar 4, 2013 at 6:37 PM, Piren gpi...@gmail.com javascript:wrote:

 If you dont want to base on pre-existing values you can just measure your 
 existing views. This will need to happen AFTER the rotation... so your best 
 bet is to refactor your code to work after rotations and not before (which 
 is kind how it should be).

 Why is doing it before the rotation is important to you?


 On Monday, March 4, 2013 5:40:02 PM UTC+2, AndroidCompile wrote:

 Hi,
 I am trying to figure out the screen size I will have in portrait and in 
 landscape at the beginning of my app.
 I can get the real display size using Display.getRealSize() and then 
 calculate the navigation bar height in case there is one.
 However, in devices with 600dp or less the navigation bar can have 
 different heights (depending on orientation) and may even move to the right 
 in landscape mode.
 My app would needs to know these paramters when it begins (the app is 
 connected to a cloud server that receives these dimensions when it connects 
 - so I really need to know these before the app starts doing things).

 My current solution is this:
 id = res.getIdentifier(navigation_**bar_height, dimen, 
 android);
 int navigation_bar_height = res.getDimensionPixelSize(id);

 Although this works, it is never a good practice to use android's 
 internal resources.
 Is there any other way of knowing the dimensions of the screen in a 
 different orientation BEFORE you rotate the device?

  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/android-developers/hnjklrR_IdU/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to 
 android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




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




[android-developers] Help needed

2013-03-05 Thread ramesh babu
hi frnds,
   i am just start learning about android,while i am
developing a simple app i got stuck with these error: Error: No
resource found that matches the given name (at 'title' with value
'@string/action_settings').

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 1:44 AM, RichardC richard.crit...@googlemail.comwrote:


 http://developer.android.com/reference/android/app/Activity.html#isFinishing()


isFinishing() is unfortunately useless for this purpose - it's just 'false'
in both cases, on 2.1, 2.2, 2.3, 4.1 and 4.2 (so I suppose across Android
versions).  And it makes sense, too - the docs you link to state that it
merely indicates whether finish() has been called.  Whether an Activity is
pausing to display another Activity of the same app, or because the user
has pressed Home and is going to the home screen, finish() is usually not
involved, except perhaps under rather specific circumstances.

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




Re: [android-developers] Help needed

2013-03-05 Thread Asheesh Arya
check the project directory name folder  layout ..in layout folder you
find strings.xml  file ..please check your resource whaether you
specify your resources in string.xml or not

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Piren
The obvious way, since it's your app.. just keep a flag saying im starting 
an activity whenever you start the prefs one...



On Tuesday, March 5, 2013 12:52:30 PM UTC+2, latimerius wrote:

 On Tue, Mar 5, 2013 at 1:44 AM, RichardC 
 richard...@googlemail.comjavascript:
  wrote:


 http://developer.android.com/reference/android/app/Activity.html#isFinishing()


 isFinishing() is unfortunately useless for this purpose - it's just 
 'false' in both cases, on 2.1, 2.2, 2.3, 4.1 and 4.2 (so I suppose across 
 Android versions).  And it makes sense, too - the docs you link to state 
 that it merely indicates whether finish() has been called.  Whether an 
 Activity is pausing to display another Activity of the same app, or because 
 the user has pressed Home and is going to the home screen, finish() is 
 usually not involved, except perhaps under rather specific circumstances.
  


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




[android-developers] Re: Help needed

2013-03-05 Thread Gabriel Augusto
Check strings.xml in 'values' folder

Em terça-feira, 5 de março de 2013 07h40min20s UTC-3, ramesh babu escreveu:

 hi frnds, 
i am just start learning about android,while i am 
 developing a simple app i got stuck with these error: Error: No 
 resource found that matches the given name (at 'title' with value 
 '@string/action_settings'). 


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




Re: [android-developers] Re: Help needed

2013-03-05 Thread naresh pedagani
Hi,
remove the code like android:text='@string/action_settings in xml file and
clean the project.then add the code android:text='@string/action_settings,
then it will work.it happens some time if R.java file is not updated.
ThanksRegards,
Naresh


On Tue, Mar 5, 2013 at 5:15 PM, Gabriel Augusto
gabrielaugust...@gmail.comwrote:

 Check strings.xml in 'values' folder

 Em terça-feira, 5 de março de 2013 07h40min20s UTC-3, ramesh babu escreveu:

 hi frnds,
i am just start learning about android,while i am
 developing a simple app i got stuck with these error: Error: No
 resource found that matches the given name (at 'title' with value
 '@string/action_settings').

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




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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 12:13 PM, Piren gpi...@gmail.com wrote:

 The obvious way, since it's your app.. just keep a flag saying im
 starting an activity whenever you start the prefs one...


Yes, that's what I'm doing at the moment.  However, it's getting kludgy
fairly fast.

One problem is deciding what to do when now the PreferenceActivity gets
onPause().  If it's because the user decided to leave the app (e.g. pressed
Home while in prefs), the prefs Activity has to remember the main Activity
has not actually paused properly (as it knew it was only getting onPause()
to display prefs) and has to make sure to finish the pausing.  However, if
the prefs get onPause() because the user pushed Back to return to the main
Activity, it doesn't have to do anything in particular.

So now it's the prefs Activity who needs to understand why it's being
paused.  Except that now it's a bit harder.  When the prefs Activity is
being displayed, it's because the user pushed a button in the main
Activity, so the main Activity knows for sure preferences are coming up.
 The PreferenceActivity has no such thing as a Return to main Activity
button as the only possible way the user could ever leave prefs and return
to main.

Sure, I can monitor Back presses - if Back was pushed before onPause()
we're probably returning to the main Activity, if not we're probably
leaving the app altogether.  The keyword here being probably though as
AFAIK this is not officially documented anywhere.  So it smells like
relying on undocumented behaviour (not that it matters much on Android if
you rely on documented or undocumented ;-)).

While trying to figure out whether Back is the only way of returning from
prefs to main (and also, has it always been so? will it stay that way in
the next Android version?) and googling for an answer I realised I'm not
the first or only one who's trying to solve this.  That's why I'm
wondering, if there is a reasonably elegant and standard way of arranging
things to solve these problems.

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




Re: [android-developers] Re: Help needed

2013-03-05 Thread ramesh babu
thanks bro's problem has been recovered

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
Frankly, I've never been clear on what exactly onDestroy() is good for.  At
any rate, it doesn't seem to be a good match to solve my problem as first,
it's not even guaranteed to be called, and second, even if it is called,
its docs specifically warn against using it to save data, saying that needs
to be done in onPause() - so I'm back to square one.

All in all, a function that may or may not be called isn't a good place to
deal with things that I need to make sure are done, especially if some of
those things are explicitly not recommended to be done in that function. :-(


On Tue, Mar 5, 2013 at 2:38 AM, Lew lewbl...@gmail.com wrote:

 RichardC wrote:

 http://developer.android.com/**reference/android/app/**
 Activity.html#isFinishing()http://developer.android.com/reference/android/app/Activity.html#isFinishing()


  latimerius wrote:

 Hello,

 I would like to be able to tell if Activity.onPause() was called because
 the user is leaving the app, or simply because another Activity within the
 same app is coming up.

 I have a main Activity and a PreferenceActivity.  The main Activity
 needs to handle onPause() differently depending on why it's called.  If the
 user is leaving the app, it needs to stop helper threads, close various
 things like analytics session, deal with GL, save data to SD card etc.
  However, if onPause() is just to display prefs most of that should happen,
 and a bunch of other things should be done instead.

 I'm wondering if there's a framework-supported way to handle this, or at
 least an idiomatic solution, as in a (semi)standard way of managing an
 Activity with heavy set-up and tear-down?


 Also:
 onDestroy(): Called before the activity is destroyed. This is the final
 call that the activity will receive.
 It could be called either because the activity is finishing (someone called
  
 finish()http://developer.android.com/reference/android/app/Activity.html#finish()
  on it), or because
 the system is temporarily destroying this instance of the activity to save
 space. You can distinguish
 between these two scenarios with the 
 isFinishing()http://developer.android.com/reference/android/app/Activity.html#isFinishing()
  method.
 http://developer.android.com/guide/components/activities.html#Lifecycle

 This passage doesn't reveal that 'isFinishing()' is available during
 'onPause()', so it's good to have that
 Javadoc reference that RichardC shared.

 --
 Lew

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




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




Re: [android-developers] Re: Help needed

2013-03-05 Thread ramesh babu
for what purpose findViewById is used

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




Re: [android-developers] Re: Help needed

2013-03-05 Thread naresh pedagani
Hi ,
   findViewById() method is used to get the object of the view.
*example*:
*main.xml* contain one button i want to provide the action for this button,
so we need to create the object in the java file by passing id.
Button
android:id=@+id/btn_New
android:layout_width=wrap_content
android:layout_height=wrap_content
   android:text=new
   /

*MainActivity .java*
public class MainActivity extends Activity {

   protected void onCreate(Bundle icicle) {
   super.onCreate(icicle);
//creation of button object
*Button buttonclickme=(Button)findViewById(r.id.btn_New);*


once we crate the object of the button we can provide action

buttonclickme.setOnClickListener(new View.OnClickListener()
{

 public void onClick(View v)
 {

//here we have to write the code to execute when button clicked.

}}


RegardsRegards,
Naresh.


On Tue, Mar 5, 2013 at 6:06 PM, ramesh babu rameshbabu...@gmail.com wrote:

 for what purpose findViewById is used

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




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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Piren
I see.

I can give you some pointers: 
 - This whole thing seems a bit convoluted, you might be better off taking 
a 5 minute breather and instead of trying to fix the current issue, try to 
figure out how to redesign your app so this issue never arrises... try to 
attack it from a different angle.
 - You dont need to monitor back presses... this is what 
startActivityForResult is for, it lets you know you've returned from a 
different activity that you started.
 - there's no way to quickly close an android app other than backing up 
from all the activities, so unless you've deliberately coded such a thing 
(or used activity reordering techniques), you dont have to worry about that 
happening.
 - There are other ways to go back into Main other then using the Back 
button.. but those are all ways you define - using StartActivity again for 
Main (a flag like CLEAR_TOP and Main being SingleInstance would drop your 
pref activity) so you dont have to worry about that. I did encounter some 
issues in this area when it comes to launching using the icon, but thats 
only if you have multiple entry paths into your app and you like to play 
with activity flags :)


And for the last resort - it's something i've done myself but i'm not quick 
to suggest it: Just keep track of activity lifecycles..I've had to do it 
(for something much more complex than your situation) out as a last option 
so i'm not fully endorsing it, but you can try it yourself.

If you keep track of how many of your activities perform onStart/onStop (a 
simple counter will do) you can easily see a pattern of when the app is in 
the foreground or in the background, wether you're starting new activities 
or them being taken down.  then you should offload the job of deciding when 
to do stuff to something that watches over the counters instead of just the 
onPause of a specific activity.

On Tuesday, March 5, 2013 2:03:29 PM UTC+2, latimerius wrote:

 On Tue, Mar 5, 2013 at 12:13 PM, Piren gpi...@gmail.com javascript:wrote:

 The obvious way, since it's your app.. just keep a flag saying im 
 starting an activity whenever you start the prefs one...


 Yes, that's what I'm doing at the moment.  However, it's getting kludgy 
 fairly fast.

 One problem is deciding what to do when now the PreferenceActivity gets 
 onPause().  If it's because the user decided to leave the app (e.g. pressed 
 Home while in prefs), the prefs Activity has to remember the main Activity 
 has not actually paused properly (as it knew it was only getting onPause() 
 to display prefs) and has to make sure to finish the pausing.  However, if 
 the prefs get onPause() because the user pushed Back to return to the main 
 Activity, it doesn't have to do anything in particular.

 So now it's the prefs Activity who needs to understand why it's being 
 paused.  Except that now it's a bit harder.  When the prefs Activity is 
 being displayed, it's because the user pushed a button in the main 
 Activity, so the main Activity knows for sure preferences are coming up. 
  The PreferenceActivity has no such thing as a Return to main Activity 
 button as the only possible way the user could ever leave prefs and return 
 to main.

 Sure, I can monitor Back presses - if Back was pushed before onPause() 
 we're probably returning to the main Activity, if not we're probably 
 leaving the app altogether.  The keyword here being probably though as 
 AFAIK this is not officially documented anywhere.  So it smells like 
 relying on undocumented behaviour (not that it matters much on Android if 
 you rely on documented or undocumented ;-)).

 While trying to figure out whether Back is the only way of returning from 
 prefs to main (and also, has it always been so? will it stay that way in 
 the next Android version?) and googling for an answer I realised I'm not 
 the first or only one who's trying to solve this.  That's why I'm 
 wondering, if there is a reasonably elegant and standard way of arranging 
 things to solve these problems.



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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
As for rethinking the whole issue, the only thing I can think of is to get
rid of the PreferenceActivity.  I had the same problems a couple of months
ago with the standard activity chooser for an Intent which is an Activity
itself (never figured out why) so it caused spurious onPause()/onResume()
on the main Activity.  I ended up reimplementing it as a Dialog. :-(
 However I fear redoing PreferenceActivity as a Dialog might be a
considerably bigger job.

I'd prefer not to do anything complex, precisely because as you mention, my
situation is close to trivial - just two Activities, no fancy stack
manipulations, no fancy nothing - it's the main Activity 99% of the time,
with preferences coming up once in a while, just the main Activity
onPause()/onResume() depends on the particular state transition, by nature
of what it does.

I must be missing something (like onPause()/onResume() on the whole
application or something) - it can't be that Android application
architecture is forced to fall apart into a bunch of Activities who can't
coordinate among themselves efficiently...


On Tue, Mar 5, 2013 at 1:59 PM, Piren gpi...@gmail.com wrote:

 I see.

 I can give you some pointers:
  - This whole thing seems a bit convoluted, you might be better off taking
 a 5 minute breather and instead of trying to fix the current issue, try to
 figure out how to redesign your app so this issue never arrises... try to
 attack it from a different angle.
  - You dont need to monitor back presses... this is what
 startActivityForResult is for, it lets you know you've returned from a
 different activity that you started.
  - there's no way to quickly close an android app other than backing up
 from all the activities, so unless you've deliberately coded such a thing
 (or used activity reordering techniques), you dont have to worry about that
 happening.
  - There are other ways to go back into Main other then using the Back
 button.. but those are all ways you define - using StartActivity again for
 Main (a flag like CLEAR_TOP and Main being SingleInstance would drop your
 pref activity) so you dont have to worry about that. I did encounter some
 issues in this area when it comes to launching using the icon, but thats
 only if you have multiple entry paths into your app and you like to play
 with activity flags :)


 And for the last resort - it's something i've done myself but i'm not
 quick to suggest it: Just keep track of activity lifecycles..I've had to do
 it (for something much more complex than your situation) out as a last
 option so i'm not fully endorsing it, but you can try it yourself.

 If you keep track of how many of your activities perform onStart/onStop (a
 simple counter will do) you can easily see a pattern of when the app is in
 the foreground or in the background, wether you're starting new activities
 or them being taken down.  then you should offload the job of deciding when
 to do stuff to something that watches over the counters instead of just the
 onPause of a specific activity.

 On Tuesday, March 5, 2013 2:03:29 PM UTC+2, latimerius wrote:

 On Tue, Mar 5, 2013 at 12:13 PM, Piren gpi...@gmail.com wrote:

 The obvious way, since it's your app.. just keep a flag saying im
 starting an activity whenever you start the prefs one...


 Yes, that's what I'm doing at the moment.  However, it's getting kludgy
 fairly fast.

 One problem is deciding what to do when now the PreferenceActivity gets
 onPause().  If it's because the user decided to leave the app (e.g. pressed
 Home while in prefs), the prefs Activity has to remember the main Activity
 has not actually paused properly (as it knew it was only getting onPause()
 to display prefs) and has to make sure to finish the pausing.  However, if
 the prefs get onPause() because the user pushed Back to return to the main
 Activity, it doesn't have to do anything in particular.

 So now it's the prefs Activity who needs to understand why it's being
 paused.  Except that now it's a bit harder.  When the prefs Activity is
 being displayed, it's because the user pushed a button in the main
 Activity, so the main Activity knows for sure preferences are coming up.
  The PreferenceActivity has no such thing as a Return to main Activity
 button as the only possible way the user could ever leave prefs and return
 to main.

 Sure, I can monitor Back presses - if Back was pushed before onPause()
 we're probably returning to the main Activity, if not we're probably
 leaving the app altogether.  The keyword here being probably though as
 AFAIK this is not officially documented anywhere.  So it smells like
 relying on undocumented behaviour (not that it matters much on Android if
 you rely on documented or undocumented ;-)).

 While trying to figure out whether Back is the only way of returning from
 prefs to main (and also, has it always been so? will it stay that way in
 the next Android version?) and googling for an answer I realised I'm not
 the first or only one who's 

Re: [android-developers] Re: Help needed

2013-03-05 Thread ramesh babu
thanks naresh bro

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




[android-developers] Re: Customizing progress Dialogs

2013-03-05 Thread bob
Here's one method you can use:

* Dialog d = new Dialog(this);*
* d.getWindow().setBackgroundDrawableResource(R.drawable.transparent);*
* d.setContentView(new ProgressBar(this));*
* d.show();*

Of course you will need a transparent PNG in your drawable folder.

Thanks.


On Tuesday, February 12, 2013 10:40:58 PM UTC-6, Ansh wrote:

 Hi Guys ,

 I want to customize the progress dialog for my app.I want to show only 
 spinner spinning without the black background.I have googled a lot but 
 nothings seems to be working.Please tell me how can i achieve that effect. 


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




[android-developers] Re: problem in detecting samsung android tablet 2 P5100

2013-03-05 Thread bob
 

Are you talking about the Galaxy Tab 2?


Thanks.



On Monday, March 4, 2013 9:40:56 PM UTC-6, |-NK-| wrote:

 I have enabled Usb debugging.
 However i am not sure whether installing kies will install adb drivers.
 So do u know where can I find adb drivers for that specific tablet.

 Thanks 


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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Piren
Not sure what the issues you mention, never had those... onPause/onResume 
are pretty much the only lifecycle events that are constant in behavior :)

The way you describe it, it should be simple, so not sure what you're 
missing... I suggest you stop using the Pref's activity onResume/onPause to 
decide anything in the app (other than saving the prefs themselves) and 
instead base on the Main activity's onStop/onActivityResult

it can't be that Android application architecture is forced to fall apart 
 into a bunch of Activities who can't coordinate among themselves 
 efficiently...


Thats exactly how android is designed... Android is completely designed 
around the fact that each activity is its own world and should not depend 
on any other activity. Each activity is its own application.. they state 
it several times in their documentation. It makes sense for a lot of 
things, but it makes life hard for people making enterprise applications 
that do have a flows inside the app that mean acitivies might be 
dependant on each other (and passing a small bunch of primitives wont cut 
it). 

This is probably why there's no simple way for an activity to know if your 
app is closed or just sent to the background (on the iPhone its easy.. 
you're either in the foreground or you're in the background.. it even tells 
you when you switch between those... no such thing on Android).



On Tuesday, March 5, 2013 4:08:07 PM UTC+2, latimerius wrote:

 As for rethinking the whole issue, the only thing I can think of is to get 
 rid of the PreferenceActivity.  I had the same problems a couple of months 
 ago with the standard activity chooser for an Intent which is an Activity 
 itself (never figured out why) so it caused spurious onPause()/onResume() 
 on the main Activity.  I ended up reimplementing it as a Dialog. :-( 
  However I fear redoing PreferenceActivity as a Dialog might be a 
 considerably bigger job.

 I'd prefer not to do anything complex, precisely because as you mention, 
 my situation is close to trivial - just two Activities, no fancy stack 
 manipulations, no fancy nothing - it's the main Activity 99% of the time, 
 with preferences coming up once in a while, just the main Activity 
 onPause()/onResume() depends on the particular state transition, by nature 
 of what it does.

 I must be missing something (like onPause()/onResume() on the whole 
 application or something) - it can't be that Android application 
 architecture is forced to fall apart into a bunch of Activities who can't 
 coordinate among themselves efficiently...


 On Tue, Mar 5, 2013 at 1:59 PM, Piren gpi...@gmail.com javascript:wrote:

 I see.

 I can give you some pointers: 
  - This whole thing seems a bit convoluted, you might be better off 
 taking a 5 minute breather and instead of trying to fix the current issue, 
 try to figure out how to redesign your app so this issue never arrises... 
 try to attack it from a different angle.
  - You dont need to monitor back presses... this is what 
 startActivityForResult is for, it lets you know you've returned from a 
 different activity that you started.
  - there's no way to quickly close an android app other than backing up 
 from all the activities, so unless you've deliberately coded such a thing 
 (or used activity reordering techniques), you dont have to worry about that 
 happening.
  - There are other ways to go back into Main other then using the Back 
 button.. but those are all ways you define - using StartActivity again for 
 Main (a flag like CLEAR_TOP and Main being SingleInstance would drop your 
 pref activity) so you dont have to worry about that. I did encounter some 
 issues in this area when it comes to launching using the icon, but thats 
 only if you have multiple entry paths into your app and you like to play 
 with activity flags :)


 And for the last resort - it's something i've done myself but i'm not 
 quick to suggest it: Just keep track of activity lifecycles..I've had to do 
 it (for something much more complex than your situation) out as a last 
 option so i'm not fully endorsing it, but you can try it yourself.

 If you keep track of how many of your activities perform onStart/onStop 
 (a simple counter will do) you can easily see a pattern of when the app is 
 in the foreground or in the background, wether you're starting new 
 activities or them being taken down.  then you should offload the job of 
 deciding when to do stuff to something that watches over the counters 
 instead of just the onPause of a specific activity.

 On Tuesday, March 5, 2013 2:03:29 PM UTC+2, latimerius wrote:

 On Tue, Mar 5, 2013 at 12:13 PM, Piren gpi...@gmail.com wrote:

 The obvious way, since it's your app.. just keep a flag saying im 
 starting an activity whenever you start the prefs one...


 Yes, that's what I'm doing at the moment.  However, it's getting kludgy 
 fairly fast.

 One problem is deciding what to do when now the PreferenceActivity gets 
 onPause().  

[android-developers] Ethernet connection force IP

2013-03-05 Thread Marta Ribeiro
I'm trying to connect a DSP to a samsung galaxy via an USB/Ethernet dungle. 
The problem is the android is not to be connected to any wi-fi, but i stull 
need an IP adress, as i need to tell the DSPto the send to an IP adress 
(which would be the IP of the samsung galaxy). Is there any way to force 
the samsung galaxy to have an IP adress, or even recognize an ethernet 
connection and produce an IP adress?

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 4:41 PM, Piren gpi...@gmail.com wrote:

 Not sure what the issues you mention, never had those... onPause/onResume
 are pretty much the only lifecycle events that are constant in behavior :)


I described it in my original post - in short, if the main activity is
being paused because the user is leaving the app, a lot of things have to
be closed, saved, cleaned up etc.  If it's being paused just to show
preferences, those things should not happen.


 The way you describe it, it should be simple, so not sure what you're
 missing... I suggest you stop using the Pref's activity onResume/onPause to
 decide anything in the app (other than saving the prefs themselves) and
 instead base on the Main activity's onStop/onActivityResult


I'm not keen to make decisions in prefs activity's onPause() (and I'm not
doing it yet) but it kind of follows from having to make decisions in the
main activity's onPause().  As a simple example, if the main activity is
being paused just to show preferences, it doesn't stop music playback.
 Now, on pausing the prefs activity, you have to decide - if you're going
back to the main activity you leave music playing.  If you're leaving the
app entirely, you must stop it.



 it can't be that Android application architecture is forced to fall apart
 into a bunch of Activities who can't coordinate among themselves
 efficiently...


 Thats exactly how android is designed... Android is completely designed
 around the fact that each activity is its own world and should not depend
 on any other activity. Each activity is its own application.. they state
 it several times in their documentation.


If that's the case the only solution is to get rid of the
PreferenceActivity and make it a law that the app will always be using
precisely one Activity - the main one.

Do you happen to know what it would take to replace PreferenceActivity with
a full-screen Dialog?

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Piren


 I described it in my original post - in short, if the main activity is 
 being paused because the user is leaving the app, a lot of things have to 
 be closed, saved, cleaned up etc.  If it's being paused just to show 
 preferences, those things should not happen.


Oh,, i thought you meant you had issue with the event itself.. o 

I'm not keen to make decisions in prefs activity's onPause() (and I'm not 
 doing it yet) but it kind of follows from having to make decisions in the 
 main activity's onPause().  As a simple example, if the main activity is 
 being paused just to show preferences, it doesn't stop music playback. 
  Now, on pausing the prefs activity, you have to decide - if you're going 
 back to the main activity you leave music playing.  If you're leaving the 
 app entirely, you must stop it.


In the example you describe, its rather simple to solve. If you want to 
stop the music when the user leaves the app as in Backs out of it (pressing 
home doesnt count), you should stop it in the onBackPressed of the Main 
activity (pref's have nothing to do with it). If you want to stop it even 
if the user presses Home, then you have several options:
- Check IsFinishing() in Pref's onStop ... a False means the user pressed 
Home, True means the user pressed Back. if its False, stop the music.
- Dont use a different Activity to show Prefs (you can re-use your current 
one, i personally always disliked the PreferencesActivity class.. its ugly 
as fuck)
- Dont make the Pref's activity opaque or full screen. If you can still 
visibly see the Main activity, it would not call onStop... thus it can 
handle the Music on its own and Pref needs not touch it. 
- Or as last choice - Track the amount of onStart activities you have. 
you'll 0 zero when the app is backgrounded, but 1 when you just press Back 
on Prefs.


If that's the case the only solution is to get rid of the 
 PreferenceActivity and make it a law that the app will always be using 
 precisely one Activity - the main one.
 Do you happen to know what it would take to replace PreferenceActivity 
 with a full-screen Dialog?


Try the other choices before going on that route :) Besides, it doesnt have 
to be a dialog... you can either just replace your current contentView or 
use other containers like ViewSwitcher/ViewPager and etc  to switch between 
the main app and the preferences view.  

On Tuesday, March 5, 2013 6:14:42 PM UTC+2, latimerius wrote:

 On Tue, Mar 5, 2013 at 4:41 PM, Piren gpi...@gmail.com javascript:wrote:

 Not sure what the issues you mention, never had those... onPause/onResume 
 are pretty much the only lifecycle events that are constant in behavior :)


 I described it in my original post - in short, if the main activity is 
 being paused because the user is leaving the app, a lot of things have to 
 be closed, saved, cleaned up etc.  If it's being paused just to show 
 preferences, those things should not happen.
  

 The way you describe it, it should be simple, so not sure what you're 
 missing... I suggest you stop using the Pref's activity onResume/onPause to 
 decide anything in the app (other than saving the prefs themselves) and 
 instead base on the Main activity's onStop/onActivityResult


 I'm not keen to make decisions in prefs activity's onPause() (and I'm not 
 doing it yet) but it kind of follows from having to make decisions in the 
 main activity's onPause().  As a simple example, if the main activity is 
 being paused just to show preferences, it doesn't stop music playback. 
  Now, on pausing the prefs activity, you have to decide - if you're going 
 back to the main activity you leave music playing.  If you're leaving the 
 app entirely, you must stop it.
  


 it can't be that Android application architecture is forced to fall apart 
 into a bunch of Activities who can't coordinate among themselves 
 efficiently...


 Thats exactly how android is designed... Android is completely designed 
 around the fact that each activity is its own world and should not depend 
 on any other activity. Each activity is its own application.. they state 
 it several times in their documentation.


 If that's the case the only solution is to get rid of the 
 PreferenceActivity and make it a law that the app will always be using 
 precisely one Activity - the main one.

 Do you happen to know what it would take to replace PreferenceActivity 
 with a full-screen Dialog?



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

[android-developers] Imageview not Showing Image on Android 2.2 and not on Android 4.0

2013-03-05 Thread Brad Stintson
I wrote following code in xml file but Imageview (shown in bold) not
Showing Image on Android 2.2 and not on Android 4.0

Please help out.



LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
xmlns:tools=http://schemas.android.com/tools;
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

LinearLayout
android:layout_width=fill_parent
android:layout_height=fill_parent
android:layout_gravity=fill
android:layout_weight=1 

ScrollView
android:layout_width=wrap_content
android:layout_height=wrap_content
android:id=@+id/imgScrollView 

*ImageView*
*android:id=@+id/imageView1*
*android:layout_width=fill_parent*
*android:layout_height=wrap_content*
*android:adjustViewBounds=true*
*   /*
/ScrollView
/LinearLayout

!-- Player Footer --

LinearLayout
android:id=@+id/player_footer_bg
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_weight=0
android:background=@layout/bg_player_footer
android:gravity=center
android:orientation=vertical

!-- Timer Display --

LinearLayout
android:id=@+id/timerDisplay
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_marginBottom=2dp
android:layout_marginLeft=20dp
android:layout_marginRight=20dp 

!-- Current Duration Label --

TextView
android:id=@+id/songCurrentDurationLabel
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_weight=1
android:gravity=left
android:textColor=#ee
android:textStyle=bold /
!-- Total Duration Label --

TextView
android:id=@+id/songTotalDurationLabel
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_weight=1
android:gravity=right
android:textColor=#04cbde
android:textStyle=bold /
/LinearLayout
!-- Progress Bar/Seek bar --

SeekBar
android:id=@+id/songProgressBar
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_marginBottom=2dp
android:layout_marginLeft=20dp
android:layout_marginRight=20dp
android:progressDrawable=@drawable/seekbar_progress
android:thumb=@drawable/seek_handler /

!-- Player Buttons --

LinearLayout
android:layout_width=wrap_content
android:layout_height=wrap_content
android:background=@layout/rounded_corner
android:gravity=center_vertical
android:orientation=horizontal
android:paddingLeft=10dp
android:paddingRight=10dp 

!-- Backward Button --

ImageButton
android:id=@+id/btnBackward
android:layout_width=wrap_content
android:layout_height=wrap_content
android:background=@null
android:src=@drawable/btn_backward /
!-- Play Button --

ImageButton
android:id=@+id/btnPlay
android:layout_width=wrap_content
android:layout_height=wrap_content
android:background=@null
android:src=@drawable/btn_play /
!-- Forward Button --

ImageButton
android:id=@+id/btnForward
android:layout_width=wrap_content
android:layout_height=wrap_content
android:background=@null
android:src=@drawable/btn_forward /
/LinearLayout
/LinearLayout

/LinearLayout

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




Re: [android-developers] Android Tablet Devlopment

2013-03-05 Thread Brad Stintson
Ideally minimum level should be 2.2 and maximum to available SDK. (4.1 or
so).


On Mon, Mar 4, 2013 at 2:43 PM, Rahul Kaushik rahulkaushi...@gmail.comwrote:

 Hi Team,

 I am developing an hybrid app in android ,I want this app for my android
 phone and tablet also which Build SDKAnd Minimum  Required SDK(API) i
 should use

 Thank's
 RK

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




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




Re: [android-developers] Imageview not Showing Image on Android 2.2 and not on Android 4.0

2013-03-05 Thread Belhouchet Ines
Try with diffrent size
Le 5 mars 2013 17:50, Brad Stintson geek.bin...@gmail.com a écrit :

 I wrote following code in xml file but Imageview (shown in bold) not
Showing Image on Android 2.2 and not on Android 4.0

 Please help out.



 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 xmlns:tools=http://schemas.android.com/tools;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 LinearLayout
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:layout_gravity=fill
 android:layout_weight=1 

 ScrollView
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:id=@+id/imgScrollView 

 ImageView
 android:id=@+id/imageView1
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:adjustViewBounds=true
/
 /ScrollView
 /LinearLayout

 !-- Player Footer --

 LinearLayout
 android:id=@+id/player_footer_bg
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=0
 android:background=@layout/bg_player_footer
 android:gravity=center
 android:orientation=vertical

 !-- Timer Display --

 LinearLayout
 android:id=@+id/timerDisplay
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_marginBottom=2dp
 android:layout_marginLeft=20dp
 android:layout_marginRight=20dp 

 !-- Current Duration Label --

 TextView
 android:id=@+id/songCurrentDurationLabel
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=1
 android:gravity=left
 android:textColor=#ee
 android:textStyle=bold /
 !-- Total Duration Label --

 TextView
 android:id=@+id/songTotalDurationLabel
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=1
 android:gravity=right
 android:textColor=#04cbde
 android:textStyle=bold /
 /LinearLayout
 !-- Progress Bar/Seek bar --

 SeekBar
 android:id=@+id/songProgressBar
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_marginBottom=2dp
 android:layout_marginLeft=20dp
 android:layout_marginRight=20dp
 android:progressDrawable=@drawable/seekbar_progress
 android:thumb=@drawable/seek_handler /

 !-- Player Buttons --

 LinearLayout
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@layout/rounded_corner
 android:gravity=center_vertical
 android:orientation=horizontal
 android:paddingLeft=10dp
 android:paddingRight=10dp 

 !-- Backward Button --

 ImageButton
 android:id=@+id/btnBackward
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_backward /
 !-- Play Button --

 ImageButton
 android:id=@+id/btnPlay
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_play /
 !-- Forward Button --

 ImageButton
 android:id=@+id/btnForward
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_forward /
 /LinearLayout
 /LinearLayout

 /LinearLayout

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

Re: [android-developers] Imageview not Showing Image on Android 2.2 and not on Android 4.0

2013-03-05 Thread Brad Stintson
I tried on 3 different devices with android 4.0. But it is not showing.

A white screen is shown, with scroll bar of height equivalent to height of
image, which means that image is loaded. I am not able to understand why it
is not showing then.


On Tue, Mar 5, 2013 at 10:24 PM, Belhouchet Ines
belhouchet.i...@gmail.comwrote:

 Try with diffrent size
 Le 5 mars 2013 17:50, Brad Stintson geek.bin...@gmail.com a écrit :

 
  I wrote following code in xml file but Imageview (shown in bold) not
 Showing Image on Android 2.2 and not on Android 4.0
 
  Please help out.
 
 
 
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
  xmlns:tools=http://schemas.android.com/tools;
  android:layout_width=match_parent
  android:layout_height=match_parent
  android:orientation=vertical 
 
  LinearLayout
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:layout_gravity=fill
  android:layout_weight=1 
 
  ScrollView
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:id=@+id/imgScrollView 
 
  ImageView
  android:id=@+id/imageView1
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:adjustViewBounds=true
 /
  /ScrollView
  /LinearLayout
 
  !-- Player Footer --
 
  LinearLayout
  android:id=@+id/player_footer_bg
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:layout_weight=0
  android:background=@layout/bg_player_footer
  android:gravity=center
  android:orientation=vertical
 
  !-- Timer Display --
 
  LinearLayout
  android:id=@+id/timerDisplay
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:layout_marginBottom=2dp
  android:layout_marginLeft=20dp
  android:layout_marginRight=20dp 
 
  !-- Current Duration Label --
 
  TextView
  android:id=@+id/songCurrentDurationLabel
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:layout_weight=1
  android:gravity=left
  android:textColor=#ee
  android:textStyle=bold /
  !-- Total Duration Label --
 
  TextView
  android:id=@+id/songTotalDurationLabel
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:layout_weight=1
  android:gravity=right
  android:textColor=#04cbde
  android:textStyle=bold /
  /LinearLayout
  !-- Progress Bar/Seek bar --
 
  SeekBar
  android:id=@+id/songProgressBar
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:layout_marginBottom=2dp
  android:layout_marginLeft=20dp
  android:layout_marginRight=20dp
  android:progressDrawable=@drawable/seekbar_progress
  android:thumb=@drawable/seek_handler /
 
  !-- Player Buttons --
 
  LinearLayout
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:background=@layout/rounded_corner
  android:gravity=center_vertical
  android:orientation=horizontal
  android:paddingLeft=10dp
  android:paddingRight=10dp 
 
  !-- Backward Button --
 
  ImageButton
  android:id=@+id/btnBackward
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:background=@null
  android:src=@drawable/btn_backward /
  !-- Play Button --
 
  ImageButton
  android:id=@+id/btnPlay
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:background=@null
  android:src=@drawable/btn_play /
  !-- Forward Button --
 
  ImageButton
  android:id=@+id/btnForward
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:background=@null
  android:src=@drawable/btn_forward /
  /LinearLayout
  /LinearLayout
 
  /LinearLayout
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this 

Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread TreKing
On Tue, Mar 5, 2013 at 10:14 AM, Latimerius l4t1m3r...@gmail.com wrote:

 On Tue, Mar 5, 2013 at 4:41 PM, Piren gpi...@gmail.com wrote:

 Not sure what the issues you mention, never had those... onPause/onResume
 are pretty much the only lifecycle events that are constant in behavior :)


 I described it in my original post - in short, if the main activity is
 being paused because the user is leaving the app, a lot of things have to
 be closed, saved, cleaned up etc.  If it's being paused just to show
 preferences, those things should not happen.


I may have misses something, but from what you've described, I think you
might be overcomplicating things and should probably just be using the
lifecycle events. In this case, onDestroy for all this cleanup. onDestroy
will be called when the user leaves the app by pressing back. It will NOT
be called when they press Home, but that's expected because they're not *
leaving* the app, they're merely sending it to the background, so your app
should not completely shut down and should be ready to quickly resume
should the user switch back to it.

Eventually, if the user never returns to your app, it will be killed off by
the system and whether or not onDestroy gets called all your stuff will be
closed anyway.

However, if this is for a game, then I believe those are usually
implemented with a single Activity to allow you to better control resources
like graphics and music. Then you don't have the music playing issue you
describe since you just handle onPause / onStop to pause the music.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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




Re: [android-developers] Imageview not Showing Image on Android 2.2 and not on Android 4.0

2013-03-05 Thread TreKing
On Tue, Mar 5, 2013 at 10:46 AM, Brad Stintson geek.bin...@gmail.comwrote:

 I wrote following code in xml file but Imageview (shown in bold) not
 Showing Image on Android 2.2 and not on Android 4.0


You need to provide a little more info then that. Maybe post a screenshot
to show the problem too.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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




[android-developers] Re: problem in detecting samsung android tablet 2 P5100

2013-03-05 Thread |-NK-|
Yes. I am referring to 
samsung galaxy tab2 GT-P5100

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




[android-developers] Re: problem in detecting samsung android tablet 2 P5100

2013-03-05 Thread |-NK-|
Yes. I am referring to 
samsung galaxy tab2 GT-P5100

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 5:41 PM, Piren gpi...@gmail.com wrote:

 - Dont use a different Activity to show Prefs (you can re-use your current
 one, i personally always disliked the PreferencesActivity class.. its ugly
 as fuck)



 you can either just replace your current contentView or use other
 containers like ViewSwitcher/ViewPager and etc  to switch between the main
 app and the preferences view.


Thanks for pointing this out, it never occurred to me that I could reuse my
main activity instance... clever. :-)  Now trying to figure out how to
construct the preferences view.  I'm also using
PreferenceActivity.onSharedPreferenceChanged() so I'll have to have a
replacement for that too.

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 6:09 PM, TreKing treking...@gmail.com wrote:


 On Tue, Mar 5, 2013 at 10:14 AM, Latimerius l4t1m3r...@gmail.com wrote:

 On Tue, Mar 5, 2013 at 4:41 PM, Piren gpi...@gmail.com wrote:

 Not sure what the issues you mention, never had those...
 onPause/onResume are pretty much the only lifecycle events that are
 constant in behavior :)


 I described it in my original post - in short, if the main activity is
 being paused because the user is leaving the app, a lot of things have to
 be closed, saved, cleaned up etc.  If it's being paused just to show
 preferences, those things should not happen.


 I may have misses something, but from what you've described, I think you
 might be overcomplicating things and should probably just be using the
 lifecycle events. In this case, onDestroy for all this cleanup. onDestroy
 will be called when the user leaves the app by pressing back. It will NOT
 be called when they press Home, but that's expected because they're not *
 leaving* the app, they're merely sending it to the background, so your
 app should not completely shut down and should be ready to quickly resume
 should the user switch back to it.

 Eventually, if the user never returns to your app, it will be killed off
 by the system and whether or not onDestroy gets called all your stuff will
 be closed anyway.


Unfortunately, onDestroy() is really too late for the requirements I have.
 I shouldn't keep threads running until onDestroy() as that could eat quite
a lot of battery power over time.  Also, audio has to be stopped as soon as
user leaves the app.  The same goes for analytics session, it should to be
closed right when the user leaves otherwise it would be hard to get
accurate data about session length.  And for saving data, onDestroy() is
explicitly documented to be a bad choice.

For all of these things, there's the ideal place to perform them -
onPause(), but only if it means the user is leaving the app.  You don't
want to do any of those just because you need to display what amounts to a
bloody dialog. ;-)


 However, if this is for a game, then I believe those are usually
 implemented with a single Activity to allow you to better control resources
 like graphics and music. Then you don't have the music playing issue you
 describe since you just handle onPause / onStop to pause the music.


Yes, it is a game (a toy, more precisely), and I'm just in the process of
figuring out how to make sure I'll only ever have a single activity (which
means at the moment how to get rid of my PreferenceActivity).

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread TreKing
On Tue, Mar 5, 2013 at 11:43 AM, Latimerius l4t1m3r...@gmail.com wrote:

 Unfortunately, onDestroy() is really too late for the requirements I have.
  I shouldn't keep threads running until onDestroy() as that could eat quite
 a lot of battery power over time.


Threads you can start and stop with onPause / onResume. Assuming it's that
simple in your case (I'm going to guess it's not =P )


 Also, audio has to be stopped as soon as user leaves the app.


This can also be stopped / resumed with onPause / onResume. I assume - I
haven't needed custom audio in my app.


  The same goes for analytics session, it should to be closed right when
 the user leaves otherwise it would be hard to get accurate data about
 session length.


That's tricky, even without your specific requirements. A session in
Android is notoriously hard to determine.


   And for saving data, onDestroy() is explicitly documented to be a bad
 choice.


Absolutely - I was suggesting onDestroy for all the clean up you stated you
needed to do.

Anyhow, you know your requirements better than I - just putting out some
food for thought. Good luck.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 6:58 PM, TreKing treking...@gmail.com wrote:


 Threads you can start and stop with onPause / onResume. Assuming it's that
 simple in your case (I'm going to guess it's not =P )


Admittedly, I could probably stop my game thread in the main activity
onPause() and resume it in my preference activity onResume() (if that's
reached) - perhaps bit kludgy but OK.

I'm not quite sure about the rendering thread though - that's controlled by
GLSurfaceView and I'm afraid I can't just pause it with no other
side-effects.  I think the only way would be to
call GLSurfaceView.onPause() which however also means a lot of other
undesirable things including GL context loss and the subsequent need to
reload all geometry and textures.


 Also, audio has to be stopped as soon as user leaves the app.


 This can also be stopped / resumed with onPause / onResume. I assume - I
 haven't needed custom audio in my app.


That would mean an audible drop-out I'm afraid.


  The same goes for analytics session, it should to be closed right when
 the user leaves otherwise it would be hard to get accurate data about
 session length.


 That's tricky, even without your specific requirements. A session in
 Android is notoriously hard to determine.


Sure, sure.  We consciously limit ourselves to just time the app spent on
screen - a crude measure by itself, I know, but why make it even less
precise. ;-)


   And for saving data, onDestroy() is explicitly documented to be a bad
 choice.


 Absolutely - I was suggesting onDestroy for all the clean up you stated
 you needed to do.

 Anyhow, you know your requirements better than I - just putting out some
 food for thought. Good luck.


Thanks for taking interest in my problem!

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




[android-developers] Re: problem in detecting samsung android tablet 2 P5100

2013-03-05 Thread bob
Okay, this sounds like the 10.1 inch version.

You should be able to get the drivers here:

http://www.samsung.com/us/support/owners/product/GT-P5113TSYXAR

What version of Windows do you have?


https://lh6.googleusercontent.com/-3eeNPjgecWA/UTY_f5vwwLI/ATw/RMFXrx2jd9g/s1600/samsung.png



On Tuesday, March 5, 2013 11:16:33 AM UTC-6, |-NK-| wrote:

 Yes. I am referring to 
 samsung galaxy tab2 GT-P5100


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




[android-developers] Re: Android Tablet Devlopment

2013-03-05 Thread bob
 

What version of Android are your devices running?


You can see this in the *Settings* App if you go to the bottom option - *About 
tablet*.





On Monday, March 4, 2013 3:13:52 AM UTC-6, rahul kaushik wrote:

 Hi Team,

 I am developing an hybrid app in android ,I want this app for my android 
 phone and tablet also which Build SDKAnd Minimum  Required SDK(API) i 
 should use

 Thank's
 RK


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




[android-developers] Re: Imageview not Showing Image on Android 2.2 and not on Android 4.0

2013-03-05 Thread bob
 

Why would you have a ScrollView where the width and height are set to *
wrap_content*?


How will it ever have anything to scroll if it is always sized to its 
content?




On Tuesday, March 5, 2013 10:46:22 AM UTC-6, Geek wrote:

 I wrote following code in xml file but Imageview (shown in bold) not 
 Showing Image on Android 2.2 and not on Android 4.0

 Please help out.



 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 xmlns:tools=http://schemas.android.com/tools;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 LinearLayout
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:layout_gravity=fill
 android:layout_weight=1 

 ScrollView
 android:layout_width=wrap_content
 android:layout_height=wrap_content  
 android:id=@+id/imgScrollView 

 *ImageView*
 *android:id=@+id/imageView1*
 *android:layout_width=fill_parent*
 *android:layout_height=wrap_content*
 *android:adjustViewBounds=true*
 *   /*
 /ScrollView
 /LinearLayout

 !-- Player Footer --

 LinearLayout
 android:id=@+id/player_footer_bg
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=0
 android:background=@layout/bg_player_footer
 android:gravity=center
 android:orientation=vertical

 !-- Timer Display --

 LinearLayout
 android:id=@+id/timerDisplay
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_marginBottom=2dp
 android:layout_marginLeft=20dp
 android:layout_marginRight=20dp 

 !-- Current Duration Label --

 TextView
 android:id=@+id/songCurrentDurationLabel
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=1
 android:gravity=left
 android:textColor=#ee
 android:textStyle=bold /
 !-- Total Duration Label --

 TextView
 android:id=@+id/songTotalDurationLabel
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_weight=1
 android:gravity=right
 android:textColor=#04cbde
 android:textStyle=bold /
 /LinearLayout
 !-- Progress Bar/Seek bar --

 SeekBar
 android:id=@+id/songProgressBar
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:layout_marginBottom=2dp
 android:layout_marginLeft=20dp
 android:layout_marginRight=20dp
 android:progressDrawable=@drawable/seekbar_progress
 android:thumb=@drawable/seek_handler /

 !-- Player Buttons --

 LinearLayout
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@layout/rounded_corner
 android:gravity=center_vertical
 android:orientation=horizontal
 android:paddingLeft=10dp
 android:paddingRight=10dp 

 !-- Backward Button --

 ImageButton
 android:id=@+id/btnBackward
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_backward /
 !-- Play Button --

 ImageButton
 android:id=@+id/btnPlay
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_play /
 !-- Forward Button --

 ImageButton
 android:id=@+id/btnForward
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@null
 android:src=@drawable/btn_forward /
 /LinearLayout
 /LinearLayout

 /LinearLayout


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

[android-developers] Re: Edit Text

2013-03-05 Thread bob
Maybe create a TextWatcher subclass and call this method?

/**
 * Adds a TextWatcher to the list of those whose methods are called
 * whenever this TextView's text changes.
 * p
 * In 1.0, the {@link TextWatcher#afterTextChanged} method was 
erroneously
 * not called after {@link #setText} calls.  Now, doing {@link #setText}
 * if there are any text changed listeners forces the buffer type to
 * Editable if it would not otherwise be and does call this method.
 */
public void *addTextChangedListener*(TextWatcher watcher) {
if (mListeners == null) {
mListeners = new ArrayListTextWatcher();
}

mListeners.add(watcher);
}



On Friday, March 1, 2013 5:54:39 AM UTC-6, Arun Kumar K wrote:

 Hi Guys,

 I have one problem in edit textif i enter the number in edit text i 
 want to display like this 1234-5678-9102-3214

 Constrain is
 Input Type=number
 maximumlength=19


 how can i do this one pls help me

 -- 
 *Thanks  Regards*
 *K.Arun Kumar*
  
  

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




[android-developers] Re: YouTube Video is not populating in list

2013-03-05 Thread bob
What does the exact XML look like?

Also, what happens when you put the XML into an XML validator?  
(such as the one at *http://www.w3schools.com/xml/xml_validator.asp*)

Thanks.



On Friday, March 1, 2013 6:13:09 AM UTC-6, Milind wrote:

 Dear All,

 I am a beginner in Android and I have to develop an application that plays 
 video from YouTube.com. I have playlist and some videos in it so I have to 
 list these videos first. I populated playlists in my list view but I cannot 
 extract videos list in playlist. It is giving me XML parsing exception. Can 
 you help me?

 My code is as below.

 class YoutubeServices {

 private YouTubeService youTubeService;
 private PlaylistLinkFeed feed;
 private ListPlaylistLinkEntry entries;
 private String urlForPlaylist = 
 http://gdata.youtube.com/feeds/api/users/YpyHr_nAd4lQo3FvQeNo1Q/playlists?v2
 ;
 private String urlToDownloadAtomOfVideo = 
 http://gdata.youtube.com/feeds/api/users/YpyHr_nAd4lQo3FvQeNo1Q/playlists/
 ;
 private String playlist[][] = new String[3][];
 private String playlistVideosList[][] = new String[3][];
  //One calls this class as below.
 //YoutubeServices m = new YoutubeServices(emailaddress, password);
 //m.getData();
 //m.getVideosFromPlaylist(PlayListID);
  public Main(String username, String password) {
 youTubeService = new YouTubeService(App Name, 
 AI39sixxx This is developers key );
 Log.d(,YouTube Service is created.);
 //youTubeService.setUserCredentials(emailaddress, password);
 try {
 youTubeService.setUserCredentials(username, password);
  } catch (AuthenticationException e) {
 Log.d(AuthenticationException, +e);
 }
 }
  public String[][] getData(){
  try {
 URL playlistUrl = new URL(urlForPlaylist);
 feed = youTubeService.getFeed(playlistUrl, PlaylistLinkFeed.class);
  entries = feed.getEntries(); 
  playlist = new String[3][entries.size()];
  for(int i=0; ientries.size(); i++){
 playlist[0][i] = entries.get(0).getTitle().getPlainText();
 Log.d(Title , +entries.get(0).getTitle().getPlainText());
  playlist[1][i] = entries.get(0).getSummary().getPlainText();
 Log.d(Description  , +entries.get(0).getSummary().getPlainText());
  playlist[2][i] = entries.get(0).getId();
 Log.d(ID , +entries.get(0).getId());
  }
  } catch (MalformedURLException e) {
 Log.d(MalformedURLException Error , +e);
 } catch (IOException e) {
 Log.d(IOException Error , +e);
 } catch (ServiceException e) {
 Log.d(ServiceException Error , +e);
 }
  for(int i=0; iplaylist.length; i++){
 for(int j=0; jplaylist[i].length; j++){
 Log.d(, +playlist[i][j]);
 }
 }
  return playlist;
 }
  public String[][] getVideosFromPlaylist(String playList){
 URL playlistUrl;
 try {
 playlistUrl = new URL(urlToDownloadAtomOfVideo+playList+?v2);
 Log.d(URL, +urlToDownloadAtomOfVideo+playList+?v2);
  YouTubeQuery query = new YouTubeQuery(playlistUrl);
  //Here I have error
 VideoFeed videoFeed = youTubeService.query(query, VideoFeed.class);
  for(VideoEntry entry : videoFeed.getEntries()){
 Log.d(Title,+entry.getTitle().getPlainText());
 Log.d(Summery,+entry.getSummary().getPlainText());
 }
  } catch (MalformedURLException e) {
 e.printStackTrace();
 } catch (IOException e) {
 e.printStackTrace();
 } catch (ServiceException e) {
 e.printStackTrace();
 }
  return playlistVideosList;
 }
 }


 Error is as:

 com.google.gdata.util.ParseException: [Line 1, Column 307] Invalid root 
 element, expected (namespace uri:local name) of (
 http://www.w3.org/2005/Atom:feed), found (
 http://www.w3.org/2005/Atom:entry

 at com.google.gdata.util.XmlParser.throwParseException(XmlParser.java:739)

 at com.google.gdata.util.XmlParser.parse(XmlParser.java:702)

 at com.google.gdata.util.XmlParser.parse(XmlParser.java:585)
 at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
 at 
 com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
 at 
 com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
 at 
 com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
 at 
 com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
 at 
 com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
 at 
 com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
 at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
 at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
 at com.google.gdata.client.Service.getFeed(Service.java:1136)
 at com.google.gdata.client.Service.getFeed(Service.java:1077)
 at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676)
 at com.google.gdata.client.Service.query(Service.java:1237)
 at com.google.gdata.client.Service.query(Service.java:1178)
 at in.co.discoverit.atomParsing.Main.getVideosFromPlaylist(Main.java:108)
 at in.co.discoverit.atomParsing.Main.main(Main.java:33)
 Caused by: com.google.gdata.util.ParseException: Invalid root element, 
 expected (namespace 

Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread RichardC
Have you tried do the following and seeing what happens?


   - Play another OpenGL game just to get it into the long-press-home menu.
   - Start your game as normal and play it a bit.
   - [long-press-home] and start the previous OpenGL game whilst yours is 
   still running.
   - plays the other game for a bit
   - returns to your game

You you need to re-load your OpenGL context and if so as you did not pause 
and release it, how do you know it needs doing?


On Tuesday, March 5, 2013 6:17:29 PM UTC, latimerius wrote:

 On Tue, Mar 5, 2013 at 6:58 PM, TreKing treki...@gmail.com 
 javascript:wrote:


 Threads you can start and stop with onPause / onResume. Assuming it's 
 that simple in your case (I'm going to guess it's not =P )


 Admittedly, I could probably stop my game thread in the main activity 
 onPause() and resume it in my preference activity onResume() (if that's 
 reached) - perhaps bit kludgy but OK.

 I'm not quite sure about the rendering thread though - that's controlled 
 by GLSurfaceView and I'm afraid I can't just pause it with no other 
 side-effects.  I think the only way would be to 
 call GLSurfaceView.onPause() which however also means a lot of other 
 undesirable things including GL context loss and the subsequent need to 
 reload all geometry and textures.
  

  Also, audio has to be stopped as soon as user leaves the app.


 This can also be stopped / resumed with onPause / onResume. I assume - I 
 haven't needed custom audio in my app.


 That would mean an audible drop-out I'm afraid.
  

   The same goes for analytics session, it should to be closed right when 
 the user leaves otherwise it would be hard to get accurate data about 
 session length.


 That's tricky, even without your specific requirements. A session in 
 Android is notoriously hard to determine.


 Sure, sure.  We consciously limit ourselves to just time the app spent on 
 screen - a crude measure by itself, I know, but why make it even less 
 precise. ;-)
  

   And for saving data, onDestroy() is explicitly documented to be a bad 
 choice.


 Absolutely - I was suggesting onDestroy for all the clean up you stated 
 you needed to do.

 Anyhow, you know your requirements better than I - just putting out some 
 food for thought. Good luck.


 Thanks for taking interest in my problem!
  


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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 9:18 PM, RichardC richard.crit...@googlemail.comwrote:

 Have you tried do the following and seeing what happens?


- Play another OpenGL game just to get it into the long-press-home
menu.
- Start your game as normal and play it a bit.
- [long-press-home] and start the previous OpenGL game whilst yours is
still running.
- plays the other game for a bit
- returns to your game

 You you need to re-load your OpenGL context and if so as you did not pause
 and release it, how do you know it needs doing?


Hm, I'm afraid you lost me here.  I do release GL context when leaving the
app and reacquire it when returning.  My problem is that I don't want or
need to do that just to display my own preferences screen.

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread RichardC
With the scenario below if you are releasing in onPause, how you you know 
you are leaving your app?  onStop will get called in both cases and 
onDestroy need not get called.

On Tuesday, March 5, 2013 8:36:51 PM UTC, latimerius wrote:

 On Tue, Mar 5, 2013 at 9:18 PM, RichardC 
 richard...@googlemail.comjavascript:
  wrote:

 Have you tried do the following and seeing what happens?


- Play another OpenGL game just to get it into the long-press-home 
menu. 
- Start your game as normal and play it a bit.
- [long-press-home] and start the previous OpenGL game whilst yours 
is still running.
- plays the other game for a bit
- returns to your game

 You you need to re-load your OpenGL context and if so as you did not 
 pause and release it, how do you know it needs doing?


 Hm, I'm afraid you lost me here.  I do release GL context when leaving the 
 app and reacquire it when returning.  My problem is that I don't want or 
 need to do that just to display my own preferences screen. 



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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread RichardC
Typo in the above:
With the scenario below if you are **NOT** releasing in onPause...

On Tuesday, March 5, 2013 8:50:48 PM UTC, RichardC wrote:

 With the scenario below if you are releasing in onPause, how you you know 
 you are leaving your app?  onStop will get called in both cases and 
 onDestroy need not get called.

 On Tuesday, March 5, 2013 8:36:51 PM UTC, latimerius wrote:

 On Tue, Mar 5, 2013 at 9:18 PM, RichardC richard...@googlemail.comwrote:

 Have you tried do the following and seeing what happens?


- Play another OpenGL game just to get it into the long-press-home 
menu. 
- Start your game as normal and play it a bit.
- [long-press-home] and start the previous OpenGL game whilst yours 
is still running.
- plays the other game for a bit
- returns to your game

 You you need to re-load your OpenGL context and if so as you did not 
 pause and release it, how do you know it needs doing?


 Hm, I'm afraid you lost me here.  I do release GL context when leaving 
 the app and reacquire it when returning.  My problem is that I don't want 
 or need to do that just to display my own preferences screen. 



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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 9:51 PM, RichardC richard.crit...@googlemail.comwrote:

 Typo in the above:
 With the scenario below if you are **NOT** releasing in onPause...


I see.  Well in the scenario below I would release it in onPause().  The
only time I don't do full release in onPause() is when I know that the
cause of that onPause() call is my own preference activity coming up.

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




[android-developers] fade out anomaly

2013-03-05 Thread bob
I have this code for a fade out effect:

set xmlns:android=http://schemas.android.com/apk/res/android;
android:fillAfter=true 

alpha
android:duration=1000
android:fromAlpha=1.0
android:toAlpha=0.0 /

/set


Initially, I had this in my manifest:

uses-sdk android:minSdkVersion=13 android:targetSdkVersion=13 /

Then I changed it to this:

uses-sdk android:minSdkVersion=14 android:targetSdkVersion=14 /

Oddly enough, this changed the animation.  In particular, it changed the 
behavior of the fillAfter.  In version 13, the widget as invisible 
following the animation.  In version 14, the widget was visible.

Do you guys think this is a bug that was introduced in version 14?

Thanks.

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 6:25 PM, Latimerius l4t1m3r...@gmail.com wrote:

 On Tue, Mar 5, 2013 at 5:41 PM, Piren gpi...@gmail.com wrote:

 - Dont use a different Activity to show Prefs (you can re-use your
 current one, i personally always disliked the PreferencesActivity class..
 its ugly as fuck)



 you can either just replace your current contentView or use other
 containers like ViewSwitcher/ViewPager and etc  to switch between the main
 app and the preferences view.


 Thanks for pointing this out, it never occurred to me that I could reuse
 my main activity instance... clever. :-)  Now trying to figure out how to
 construct the preferences view.  I'm also using
 PreferenceActivity.onSharedPreferenceChanged() so I'll have to have a
 replacement for that too.


Alas, it doesn't seem to be easy to inflate a preferences XML into a View
hierarchy (this link
http://stackoverflow.com/questions/4642858/how-to-display-preferences-in-a-view
even
suggests it's not possible at all!), let alone get the whole preferences
machinery working outside of PreferenceActivity.

Have you actually done it, or are you just assuming it should be doable?

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Kostya Vasilyev
2013/3/6 Latimerius l4t1m3r...@gmail.com

 On Tue, Mar 5, 2013 at 6:25 PM, Latimerius l4t1m3r...@gmail.com wrote:

 On Tue, Mar 5, 2013 at 5:41 PM, Piren gpi...@gmail.com wrote:

 - Dont use a different Activity to show Prefs (you can re-use your
 current one, i personally always disliked the PreferencesActivity class..
 its ugly as fuck)



 you can either just replace your current contentView or use other
 containers like ViewSwitcher/ViewPager and etc  to switch between the main
 app and the preferences view.


 Thanks for pointing this out, it never occurred to me that I could reuse
 my main activity instance... clever. :-)  Now trying to figure out how to
 construct the preferences view.  I'm also using
 PreferenceActivity.onSharedPreferenceChanged() so I'll have to have a
 replacement for that too.


 Alas, it doesn't seem to be easy to inflate a preferences XML into a View
 hierarchy (this link
 http://stackoverflow.com/questions/4642858/how-to-display-preferences-in-a-view
  even
 suggests it's not possible at all!), let alone get the whole preferences
 machinery working outside of PreferenceActivity.

 Have you actually done it, or are you just assuming it should be doable?


How about a PreferenceActivity with theme=@style/Theme.Dialog?

I also wonder what you do for when the screen is blanked -- which triggers
onPause / onStop depending on Android version.

-- K



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




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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread a1



I'm not quite sure about the rendering thread though - that's controlled by 
 GLSurfaceView and I'm afraid I can't just pause it with no other 
 side-effects.  I think the only way would be to 
 call GLSurfaceView.onPause() which however also means a lot of other 
 undesirable things including GL context loss and the subsequent need to 
 reload all geometry and textures.


Oh my god, really? We are in 2009 again or something? Since Android 3.0, 
you can call setPreserveEGLContextOnPause method to prevent GLSurfaceView 
from releasing context, if you are targeting older version simply back-port 
(or use one of existing back-ports eg. the one from Replica Island).

That being said multi-activity model is extremely unfit for games, I'm 
guessing that you are using some homebrew engine without  good UI toolkit 
hence you'd like to use PreferenceActivity - my advice is to adapt some 
existing widget toolkit (or part of it, if your game is in C++ there are 
bunch of options: cegui, gwen, librocket, twl, otk), as a stopgap you can 
simply show fullscreen dialog (Dialog class subclass) with preference like 
layout - that way your settings screen will not interfere with game 
activity lifecycle.

--
Bart



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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread RichardC

On Tuesday, March 5, 2013 10:20:38 PM UTC, a1 wrote:


 Oh my god, really? We are in 2009 again or something? Since Android 3.0, 
 you can call setPreserveEGLContextOnPause method to prevent GLSurfaceView 
 from releasing context, if you are targeting older version simply back-port 
 (or use one of existing back-ports eg. the one from Replica Island).


The context  may still be lost if for example another OpenGL app runs.  The 
preserve context only prevents GLSurfaceView from releasing it to play 
nice, it does not prevent the OpenGL driver from forcibly removing it from 
you if it needs the resources.




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




[android-developers] Re: cost of view instantiation versus memory bloat

2013-03-05 Thread momo
Thanks for the reply - sorry for the delay (apparently I wasn't subscribed 
to this thread).

I'm not familiar with the practices necessary to analyze memory usage at 
this point, but I'll look into it.

For reference, the widget is a scaling tiled layer, similar to iOS 
CATiledLayer,  which allows the user to use arbitrarily sized tiles, 
scales, etc - also a previous tile set needs to stay displayed until the 
new one is rendered. So generally there are only maybe 4-16 tiles (Views) 
being displayed, but for a moment, at a small scale, with a previous set in 
place (before that set is destroyed),  there could be as many as 60-70 
views.  The views themselves are just ImageViews, so nothing special about 
instantiation.  I'm not familiar enough with the platform to know if the 
memory used by having references to those views (pooled, for recycling) 
outweigh the benefit gained in not having to repeatedly re-instantiate.

On Tuesday, March 5, 2013 1:50:10 AM UTC-6, Piren wrote:

 Your best bet is to just analyze your app memory and processing wise... 
 see how long it takes you to initialize a view and how much memory they all 
 use.. then find a proper balance between the two that makes sure your app 
 is both responsive and without a risk of memory issues.

 My guess - unless initializing your views is something very complicated 
 that takes a while (which might mean you'll need to redesign them since 
 they might not be done the best), re-using will be the proper way to go.

 On Tuesday, March 5, 2013 6:57:24 AM UTC+2, momo wrote:

 I have a widget that potentially uses many Views.  In looking at the 
 source for other view-intensive widgets (like ListView), I understand that 
 it's a fairly computationally expensive process to instantiate Views.  I 
 see they're recycling children - creating them on demand, then caching 
 them, and re-using them with updated properties when one is required.

 My concern is that in my case (with so many potential Views) that the 
 cost of keeping references to them in memory might be worse than the cost 
 of instantiating them.  I'm tracking the total number of Views in the cache 
 and see it reach as much as 60-70 at times.

 The requirement is such that I can't reduce the number of Views used.

 When the number is as high as I've mentioned, is caching and recycling 
 Views still a better prospect than new instantiation on-demand?  I 
 believe that if I did not cache, the unused Views would be 
 garbage-collected properly (there shouldn't be any references that I'm not 
 catching).

 TYIA.



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




[android-developers] Motorola Razr Maxx HD - freezes?

2013-03-05 Thread Nathan
This question is from a developer who has an app and has some unusual 
patterns with the Motorola

I do not have one, but after a month or two, the reports are pretty 
consistent from customers on this device and only this device. 

After scrolling a custom view, the phone completely freezes and requires 
battery removal or special key sequence to reboot.

This is a long shot, but have any of you tracked down a problem on this 
device? Did you find a cause?

Anything special about the device I should be aware of?

Where can I rent one of these devices?

Does anyone in the greater Portland OR area have one of these devices?

Nathan 

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 11:19 PM, Kostya Vasilyev kmans...@gmail.com wrote:

 How about a PreferenceActivity with theme=@style/Theme.Dialog?


I've tried that but it doesn't change the substance of the problem - the
activity now *looks* like a dialog (not full-screen, dimmed background) but
it's still an Activity, it still causes onPause()/onResume() on the main
Activity.


 I also wonder what you do for when the screen is blanked -- which triggers
 onPause / onStop depending on Android version.


I do a full release/clean-up of everything.  I only do the light version
if I know onPause() is due to my own prefs activity.

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




Re: [android-developers] Motorola Razr Maxx HD - freezes?

2013-03-05 Thread Mark Murphy
On Tue, Mar 5, 2013 at 7:31 PM, Nathan nathan.d.mel...@gmail.com wrote:
 After scrolling a custom view, the phone completely freezes and requires
 battery removal or special key sequence to reboot.

Almost by definition, that's gotta be a firmware bug, unless you are
doing something yourself in JNI.

 Where can I rent one of these devices?

It doesn't look like TestDroid Cloud or DeviceAnywhere have the RAZR
Maxx HD, just the Droid RAZR.

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

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

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread Latimerius
On Tue, Mar 5, 2013 at 11:20 PM, a1 arco...@gmail.com wrote:




 I'm not quite sure about the rendering thread though - that's controlled
 by GLSurfaceView and I'm afraid I can't just pause it with no other
 side-effects.  I think the only way would be to
 call GLSurfaceView.onPause() which however also means a lot of other
 undesirable things including GL context loss and the subsequent need to
 reload all geometry and textures.


 Oh my god, really? We are in 2009 again or something? Since Android 3.0,
 you can call setPreserveEGLContextOnPause method to prevent GLSurfaceView
 from releasing context,


My minSdk is 7.  Preserving GL context is a hint.  You call it and pray it
works.  See the official docs at
http://developer.android.com/reference/android/opengl/GLSurfaceView.html#setPreserveEGLContextOnPause(boolean)



 if you are targeting older version simply back-port (or use one of
 existing back-ports eg. the one from Replica Island).


That's a solution with its own set of problems.  Check some of the comments
in the RI version.  In fact, I highly doubt it would work well across the
spectrum of today's Android hardware.

That being said multi-activity model is extremely unfit for games, I'm
 guessing that you are using some homebrew engine without  good UI toolkit
 hence you'd like to use PreferenceActivity - my advice is to adapt some
 existing widget toolkit (or part of it, if your game is in C++ there are
 bunch of options: cegui, gwen, librocket, twl, otk), as a stopgap you can
 simply show fullscreen dialog (Dialog class subclass) with preference like
 layout - that way your settings screen will not interfere with game
 activity lifecycle.


I agree it looks like it should be easy to make a Preference*Dialog*
instead of PreferenceActivity.  And yet, apparently it's not.

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




Re: [android-developers] Motorola Razr Maxx HD - freezes?

2013-03-05 Thread Nathan


On Tuesday, March 5, 2013 4:44:30 PM UTC-8, Mark Murphy (a Commons Guy) 
wrote:

 On Tue, Mar 5, 2013 at 7:31 PM, Nathan nathan@gmail.com javascript: 
 wrote: 
  After scrolling a custom view, the phone completely freezes and requires 
  battery removal or special key sequence to reboot. 

 Almost by definition, that's gotta be a firmware bug, unless you are 
 doing something yourself in JNI. 

 
Yes, as we have previously discussed. No JNI or NDK used whatsoever. 
 
But that is of small comfort because my app has apparently, somehow, 
someway, given users an easy way to reproduce this firmware bug. 
I have somehow created a stressful situation for that device which causes 
it to hit that firmware bug. 

 Where can I rent one of these devices? 

 It doesn't look like TestDroid Cloud or DeviceAnywhere have the RAZR 
 Maxx HD, just the Droid RAZR. 



I spent time at AppThwack with a Razr HD (not Maxx) and had no luck 
reproducing the problem that is apparently easy for my users to reproduce. 

According to a review site: That beefier battery and bumped-up storage 
(32GB internal versus 16GB) is all that separates the $199 RAZR HD from the 
$299 RAZR MAXX 
HDhttp://www.engadget.com/2012/09/05/motorola-droid-razr-hd-maxx-hands-on-bigger-battery-beautiful/.
 
Otherwise, they're the same exact phone.

They do not appear to be different in the market filters either. DROID RAZR 
HD (vanquish) shows up, but there is no separate entry for MAXX HD. 

Nathan

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




[android-developers] How rotate a line in Android XML?

2013-03-05 Thread don rhummy
I'm trying to draw a diagonal line in an Android app with the XML, but it is 
not working. It simply draws a horizontal line.
main.xml
RelativeLayoutxmlns:android=http://schemas.android.com/apk/res/androidxmlns:tools=http://schemas.android.com/toolsandroid:layout_width=match_parentandroid:layout_height=match_parentandroid:paddingBottom=@dimen/activity_vertical_marginandroid:paddingLeft=@dimen/activity_horizontal_marginandroid:paddingRight=@dimen/activity_horizontal_marginandroid:paddingTop=@dimen/activity_vertical_margintools:context=.TestActivity;RelativeLayoutandroid:layout_width=match_parentandroid:layout_height=match_parentandroid:layout_alignParentLeft=trueandroid:layout_alignParentTop=truestyle=@style/diagonalStyle/RelativeLayout/RelativeLayout
styles.xml
resourcesxmlns:android=http://schemas.android.com/apk/res/android;stylename=diagonalStyleitem
 name=android:background@drawable/background/item/style/resources
background.xml
?xml 
version=1.0encoding=utf-8?layer-listxmlns:android=http://schemas.android.com/apk/res/android;itemrotateandroid:fromDegrees=0android:toDegrees=45android:pivotX=50%android:pivotY=50%shapeandroid:shape=lineandroid:top=1dipstrokeandroid:width=1dipandroid:color=#FF//shape/rotate/item/layer-list

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread a1


W dniu środa, 6 marca 2013 00:06:32 UTC+1 użytkownik RichardC napisał:


 On Tuesday, March 5, 2013 10:20:38 PM UTC, a1 wrote:


 Oh my god, really? We are in 2009 again or something? Since Android 3.0, 
 you can call setPreserveEGLContextOnPause method to prevent GLSurfaceView 
 from releasing context, if you are targeting older version simply back-port 
 (or use one of existing back-ports eg. the one from Replica Island).


 The context  may still be lost if for example another OpenGL app runs. 
  The preserve context only prevents GLSurfaceView from releasing it to 
 play nice, it does not prevent the OpenGL driver from forcibly removing 
 it from you if it needs the resources.

 
It's not true: driver is not allowed to forcibly remove context if it needs 
resources - context may be lost only due to power management events - think 
about deep sleep or hibernation. It's common that OS teardown process when 
user navigates away and given process consumes a lot of RAM you can emulate 
this by enabling developer option: don't keep activities). 

--
Bart

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




Re: [android-developers] How rotate a line in Android XML?

2013-03-05 Thread don rhummy
The answer is to also make fromDegrees=45. I thought from/toDegrees referred 
to point 0 and point n of the line, but it refers to animation. The rotate 
XML node is an animation. So you're telling it to move it from 45 degrees to 45 
degrees (there's no other way to rotate a line in XML layout). Just set the 
duration of the animation to 0.






 From: don rhummy donrhu...@yahoo.com
To: Android Developers android-developers@googlegroups.com 
Sent: Tuesday, March 5, 2013 8:56 PM
Subject: [android-developers] How rotate a line in Android XML?
 

I'm trying to draw a diagonal line in an Android app with the XML, but it is 
not working. It simply draws a horizontal line.
main.xml
RelativeLayoutxmlns:android=http://schemas.android.com/apk/res/androidxmlns:tools=http://schemas.android.com/toolsandroid:layout_width=match_parentandroid:layout_height=match_parentandroid:paddingBottom=@dimen/activity_vertical_marginandroid:paddingLeft=@dimen/activity_horizontal_marginandroid:paddingRight=@dimen/activity_horizontal_marginandroid:paddingTop=@dimen/activity_vertical_margintools:context=.TestActivity;RelativeLayoutandroid:layout_width=match_parentandroid:layout_height=match_parentandroid:layout_alignParentLeft=trueandroid:layout_alignParentTop=truestyle=@style/diagonalStyle/RelativeLayout/RelativeLayout
styles.xml
resourcesxmlns:android=http://schemas.android.com/apk/res/android;stylename=diagonalStyleitem
 name=android:background@drawable/background/item/style/resources
background.xml
?xml 
version=1.0encoding=utf-8?layer-listxmlns:android=http://schemas.android.com/apk/res/android;itemrotateandroid:fromDegrees=0android:toDegrees=45android:pivotX=50%android:pivotY=50%shapeandroid:shape=lineandroid:top=1dipstrokeandroid:width=1dipandroid:color=#FF//shape/rotate/item/layer-list
-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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




[android-developers] Uninstall free version app after installing paid version

2013-03-05 Thread Bajrang Asthana
Actually we are thinking to publish my app in two version i.e free and paid.

We are providing link in free version so that user can download paid 
version from Google play.

I am interested to know what could be the best way to remove free version 
app(if user has installed it)  as soon as user install the paid version.

Thanks in advance:)

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




Re: [android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread a1


 Oh my god, really? We are in 2009 again or something? Since Android 3.0, 
 you can call setPreserveEGLContextOnPause method to prevent GLSurfaceView 
 from releasing context, 


 My minSdk is 7.  Preserving GL context is a hint.  You call it and pray it 
 works.  See the official docs at 
 http://developer.android.com/reference/android/opengl/GLSurfaceView.html#setPreserveEGLContextOnPause(boolean)

 It's just works - EGL is only allowed to dispose context on power 
management events, OS may terminate application process if user navigate 
away but that's it. Anyway if you really want to play nice you can simply 
reaload everything when you catch EGL_CONTEXT_LOST.
 

  

 if you are targeting older version simply back-port (or use one of 
 existing back-ports eg. the one from Replica Island).


 That's a solution with its own set of problems.  Check some of the 
 comments in the RI version.  In fact, I highly doubt it would work well 
 across the spectrum of today's Android hardware.

Why, current GLSurfaceView implementation is based on the one from RI. 
GLSurfaceView is just helper class, there is nothing HW specific 
(see: 
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/opengl/java/android/opengl/GLSurfaceView.java)
 


 That being said multi-activity model is extremely unfit for games, I'm 
 guessing that you are using some homebrew engine without  good UI toolkit 
 hence you'd like to use PreferenceActivity - my advice is to adapt some 
 existing widget toolkit (or part of it, if your game is in C++ there are 
 bunch of options: cegui, gwen, librocket, twl, otk), as a stopgap you can 
 simply show fullscreen dialog (Dialog class subclass) with preference like 
 layout - that way your settings screen will not interfere with game 
 activity lifecycle.


 I agree it looks like it should be easy to make a Preference*Dialog* 
 instead of PreferenceActivity.  And yet, apparently it's not. 

Not _PreferenceDialog_, simply create layout that look's like 
PreferenceActivity, do not try to host actual preferences infrastructure 
inside dialog since it's not designed to be used that way.

--
Bart
 

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




[android-developers] Re: InflateException: Error inflating class issue

2013-03-05 Thread abhijit
i am getting the same error just copy the drawable to hdpi,ldpi,mdpi 
folders it works for two three images after that i am getting same android 
.inflation error.

On Monday, October 3, 2011 5:16:25 PM UTC+5:30, Tonez wrote:

 Hi Everyone, 

 I have an app which I'm testing out on Android 2.0 (emulator) that's 
 currently throwing me an error - of which I've found the cause.  The 
 error is: 

 android.view.InflateException: Binary XML file line #7: Error 
 inflating class unknown 

 This error is being thrown when my activity tries to inflate a layout 
 file with background images in it.  If I remove the background images 
 from the elements within that layout file, I don't get the error 
 anymore and my layout file get's loaded into view - only without the 
 artwork ofcourse.  I've googled around and have found other instances 
 of this error being caused by the size of the images used being too 
 large.  My background images aren't large at all, kb sizes are as 
 follows for the largest background image in that layout file: 

 hdpi:  102kb 
 mdpi:  66.2kb 
 ldpi:  66.2kb 

 I have three other images in the layout file that don't exceed 14kb in 
 size.  I've tried removing the largest image in the layout file to see 
 if the others which are a lot less in size would still cause this 
 error to be thrown and unfortunately it does. 

 Worth mentioning that I don't have this problem on Android 2.0.1 and 
 above, and all my images are pngs. 

 Any suggestions would be very much appreciated. 

 Thanks! 

 - Tonez

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




[android-developers] Re: how to tell why Activity.onPause() is called

2013-03-05 Thread dnk
Use 
http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()

Gets called only when the user has decided to leave instead of another app 
coming in the foreground.

On Monday, March 4, 2013 3:14:29 PM UTC-8, latimerius wrote:

 Hello,

 I would like to be able to tell if Activity.onPause() was called because 
 the user is leaving the app, or simply because another Activity within the 
 same app is coming up.

 I have a main Activity and a PreferenceActivity.  The main Activity needs 
 to handle onPause() differently depending on why it's called.  If the user 
 is leaving the app, it needs to stop helper threads, close various things 
 like analytics session, deal with GL, save data to SD card etc.  However, 
 if onPause() is just to display prefs most of that should happen, and a 
 bunch of other things should be done instead.

 I'm wondering if there's a framework-supported way to handle this, or at 
 least an idiomatic solution, as in a (semi)standard way of managing an 
 Activity with heavy set-up and tear-down?
  

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