Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread KK
hi,
Seems the logcat

11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
java.lang.IllegalStateException
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
android.media.MediaPlayer.getCurrentPosition(Native Method)
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
java.util.Timer$TimerImpl.run(Timer.java:284)


is pointing to the following location(Line 174). I'm using the following
code to play a user-selected song

code snippet

try {
mMediaPlayer.reset();
mMediaPlayer.setDataSource(filename);
 mMediaPlayer.prepare();
mMediaPlayer.start();
showNotification(finalPosition);
 Log.d(TAG, duration:  + mMediaPlayer.getDuration());
mSeekBar.setMax(mMediaPlayer.getDuration());
 // Keep updating the seekbar with current position

timer.schedule(new TimerTask() {

@Override
public void run() {
// TODO Auto-generated method stub
 if (null != mMediaPlayer
 mMediaPlayer.getCurrentPosition()  mMediaPlayer
 .getDuration()) {
mSeekBar.setProgress(mMediaPlayer.getCurrentPosition());
 }

}
}, 100, 200);

mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {

@Override
 public void onCompletion(MediaPlayer arg0) {
nextSong();
}
 });
} catch (Exception e) {
e.printStackTrace();
 }

code snippet

As the error is pointing to this line
   *if (null != mMediaPlayer  mMediaPlayer.getCurrentPosition() 
mMediaPlayer.getDuration())*
*
*
something is wrong here but surprisingly this is working fine on emulator
without any such error, any idea how is that possible?
 Thanks for your help.

Regards,
KK





On Sat, Nov 26, 2011 at 1:21 PM, Raghav Sood raghavs...@androidactivist.org
 wrote:

 Logcat?

 On Sat, Nov 26, 2011 at 1:14 PM, KK dioxide.softw...@gmail.com wrote:

 hi All,
 I'm trying to exit the application using the following code in my
 mediaplayer app. While it works fine in the emulator(2.2) but when I run
 the app on an actual device (with 2.3.4 ) it gives me ANR error. Would
 appreciate if someone can point me what is going wrong.

 code snippet-
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
 switch (item.getItemId()) {
 ...

 case R.id.exit:
 Log.d(TAG, Shutting down the service);
  if (mMediaPlayer != null) {
  mMediaPlayer.release();
 mMediaPlayer = null;
 // remove all notifications
  mNotificationManager.cancelAll();
 timer.cancel();
 finish();
  return true;

 
 ---code snippet-
 Just a note that I'm using notifications to show current song being
 played, using Timer for continuously updating the seekbar for the current
 song being played.

 Appreciate your time. Many thanks.

 Regards,
 KK

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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

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

Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread skink


KK wrote:
 hi,
 Seems the logcat

 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
 11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
 java.lang.IllegalStateException
 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
 android.media.MediaPlayer.getCurrentPosition(Native Method)
 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
 com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
 java.util.Timer$TimerImpl.run(Timer.java:284)




Try to cancel() the timer before releazing media player

Also try to avoid Timer/TimerTask, use Handler instead

pskink

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


Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread KK
hi Pskink,
That actually worked, I moved the timer.cancel() before releasing the
mediaplayer. But what is the logical reasoning behind this, would you mind
explaining in a word or two? or may be point me to any web reference that
explains the thing. Thanks in advance.

Regards,
KK

On Sat, Nov 26, 2011 at 1:56 PM, skink psk...@gmail.com wrote:



 KK wrote:
  hi,
  Seems the logcat
 
  11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
  11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
  java.lang.IllegalStateException
  11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
  android.media.MediaPlayer.getCurrentPosition(Native Method)
  11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
 
 com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
  11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
  java.util.Timer$TimerImpl.run(Timer.java:284)
 
 


 Try to cancel() the timer before releazing media player

 Also try to avoid Timer/TimerTask, use Handler instead

 pskink

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


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

Re: [android-developers] Help please

2011-11-26 Thread sourabh sahu
MY question is how to achieve this kind of functionality.

On Sat, Nov 26, 2011 at 12:37 PM, Raghav Sood 
raghavs...@androidactivist.org wrote:

 If you know which product, when it will come, and where on the screen it
 will be displayed, you could probably manage it. Get back to us when you
 are facing an actual problem with your app, and provide some more details.

  On Sat, Nov 26, 2011 at 12:32 PM, sourabh sahu souruit...@gmail.comwrote:

  Can we make a video interactive, like a video is playing on android and
 a product is shown in a movie.I want to tap onto that product and can get
 information about it.

 Any kind of help is highly appreciated.

 Sourabh

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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

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

Re: [android-developers] Help please

2011-11-26 Thread Raghav Sood
I just told you. You need to know at what time your product comes onto the
screen, what it is and where on the screen it will be displayed. You can
then watch for a click on that part of the screen at the time it is
supposed to come. Then do whatever you want with the click.



On Sat, Nov 26, 2011 at 2:17 PM, sourabh sahu souruit...@gmail.com wrote:

 MY question is how to achieve this kind of functionality.


 On Sat, Nov 26, 2011 at 12:37 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 If you know which product, when it will come, and where on the screen it
 will be displayed, you could probably manage it. Get back to us when you
 are facing an actual problem with your app, and provide some more details.

  On Sat, Nov 26, 2011 at 12:32 PM, sourabh sahu souruit...@gmail.comwrote:

  Can we make a video interactive, like a video is playing on android
 and a product is shown in a movie.I want to tap onto that product and can
 get information about it.

 Any kind of help is highly appreciated.

 Sourabh

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

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

Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread skink


KK wrote:
 hi Pskink,
 That actually worked, I moved the timer.cancel() before releasing the
 mediaplayer. But what is the logical reasoning behind this, would you mind
 explaining in a word or two? or may be point me to any web reference that
 explains the thing. Thanks in advance.

 Regards,
 KK

 On Sat, Nov 26, 2011 at 1:56 PM, skink psk...@gmail.com wrote:

 
 
  KK wrote:
   hi,
   Seems the logcat
  
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
   java.lang.IllegalStateException
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   android.media.MediaPlayer.getCurrentPosition(Native Method)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
  
  com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   java.util.Timer$TimerImpl.run(Timer.java:284)
  
  
 
 
  Try to cancel() the timer before releazing media player
 
  Also try to avoid Timer/TimerTask, use Handler instead
 
  pskink
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 

Sure, read MediaPlayer SDK docs and find out when you may call
getCurrentPosition()

pskink

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


Re: [android-developers] Help please

2011-11-26 Thread sourabh sahu
I am talking about a video, How to put a click event on a video.

On Sat, Nov 26, 2011 at 2:25 PM, Raghav Sood raghavs...@androidactivist.org
 wrote:

 I just told you. You need to know at what time your product comes onto the
 screen, what it is and where on the screen it will be displayed. You can
 then watch for a click on that part of the screen at the time it is
 supposed to come. Then do whatever you want with the click.



 On Sat, Nov 26, 2011 at 2:17 PM, sourabh sahu souruit...@gmail.comwrote:

 MY question is how to achieve this kind of functionality.


 On Sat, Nov 26, 2011 at 12:37 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 If you know which product, when it will come, and where on the screen it
 will be displayed, you could probably manage it. Get back to us when you
 are facing an actual problem with your app, and provide some more details.

  On Sat, Nov 26, 2011 at 12:32 PM, sourabh sahu souruit...@gmail.comwrote:

  Can we make a video interactive, like a video is playing on android
 and a product is shown in a movie.I want to tap onto that product and can
 get information about it.

 Any kind of help is highly appreciated.

 Sourabh

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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

Re: [android-developers] Help please

2011-11-26 Thread Raghav Sood
Seeing as you only want the user to click on the product, I'd image you
could overlay and invisible view onto that part of the screen and listen
for touch events on that. If you don't know how to do that, I suggest that
you search the web.

On Sat, Nov 26, 2011 at 2:30 PM, sourabh sahu souruit...@gmail.com wrote:

 I am talking about a video, How to put a click event on a video.


 On Sat, Nov 26, 2011 at 2:25 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 I just told you. You need to know at what time your product comes onto
 the screen, what it is and where on the screen it will be displayed. You
 can then watch for a click on that part of the screen at the time it is
 supposed to come. Then do whatever you want with the click.



 On Sat, Nov 26, 2011 at 2:17 PM, sourabh sahu souruit...@gmail.comwrote:

 MY question is how to achieve this kind of functionality.


 On Sat, Nov 26, 2011 at 12:37 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 If you know which product, when it will come, and where on the screen
 it will be displayed, you could probably manage it. Get back to us when you
 are facing an actual problem with your app, and provide some more details.

  On Sat, Nov 26, 2011 at 12:32 PM, sourabh sahu 
 souruit...@gmail.comwrote:

  Can we make a video interactive, like a video is playing on android
 and a product is shown in a movie.I want to tap onto that product and can
 get information about it.

 Any kind of help is highly appreciated.

 Sourabh

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

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

Re: [android-developers] Help please

2011-11-26 Thread sourabh sahu
Thanks:)



On Sat, Nov 26, 2011 at 2:37 PM, Raghav Sood raghavs...@androidactivist.org
 wrote:

 Seeing as you only want the user to click on the product, I'd image you
 could overlay and invisible view onto that part of the screen and listen
 for touch events on that. If you don't know how to do that, I suggest that
 you search the web.


 On Sat, Nov 26, 2011 at 2:30 PM, sourabh sahu souruit...@gmail.comwrote:

 I am talking about a video, How to put a click event on a video.


 On Sat, Nov 26, 2011 at 2:25 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 I just told you. You need to know at what time your product comes onto
 the screen, what it is and where on the screen it will be displayed. You
 can then watch for a click on that part of the screen at the time it is
 supposed to come. Then do whatever you want with the click.



 On Sat, Nov 26, 2011 at 2:17 PM, sourabh sahu souruit...@gmail.comwrote:

 MY question is how to achieve this kind of functionality.


 On Sat, Nov 26, 2011 at 12:37 PM, Raghav Sood 
 raghavs...@androidactivist.org wrote:

 If you know which product, when it will come, and where on the screen
 it will be displayed, you could probably manage it. Get back to us when 
 you
 are facing an actual problem with your app, and provide some more details.

  On Sat, Nov 26, 2011 at 12:32 PM, sourabh sahu 
 souruit...@gmail.comwrote:

  Can we make a video interactive, like a video is playing on android
 and a product is shown in a movie.I want to tap onto that product and can
 get information about it.

 Any kind of help is highly appreciated.

 Sourabh

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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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




 --
 Raghav Sood
 http://www.androidactivist.org/ - Author
 http://www.appaholics.in/ - Founder

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


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

Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread skink


KK wrote:
 hi Pskink,
 That actually worked, I moved the timer.cancel() before releasing the
 mediaplayer. But what is the logical reasoning behind this, would you mind
 explaining in a word or two? or may be point me to any web reference that
 explains the thing. Thanks in advance.

 Regards,
 KK

 On Sat, Nov 26, 2011 at 1:56 PM, skink psk...@gmail.com wrote:

 
 
  KK wrote:
   hi,
   Seems the logcat
  
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
   java.lang.IllegalStateException
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   android.media.MediaPlayer.getCurrentPosition(Native Method)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
  
  com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   java.util.Timer$TimerImpl.run(Timer.java:284)
  
  
 
 
  Try to cancel() the timer before releazing media player
 
  Also try to avoid Timer/TimerTask, use Handler instead
 
  pskink
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 

Btw if you still use Timer/TimerTask combination you can still
sometimes face your problem since Timer uses its own Thread for
running TimerTasks. In order to avoid this you will need to implement
some synchronization.

Or use Handlers

pskink

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


Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread skink


KK wrote:
 hi Pskink,
 That actually worked, I moved the timer.cancel() before releasing the
 mediaplayer. But what is the logical reasoning behind this, would you mind
 explaining in a word or two? or may be point me to any web reference that
 explains the thing. Thanks in advance.

 Regards,
 KK

 On Sat, Nov 26, 2011 at 1:56 PM, skink psk...@gmail.com wrote:

 
 
  KK wrote:
   hi,
   Seems the logcat
  
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
   java.lang.IllegalStateException
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   android.media.MediaPlayer.getCurrentPosition(Native Method)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
  
  com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
   11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
   java.util.Timer$TimerImpl.run(Timer.java:284)
  
  
 
 
  Try to cancel() the timer before releazing media player
 
  Also try to avoid Timer/TimerTask, use Handler instead
 
  pskink
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 

Btw if you still use Timer/TimerTask combination you can still
sometimes face your problem since Timer uses its own Thread for
running TimerTasks. In order to avoid this you will need to implement
some synchronization.

Or use Handlers

pskink

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


[android-developers] [help]my app is moving while navigating one activity to another activity

2011-11-26 Thread chandra sekhar
Hi All,


This is Chandrasekhar. actually iam facing one problem in my app that is 
my app is moving while navigating one activity to another activity even
though

i had use the following line in onClick listener

intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();

pl help me

Thanks in advance
--

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

[android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
hi All,
I'm trying to use Notification manager and Pending Intent so that whenever
the user clicks the notification the currently running activity's UI is
shown. However in the code I'm using, as shown below opens up a new
instance of the app instead of leading the user to the currently running
one:

---code snippet
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
// //Add current song to notification bar
 CharSequence tickerText = Demo Alert;
long when = System.currentTimeMillis();
 CharSequence contentTitle = Now playing;
CharSequence contentText = Demo song;
 PendingIntent pendingIntent = PendingIntent.getActivity(
getApplicationContext(), 0, new Intent(this,
 DemoPendingIntentActivity.class), 0);

Notification notification = new Notification(
 R.drawable.ic_stat_playing, tickerText, when);
notification.setLatestEventInfo(getApplicationContext(), contentTitle,
 contentText, pendingIntent);
notification.contentIntent = pendingIntent;
 // Make the notification non-clearable
notification.flags = Notification.FLAG_ONGOING_EVENT;
 mNotificationManager.notify(notificationId, notification);
---code snippet

How do I open up the currently running activity instead of opening a new
one? Please let me know whats going wrong in the above code. Appreciate
your time.

Thanks,
KK

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

Re: [android-developers] Re: How to call the activity class

2011-11-26 Thread Kristopher Micinski
Ah yes,

it does sound like this is a phonegap specific question, which means it
doesn't belong on this list.

(Actually, it might belong on the list if there were something sdk related,
but it sounds like what you want to do is start an activity, right?  You
know how to start an activity regularly, right?  Have you read the SDK docs
on that one?  If not, do that, then see what else you need.)

kris

On Fri, Nov 25, 2011 at 11:25 PM, mohana priya gpriyara...@gmail.comwrote:

 Thanks for your reply.My application is phonegap in android.I need to
 call the activity class from the class which extends plugin in android
 phonegap application.How to do so.I have used the intent.but
 startactivity(intent) is undefined inside the plugins.Please tell me
 the solution.Thanks in Advance.

 On Nov 25, 9:40 pm, Kumar Bibek coomar@gmail.com wrote:
  Your question is not clear.
 
  Please clarify by giving more details.
 
  On Nov 25, 7:21 pm, mohana priya gpriyara...@gmail.com wrote:
 
   Hello android developers.I need to call the activity class inside the
   java class,because i need to do the application in phonegap.Please
   tell me the solution.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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Where do we use uses-feature android:required=false?

2011-11-26 Thread Jovish P
if an application requests the CAMERA permission but does not declare a
uses-feature element for android.hardware.camera, Android Market
considers that the application:
http://developer.android.com/guide/topics/manifest/uses-feature-element.htmlrequires
a camera and should not be shown to users whose devices do not
offer a camera.

If you don't want Android Market to filter based on a specific implied
feature, you can disable that behavior. To do so, declare the feature
explicitly in a uses-feature element and include an
android:required=false attribute. For example, to disable filtering
derived from the CAMERA permission, you would declare the feature as shown
below.

uses-feature android:name=android.hardware.camera android:required=false /

Checkout this link

http://developer.android.com/guide/topics/manifest/uses-feature-element.html



On Sat, Nov 26, 2011 at 8:37 AM, limtc thyech...@gmail.com wrote:

 I have a question:

 If I wanted to support a feature (says camera) but it is not necessary
 (menu item removed if detected no), is it necessary to declare:

 uses-feature android:name=string android:required=false/

 I assume we can simply do this without declaring. Isn't it? Or is it
 just good practice but not necessary?

PackageManager packageManager = getPackageManager();
if (!
 packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA))
menu.removeItem(R.id.camera);

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

[android-developers] removal and shifting

2011-11-26 Thread unionmoversuae
Welcome
Enjoy world-class moving services at local rates!

Union Mover Dubai is the moving company created to make your moving
experience a stress free one. Our focus is on top notch customer
service, and fast, professional moving services. We aim to offer our
customers the quality of service they expect from the industry's
biggest names in removals, but at affordable prices.

Whether you're moving house or office locally, relocating
internationally, or just a few large items around Dubai, Abu Dhabi or
across the UAE, Union Mover removals promise to handle every detail
with speed, care and professionalism so you can relax and take it
easy.

To get your moving quote underway, simply click Get Your Easy Quote,
and we'll prepare your quote immediately.   Only pay for the services
you need.

When you move with Union Mover, you only pay for the removal services
you need. Our prices are based on the space you use in our trucks, the
items you need packed and boxed, bubble wrapped or dismantled. No
matter what your budget is you can tailor your move accordingly.

If you need a removal truck today... no problem. We have good network
of removal trucks, moving vans  packing crew across the country ready
to handle any job you throw their way.

So let's get started shall we? Please click on the Get Your Union
Quote button on the right, fill in the quote form and we'll get right
back to you with a great price today!

Our friendly team of highly trained packers will have you comfortably
set up in your new home, same day guaranteed!

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


Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread Mark Murphy
Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
Intent. The latter finishes all other activities that might be on your
back stack; the former simply brings any existing copy of the activity
back to the foreground.

On Sat, Nov 26, 2011 at 4:51 AM, KK dioxide.softw...@gmail.com wrote:
 hi All,
 I'm trying to use Notification manager and Pending Intent so that whenever
 the user clicks the notification the currently running activity's UI is
 shown. However in the code I'm using, as shown below opens up a new instance
 of the app instead of leading the user to the currently running one:
 ---code snippet
 mNotificationManager = (NotificationManager)
 getSystemService(NOTIFICATION_SERVICE);
 // //Add current song to notification bar
 CharSequence tickerText = Demo Alert;
 long when = System.currentTimeMillis();
 CharSequence contentTitle = Now playing;
 CharSequence contentText = Demo song;
 PendingIntent pendingIntent = PendingIntent.getActivity(
 getApplicationContext(), 0, new Intent(this,
 DemoPendingIntentActivity.class), 0);
 Notification notification = new Notification(
 R.drawable.ic_stat_playing, tickerText, when);
 notification.setLatestEventInfo(getApplicationContext(), contentTitle,
 contentText, pendingIntent);
 notification.contentIntent = pendingIntent;
 // Make the notification non-clearable
 notification.flags = Notification.FLAG_ONGOING_EVENT;
 mNotificationManager.notify(notificationId, notification);
 ---code snippet
 How do I open up the currently running activity instead of opening a new
 one? Please let me know whats going wrong in the above code. Appreciate your
 time.
 Thanks,
 KK

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



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

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

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


[android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread limtc
Oh, so is this summary correct? Assuming the app requested a CAMERA
permission.

1) Do not declare uses-feature
- Android Market will NOT show app to devices without camera.

2) Use uses-feature android:name=android.hardware.camera
android:required=false /
- Android Market will show the app to all devices with or without
camera.

3) Use uses-feature android:name=android.hardware.camera
android:required=true /
- Android Market will need the camera feature to be there, and will
NOT show app to devices without camera.

But if this is true, isn't 1) and 3) the same? That's why I am
confused. Thanks for any clarification.

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


Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
Thanks for the hints. I'm trying to use the FLAG_ACTIVITY_REORDER_TO_FRONT
flag but the behavior remains as earlier. After the activity starts, I
press Menu to go to home and then pull down the Notification list click
on the current one (for my demopendingintent activity) and it brings me a
new activity page. I've added exit buttons and logs through which I'm able
to conclude that it starts a new activity rather than bringing the one
running in the background. May be I'm doing something wrong in my code.
Please find below the code snippet I'm using for showing notifications etc.

---code snippet

private void showNotification() {
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
 // //Add current song to notification bar
CharSequence tickerText = Demo Alert;
 long when = System.currentTimeMillis();
CharSequence contentTitle = Now playing;
 CharSequence contentText = Demo song;

Intent notificationIntent = new Intent(this,
 DemoPendingIntentActivity.class);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

PendingIntent pendingIntent = PendingIntent.getActivity(
getApplicationContext(), 0, notificationIntent, 0);

Notification notification = new Notification(
R.drawable.ic_stat_playing, tickerText, when);
 notification.setLatestEventInfo(getApplicationContext(), contentTitle,
contentText, pendingIntent);
 notification.contentIntent = pendingIntent;
// Make the notification non-clearable
 notification.flags = Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(notificationId, notification);
 }


*and the onCreate() is given below:*

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

 mButton = (Button) findViewById(R.id.button1);
mButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
 Log.d(TAG, Shutting down app);
finish();

 }
});

showNotification();
 }

--- code snippet

Would appreciate if someone can point me whats going wrong here. Many
thanks.

Regards,
KK

On Sat, Nov 26, 2011 at 5:25 PM, Mark Murphy mmur...@commonsware.comwrote:

 Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
 FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
 Intent. The latter finishes all other activities that might be on your
 back stack; the former simply brings any existing copy of the activity
 back to the foreground.

 On Sat, Nov 26, 2011 at 4:51 AM, KK dioxide.softw...@gmail.com wrote:
  hi All,
  I'm trying to use Notification manager and Pending Intent so that
 whenever
  the user clicks the notification the currently running activity's UI is
  shown. However in the code I'm using, as shown below opens up a new
 instance
  of the app instead of leading the user to the currently running one:
  ---code snippet
  mNotificationManager = (NotificationManager)
  getSystemService(NOTIFICATION_SERVICE);
  // //Add current song to notification bar
  CharSequence tickerText = Demo Alert;
  long when = System.currentTimeMillis();
  CharSequence contentTitle = Now playing;
  CharSequence contentText = Demo song;
  PendingIntent pendingIntent = PendingIntent.getActivity(
  getApplicationContext(), 0, new Intent(this,
  DemoPendingIntentActivity.class), 0);
  Notification notification = new Notification(
  R.drawable.ic_stat_playing, tickerText, when);
  notification.setLatestEventInfo(getApplicationContext(), contentTitle,
  contentText, pendingIntent);
  notification.contentIntent = pendingIntent;
  // Make the notification non-clearable
  notification.flags = Notification.FLAG_ONGOING_EVENT;
  mNotificationManager.notify(notificationId, notification);
  ---code snippet
  How do I open up the currently running activity instead of opening a new
  one? Please let me know whats going wrong in the above code. Appreciate
 your
  time.
  Thanks,
  KK
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



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

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

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+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 

Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread Mark Murphy
The only times I've done this with Notifications, I have used
FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP. I assumed
FLAG_ACTIVITY_REORDER_TO_FRONT would work as well, but apparently I am
mistaken.

On Sat, Nov 26, 2011 at 7:29 AM, KK dioxide.softw...@gmail.com wrote:
 Thanks for the hints. I'm trying to use the FLAG_ACTIVITY_REORDER_TO_FRONT
 flag but the behavior remains as earlier. After the activity starts, I press
 Menu to go to home and then pull down the Notification list click on the
 current one (for my demopendingintent activity) and it brings me a new
 activity page. I've added exit buttons and logs through which I'm able to
 conclude that it starts a new activity rather than bringing the one running
 in the background. May be I'm doing something wrong in my code. Please find
 below the code snippet I'm using for showing notifications etc.
 ---code snippet
 private void showNotification() {
 mNotificationManager = (NotificationManager)
 getSystemService(NOTIFICATION_SERVICE);
 // //Add current song to notification bar
 CharSequence tickerText = Demo Alert;
 long when = System.currentTimeMillis();
 CharSequence contentTitle = Now playing;
 CharSequence contentText = Demo song;
 Intent notificationIntent = new Intent(this,
 DemoPendingIntentActivity.class);
 notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
 PendingIntent pendingIntent = PendingIntent.getActivity(
 getApplicationContext(), 0, notificationIntent, 0);
 Notification notification = new Notification(
 R.drawable.ic_stat_playing, tickerText, when);
 notification.setLatestEventInfo(getApplicationContext(), contentTitle,
 contentText, pendingIntent);
 notification.contentIntent = pendingIntent;
 // Make the notification non-clearable
 notification.flags = Notification.FLAG_ONGOING_EVENT;
 mNotificationManager.notify(notificationId, notification);
 }

 and the onCreate() is given below:
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 mButton = (Button) findViewById(R.id.button1);
 mButton.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View arg0) {
 // TODO Auto-generated method stub
 Log.d(TAG, Shutting down app);
 finish();
 }
 });
 showNotification();
 }
 --- code snippet
 Would appreciate if someone can point me whats going wrong here. Many
 thanks.
 Regards,
 KK

 On Sat, Nov 26, 2011 at 5:25 PM, Mark Murphy mmur...@commonsware.com
 wrote:

 Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
 FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
 Intent. The latter finishes all other activities that might be on your
 back stack; the former simply brings any existing copy of the activity
 back to the foreground.

 On Sat, Nov 26, 2011 at 4:51 AM, KK dioxide.softw...@gmail.com wrote:
  hi All,
  I'm trying to use Notification manager and Pending Intent so that
  whenever
  the user clicks the notification the currently running activity's UI is
  shown. However in the code I'm using, as shown below opens up a new
  instance
  of the app instead of leading the user to the currently running one:
  ---code snippet
  mNotificationManager = (NotificationManager)
  getSystemService(NOTIFICATION_SERVICE);
  // //Add current song to notification bar
  CharSequence tickerText = Demo Alert;
  long when = System.currentTimeMillis();
  CharSequence contentTitle = Now playing;
  CharSequence contentText = Demo song;
  PendingIntent pendingIntent = PendingIntent.getActivity(
  getApplicationContext(), 0, new Intent(this,
  DemoPendingIntentActivity.class), 0);
  Notification notification = new Notification(
  R.drawable.ic_stat_playing, tickerText, when);
  notification.setLatestEventInfo(getApplicationContext(), contentTitle,
  contentText, pendingIntent);
  notification.contentIntent = pendingIntent;
  // Make the notification non-clearable
  notification.flags = Notification.FLAG_ONGOING_EVENT;
  mNotificationManager.notify(notificationId, notification);
  ---code snippet
  How do I open up the currently running activity instead of opening a new
  one? Please let me know whats going wrong in the above code. Appreciate
  your
  time.
  Thanks,
  KK
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



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

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

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 

Re: [android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread Mark Murphy
On Sat, Nov 26, 2011 at 7:24 AM, limtc thyech...@gmail.com wrote:
 Oh, so is this summary correct? Assuming the app requested a CAMERA
 permission.

 1) Do not declare uses-feature
 - Android Market will NOT show app to devices without camera.

Correct. Ideally, you'd still put in uses-feature with required=true
for documentation purposes, but it is not necessary.

 2) Use uses-feature android:name=android.hardware.camera
 android:required=false /
 - Android Market will show the app to all devices with or without
 camera.

Correct. You can use PackageManager and hasSystemFeature() to
determine whether the device has a camera at runtime.

 3) Use uses-feature android:name=android.hardware.camera
 android:required=true /
 - Android Market will need the camera feature to be there, and will
 NOT show app to devices without camera.

Correct.

 But if this is true, isn't 1) and 3) the same?

1) delivers the same results as 3) due to a side-effect of requiring
that permission.

http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions

Some feature constants listed in the tables above were made available
to applications after the corresponding API; for example, the
android.hardware.bluetooth feature was added in Android 2.2 (API level
8), but the bluetooth API that it refers to was added in Android 2.0
(API level 5). Because of this, some apps were able to use the API
before they had the ability to declare that they require the API via
the uses-feature system.

To prevent those apps from being made available unintentionally,
Android Market assumes that certain hardware-related permissions
indicate that the underlying hardware features are required by
default. For instance, applications that use Bluetooth must request
the BLUETOOTH permission in a uses-permission element — for legacy
apps, Android Market assumes that the permission declaration means
that the underlying android.hardware.bluetooth feature is required by
the application and sets up filtering based on that feature.

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

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

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


Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
Thank you very much Mark. I used both the flags in OR and it worked. I
should have tried it as per your last hint. Thanks again.

Regards,
KK

On Sat, Nov 26, 2011 at 6:12 PM, Mark Murphy mmur...@commonsware.comwrote:

 The only times I've done this with Notifications, I have used
 FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP. I assumed
 FLAG_ACTIVITY_REORDER_TO_FRONT would work as well, but apparently I am
 mistaken.

 On Sat, Nov 26, 2011 at 7:29 AM, KK dioxide.softw...@gmail.com wrote:
  Thanks for the hints. I'm trying to use
 the FLAG_ACTIVITY_REORDER_TO_FRONT
  flag but the behavior remains as earlier. After the activity starts, I
 press
  Menu to go to home and then pull down the Notification list click on
 the
  current one (for my demopendingintent activity) and it brings me a new
  activity page. I've added exit buttons and logs through which I'm able to
  conclude that it starts a new activity rather than bringing the one
 running
  in the background. May be I'm doing something wrong in my code. Please
 find
  below the code snippet I'm using for showing notifications etc.
  ---code snippet
  private void showNotification() {
  mNotificationManager = (NotificationManager)
  getSystemService(NOTIFICATION_SERVICE);
  // //Add current song to notification bar
  CharSequence tickerText = Demo Alert;
  long when = System.currentTimeMillis();
  CharSequence contentTitle = Now playing;
  CharSequence contentText = Demo song;
  Intent notificationIntent = new Intent(this,
  DemoPendingIntentActivity.class);
  notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
  PendingIntent pendingIntent = PendingIntent.getActivity(
  getApplicationContext(), 0, notificationIntent, 0);
  Notification notification = new Notification(
  R.drawable.ic_stat_playing, tickerText, when);
  notification.setLatestEventInfo(getApplicationContext(), contentTitle,
  contentText, pendingIntent);
  notification.contentIntent = pendingIntent;
  // Make the notification non-clearable
  notification.flags = Notification.FLAG_ONGOING_EVENT;
  mNotificationManager.notify(notificationId, notification);
  }
 
  and the onCreate() is given below:
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mButton = (Button) findViewById(R.id.button1);
  mButton.setOnClickListener(new OnClickListener() {
  @Override
  public void onClick(View arg0) {
  // TODO Auto-generated method stub
  Log.d(TAG, Shutting down app);
  finish();
  }
  });
  showNotification();
  }
  --- code snippet
  Would appreciate if someone can point me whats going wrong here. Many
  thanks.
  Regards,
  KK
 
  On Sat, Nov 26, 2011 at 5:25 PM, Mark Murphy mmur...@commonsware.com
  wrote:
 
  Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
  FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
  Intent. The latter finishes all other activities that might be on your
  back stack; the former simply brings any existing copy of the activity
  back to the foreground.
 
  On Sat, Nov 26, 2011 at 4:51 AM, KK dioxide.softw...@gmail.com wrote:
   hi All,
   I'm trying to use Notification manager and Pending Intent so that
   whenever
   the user clicks the notification the currently running activity's UI
 is
   shown. However in the code I'm using, as shown below opens up a new
   instance
   of the app instead of leading the user to the currently running one:
   ---code snippet
   mNotificationManager = (NotificationManager)
   getSystemService(NOTIFICATION_SERVICE);
   // //Add current song to notification bar
   CharSequence tickerText = Demo Alert;
   long when = System.currentTimeMillis();
   CharSequence contentTitle = Now playing;
   CharSequence contentText = Demo song;
   PendingIntent pendingIntent = PendingIntent.getActivity(
   getApplicationContext(), 0, new Intent(this,
   DemoPendingIntentActivity.class), 0);
   Notification notification = new Notification(
   R.drawable.ic_stat_playing, tickerText, when);
   notification.setLatestEventInfo(getApplicationContext(), contentTitle,
   contentText, pendingIntent);
   notification.contentIntent = pendingIntent;
   // Make the notification non-clearable
   notification.flags = Notification.FLAG_ONGOING_EVENT;
   mNotificationManager.notify(notificationId, notification);
   ---code snippet
   How do I open up the currently running activity instead of opening a
 new
   one? Please let me know whats going wrong in the above code.
 Appreciate
   your
   time.
   Thanks,
   KK
  
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en
 
 
 
  --
  Mark Murphy 

Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread Mark Murphy
On Sat, Nov 26, 2011 at 8:07 AM, KK dioxide.softw...@gmail.com wrote:
 Thank you very much Mark. I used both the flags in OR and it worked. I
 should have tried it as per your last hint. Thanks again.

No problem. Eventually, I'm going to spend the time to try a zillion
combinations of Intent flags, activity attributes, and launching
scenarios and try to come up with a definitive roster of
recommendations. That shouldn't take more than three, maybe four years
for me to work through... :-)

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

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

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


[android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread limtc
I see. Thanks for the explanation!

So if I don't declare it, based on the table, it will assume I uses
features:

android.hardware.camera and
android.hardware.camera.autofocus

So in order for me to show the app in Android Market that does not
support camera (like low end camera-less tablets), I will need:

uses-feature android:name=android.hardware.camera
android:required=false /

I am not too sure whether I need to declare or not? Since autofocus is
often unnecessary for many apps.

uses-feature android:name=android.hardware.camera.autofocus
android:required=false /

On 11月26日, 下午8时45分, Mark Murphy mmur...@commonsware.com wrote:

 1) delivers the same results as 3) due to a side-effect of requiring
 that permission.

 http://developer.android.com/guide/topics/manifest/uses-feature-eleme...

 Some feature constants listed in the tables above were made available
 to applications after the corresponding API; for example, the
 android.hardware.bluetooth feature was added in Android 2.2 (API level
 8), but the bluetooth API that it refers to was added in Android 2.0
 (API level 5). Because of this, some apps were able to use the API
 before they had the ability to declare that they require the API via
 the uses-feature system.

 To prevent those apps from being made available unintentionally,
 Android Market assumes that certain hardware-related permissions
 indicate that the underlying hardware features are required by
 default. For instance, applications that use Bluetooth must request
 the BLUETOOTH permission in a uses-permission element — for legacy
 apps, Android Market assumes that the permission declaration means
 that the underlying android.hardware.bluetooth feature is required by
 the application and sets up filtering based on that feature.

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

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

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


[android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Binxalot
How are small developers to pay this fee upfront for the privilege of
having their games appear in the marketplace? It's already clear
Google only wants AAA titles upfront and center on the marketplace
splash page which was bound to happen, but can the platform really
support itself with only a handful of AAA developers making apps? .
Anyone have any idea as to how bad this is going to be?  Is there a
group lobbying Google and the esrb on behalf indie developers that we
can rally behind?

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


Re: [android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread Mark Murphy
On Sat, Nov 26, 2011 at 9:12 AM, limtc thyech...@gmail.com wrote:
 I am not too sure whether I need to declare or not? Since autofocus is
 often unnecessary for many apps.

 uses-feature android:name=android.hardware.camera.autofocus
 android:required=false /

AFAIK, if you do not require a camera, you do not require an autofocus camera.

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

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

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


Re: [android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Christopher Van Kirk
Can you please provide a link to the press release that has caused your 
apparent panic?


On 11/26/2011 11:09 PM, Binxalot wrote:

How are small developers to pay this fee upfront for the privilege of
having their games appear in the marketplace? It's already clear
Google only wants AAA titles upfront and center on the marketplace
splash page which was bound to happen, but can the platform really
support itself with only a handful of AAA developers making apps? .
Anyone have any idea as to how bad this is going to be?  Is there a
group lobbying Google and the esrb on behalf indie developers that we
can rally behind?



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


Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer

Using Intent

Intent intent = new Intent();
intent.setClass(getApplicationContext(),  display.class);
startActivity(intent);

The activity is hardware accelerated.  When I call this intent
the layout is   NOT   hardware accelerated
How can I create  an intent  that  is Also hardware accelerated ?

Thanks in advance



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

Re: [android-developers] hardware acceleration

2011-11-26 Thread Mark Murphy
There is no such thing as an intent  that  is Also hardware accelerated.

On Sat, Nov 26, 2011 at 1:57 PM, New Developer secur...@isscp.com wrote:
 Using Intent

     Intent intent = new Intent();
     intent.setClass(getApplicationContext(),  display.class);
     startActivity(intent);

 The activity is hardware accelerated.  When I call this intent
 the layout is   NOT   hardware accelerated
 How can I create  an intent  that  is Also hardware accelerated ?

 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



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

_Android Programming Tutorials_ Version 4.1 Available!

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


Re: [android-developers] hardware acceleration

2011-11-26 Thread Kristopher Micinski
What would it even mean to hardware accelerate an intent?

What?

I'm confused.

The activity the intent targets uses hardware accelerated graphics?

kris

On Sat, Nov 26, 2011 at 2:04 PM, Mark Murphy mmur...@commonsware.comwrote:

 There is no such thing as an intent  that  is Also hardware accelerated.

 On Sat, Nov 26, 2011 at 1:57 PM, New Developer secur...@isscp.com wrote:
  Using Intent
 
  Intent intent = new Intent();
  intent.setClass(getApplicationContext(),  display.class);
  startActivity(intent);
 
  The activity is hardware accelerated.  When I call this intent
  the layout is   NOT   hardware accelerated
  How can I create  an intent  that  is Also hardware accelerated ?
 
  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



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

 _Android Programming Tutorials_ Version 4.1 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Greystripe

2011-11-26 Thread bob


On Nov 25, 9:55 pm, Raghav Sood raghavs...@androidactivist.org
wrote:
 TreKing is right, this shouldn't be on this list.

 However, I'll try to help. It will take close to 24 hours for the ID to be
 of any use. And even after that, Greystripe will manually review every app
 before they pay you for any of the ads displayed. Some of my apps were in
 the review process for almost two months, before I shifted to AdMob. The
 only way I got any of the apps reviewed was by writing to support.

 Please do not post non Android SDM questions on this list again.

 Raghav Sood
 Sent from my Nexus S
 On Nov 26, 2011 5:42 AM, TreKing treking...@gmail.com wrote:







  On Fri, Nov 25, 2011 at 11:14 PM, bob b...@coolgroups.com wrote:

  How long do you have to wait after creating a Greystripe ID before
  you can use it?

  You seem to have confused this list for Greystripe support.

  -
  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

Does Admob offer interstitials?  I'd consider switching to them as
well if they did.

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


Re: [android-developers] Re: Greystripe

2011-11-26 Thread Raghav Sood
I don't think so.

On Sun, Nov 27, 2011 at 12:44 AM, bob b...@coolgroups.com wrote:



 On Nov 25, 9:55 pm, Raghav Sood raghavs...@androidactivist.org
 wrote:
  TreKing is right, this shouldn't be on this list.
 
  However, I'll try to help. It will take close to 24 hours for the ID to
 be
  of any use. And even after that, Greystripe will manually review every
 app
  before they pay you for any of the ads displayed. Some of my apps were in
  the review process for almost two months, before I shifted to AdMob. The
  only way I got any of the apps reviewed was by writing to support.
 
  Please do not post non Android SDM questions on this list again.
 
  Raghav Sood
  Sent from my Nexus S
  On Nov 26, 2011 5:42 AM, TreKing treking...@gmail.com wrote:
 
 
 
 
 
 
 
   On Fri, Nov 25, 2011 at 11:14 PM, bob b...@coolgroups.com wrote:
 
   How long do you have to wait after creating a Greystripe ID before
   you can use it?
 
   You seem to have confused this list for Greystripe support.
 
  
 -
   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

 Does Admob offer interstitials?  I'd consider switching to them as
 well if they did.

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




-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

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

Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer

my mistake
I'm meaning the Activity that the intent  calls/starts

public class display extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
fName = CURRENT_IMAGE;
setContentView(R.layout.image_viewer);


getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED , 
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);


parent = (FrameLayout) findViewById(R.id.image);
parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e(display, parent  is   + parent.isHardwareAccelerated());
video  = (VideoView) findViewById(R.id.video);
Log.e(display, 1) videois   + video.isHardwareAccelerated());

both parent and video  return  FALSE ,  How do I get them too return true ?
I'm under the impression getWindow  and  setLayerType   would do it

Thanks in advance



On 11/26/2011 01:57 PM, New Developer wrote:

Using Intent

Intent intent = new Intent();
intent.setClass(getApplicationContext(),  display.class);
startActivity(intent);

The activity is hardware accelerated.  When I call this intent
the layout is   NOT   hardware accelerated
How can I create  an intent  that  is Also hardware accelerated ?

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

[android-developers] screenshots

2011-11-26 Thread bob
Anyone know why my screenshots come out all jacked up on my Vizio tab?

Here's an example:

http://i1190.photobucket.com/albums/z449/m75214/vizio-1.png

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


Re: [android-developers] hardware acceleration

2011-11-26 Thread Romain Guy
Try setting the flag before calling setContentView(). You should also not
have to do it this way. The best way to enable hardware acceleration is to
set android:hardwareAccelerated=true on the application/ tag of your
manifest. You should not do it manually one very activity and/or window
unless you have very good reasons to do so.

On Sat, Nov 26, 2011 at 11:23 AM, New Developer secur...@isscp.com wrote:

  my mistake
 I'm meaning the Activity that the intent  calls/starts

 public class display extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 fName = CURRENT_IMAGE;
 setContentView(R.layout.image_viewer);


 getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED ,
 WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);

 parent = (FrameLayout) findViewById(R.id.image);
 parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 Log.e(display, parent  is   + parent.isHardwareAccelerated());
 video  = (VideoView) findViewById(R.id.video);
 Log.e(display, 1) videois   + video.isHardwareAccelerated());

 both parent and video  return  FALSE ,  How do I get them too return true ?
 I'm under the impression getWindow  and  setLayerType   would do it

 Thanks in advance




 On 11/26/2011 01:57 PM, New Developer wrote:

 Using Intent

 Intent intent = new Intent();
 intent.setClass(getApplicationContext(),  display.class);
 startActivity(intent);

 The activity is hardware accelerated.  When I call this intent
 the layout is   NOT   hardware accelerated
 How can I create  an intent  that  is Also hardware accelerated ?

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




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

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

[android-developers] Re: Android paid technical support

2011-11-26 Thread jtoolsdev
For users Google could do a lot better job about being in the face of new 
users to understand how the Market works.  I occasionally get those if I 
get a new phone can I move your app on it emails which are NOT for the 
developer to actually answer.   I point them to the Market Help and at the 
same time tell them sure, as long as you don't change your email 
associated with the Market.

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

Re: [android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Jim Graham
On Sun, Nov 27, 2011 at 01:58:57AM +0800, Christopher Van Kirk wrote:
 On 11/26/2011 11:09 PM, Binxalot wrote:
 How are small developers to pay this fee upfront for the privilege of
 having their games appear in the marketplace?

 Can you please provide a link to the press release that has caused
 your apparent panic?

I'll second that  First, what is an ESRB rating, and why should
we care?  If something like this were true, wouldn't there have been
a post from google (or rather, someone from google) here to let us
know about it?

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)  | 1) Smoking habanero powder helps defeat that
 Running FreeBSD 7.0|off taste' quite nicely.
spooky1...@gmail.com  | 2) I figure a couple bong hits of [habanero]
ICBM/Hurr.: / 30.44406N   |powder would defeat just about anything!
| 86.59909W--seen in Chile-Heads list

Android Apps Listing at http://www.jstrack.org/barcodes.html

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


Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer

Thanks
I would tend to agree, sadly  I already have the  
android:hardwareAccelerated=true  set in manifest
application  android:icon=@drawable/logo   
android:hardwareAccelerated=true   android:label=@string/app_name 
android:debuggable=true android:theme=@android:style/Theme.NoTitleBar


I also have it on both Activities
activity android:name=MainActivity android:hardwareAccelerated=true 
android:screenOrientation=landscape 
android:configChanges=orientation /
activity android:name=display  android:hardwareAccelerated=true 
android:screenOrientation=landscape 
android:configChanges=orientation /


this I think is what gives the screen  isHardwareAccelerated  as  true

11-26 15:25:54.730: E/main(16712): screen   is  true --  from 
MainActivity  just before  startActivity is called
11-26 15:25:55.140: E/display(16712): parent  is  false --  from 
display.class  showing the parent is now false

11-26 15:25:55.140: E/display(16712): video   is  false

This was after I moved the getWindow  before the setContentView()  as 
suggested


setContentView(R.layout.image_viewer);

parent = (FrameLayout) findViewById(R.id.image);
parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e(display, parent  is   + parent.isHardwareAccelerated());
video  = (VideoView) findViewById(R.id.video);
Log.e(display, video   is   + video.isHardwareAccelerated());



Anything else I can try ?

Thanks again
On 11/26/2011 03:02 PM, Romain Guy wrote:
Try setting the flag before calling setContentView(). You should also 
not have to do it this way. The best way to enable hardware 
acceleration is to set android:hardwareAccelerated=true on the 
application/ tag of your manifest. You should not do it manually one 
very activity and/or window unless you have very good reasons to do so.


On Sat, Nov 26, 2011 at 11:23 AM, New Developer secur...@isscp.com 
mailto:secur...@isscp.com wrote:


my mistake
I'm meaning the Activity that the intent  calls/starts

public class display extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
fName = CURRENT_IMAGE;
setContentView(R.layout.image_viewer);

   
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED

, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);

parent = (FrameLayout) findViewById(R.id.image);
parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e(display, parent  is   + parent.isHardwareAccelerated());
video  = (VideoView) findViewById(R.id.video);
Log.e(display, 1) videois   + video.isHardwareAccelerated());

both parent and video  return  FALSE ,  How do I get them too
return true ?
I'm under the impression getWindow  and  setLayerType   would do it

Thanks in advance




On 11/26/2011 01:57 PM, New Developer wrote:

Using Intent

Intent intent = new Intent();
intent.setClass(getApplicationContext(),  display.class);
startActivity(intent);

The activity is hardware accelerated.  When I call this intent
the layout is   NOT   hardware accelerated
How can I create  an intent  that  is Also hardware accelerated ?

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


-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




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

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


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 

Re: [android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Kristopher Micinski
On Sat, Nov 26, 2011 at 3:20 PM, Jim Graham spooky1...@gmail.com wrote:

 On Sun, Nov 27, 2011 at 01:58:57AM +0800, Christopher Van Kirk wrote:
  On 11/26/2011 11:09 PM, Binxalot wrote:
  How are small developers to pay this fee upfront for the privilege of
  having their games appear in the marketplace?
 
  Can you please provide a link to the press release that has caused
  your apparent panic?

 I'll second that  First, what is an ESRB rating, and why should
 we care?  If something like this were true, wouldn't there have been
 a post from google (or rather, someone from google) here to let us
 know about it?

 Later,
   --jim


Jim,

ESRB?  That huge organization that rates video games and puts the little
T, E, and occasionally M stickers on the games?

http://www.original-gamer.com/og/images/esrb.png

Surely you've seen the little icons, but it is scary if it is indeed that
the market is biasing towards games with endorsed ratings..

kris

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

Re: [android-developers] hardware acceleration

2011-11-26 Thread Romain Guy
You are doing the check from onCreate(), it's too early. At this point, the
view hierarchy may have not enabled hardware acceleration yet.

On Sat, Nov 26, 2011 at 12:31 PM, New Developer secur...@isscp.com wrote:

  Thanks
 I would tend to agree, sadly  I already have the
 android:hardwareAccelerated=true  set in manifest
 application  android:icon=@drawable/logo
 android:hardwareAccelerated=true   android:label=@string/app_name
 android:debuggable=true android:theme=@android:style/Theme.NoTitleBar

 I also have it on both Activities
 activity android:name=MainActivity android:hardwareAccelerated=true
 android:screenOrientation=landscape android:configChanges=orientation
 /
 activity android:name=display  android:hardwareAccelerated=true
 android:screenOrientation=landscape android:configChanges=orientation
 /

 this I think is what gives the screen  isHardwareAccelerated  as  true

 11-26 15:25:54.730: E/main(16712): screen   is  true   --  from
 MainActivity  just before  startActivity is called
 11-26 15:25:55.140: E/display(16712): parent  is  false--  from
 display.class  showing the parent is now false
 11-26 15:25:55.140: E/display(16712): video   is  false

 This was after I moved the getWindow  before the setContentView()  as
 suggested

 setContentView(R.layout.image_viewer);

 parent = (FrameLayout) findViewById(R.id.image);
 parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 Log.e(display, parent  is   + parent.isHardwareAccelerated());
 video  = (VideoView) findViewById(R.id.video);
 Log.e(display, video   is   + video.isHardwareAccelerated());



 Anything else I can try ?

 Thanks again
 On 11/26/2011 03:02 PM, Romain Guy wrote:

 Try setting the flag before calling setContentView(). You should also not
 have to do it this way. The best way to enable hardware acceleration is to
 set android:hardwareAccelerated=true on the application/ tag of your
 manifest. You should not do it manually one very activity and/or window
 unless you have very good reasons to do so.

 On Sat, Nov 26, 2011 at 11:23 AM, New Developer secur...@isscp.comwrote:

  my mistake
 I'm meaning the Activity that the intent  calls/starts

 public class display extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 fName = CURRENT_IMAGE;
 setContentView(R.layout.image_viewer);


 getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED ,
 WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);

 parent = (FrameLayout) findViewById(R.id.image);
 parent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 Log.e(display, parent  is   + parent.isHardwareAccelerated());
 video  = (VideoView) findViewById(R.id.video);
 Log.e(display, 1) videois   + video.isHardwareAccelerated());

 both parent and video  return  FALSE ,  How do I get them too return true
 ?
 I'm under the impression getWindow  and  setLayerType   would do it

 Thanks in advance




 On 11/26/2011 01:57 PM, New Developer wrote:

 Using Intent

 Intent intent = new Intent();
 intent.setClass(getApplicationContext(),  display.class);
 startActivity(intent);

 The activity is hardware accelerated.  When I call this intent
 the layout is   NOT   hardware accelerated
 How can I create  an intent  that  is Also hardware accelerated ?

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




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

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





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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to

Re: [android-developers] screenshots

2011-11-26 Thread Mark Murphy
It's possible it's a bug in the device. Some devices do not send
appropriate screenshot data to DDMS. I've had a couple that did that,
notably the Qualcomm MDP.

On Sat, Nov 26, 2011 at 2:32 PM, bob b...@coolgroups.com wrote:
 Anyone know why my screenshots come out all jacked up on my Vizio tab?

 Here's an example:

 http://i1190.photobucket.com/albums/z449/m75214/vizio-1.png

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




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

_Android Programming Tutorials_ Version 4.1 Available!

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


Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer
Ok then perhaps I'm barking up the wrong tree looking at hardware 
acceleration


LayoutInflater inflater = (LayoutInflater) 
getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

view = inflater.inflate(R.layout.image_viewer, screen);

FrameLayout parent = (FrameLayout) 
view.findViewById(R.id.image);

Log.e(main, view is   + view.isHardwareAccelerated()   );
Media   image  = null;
Log.e(main, parent   is   + parent.isHardwareAccelerated() );

image = new Media_Video  (getApplicationContext() , parent 
, fName);


Log.e(main, =);
Log.e(main, view   is   + view.isHardwareAccelerated()   );
Log.e(main, parent is   + parent.isHardwareAccelerated() );
Log.e(main, image  is   + image.isHardwareAccelerated()  );
Log.e(main, screen is   + screen.isHardwareAccelerated() );
Log.e(main, =);
image.ButtonSetup(view);
screen.setOnTouchListener(image);


Where Media_Video   has the following
video  = (VideoView) screen.findViewById(R.id.video);
video.setKeepScreenOn(true);
video.setClickable(true);
video.setVideoPath(fName);

Log.i(video, screen   is   + screen.isHardwareAccelerated()   );
Log.i(video, videois   + video.isHardwareAccelerated());
Log.w(video , How has focus  + video.findFocus());
Log.w(video , video Buffer   + video.getBufferPercentage()  );
Log.w(video , video Layer Type   + video.getLayerType() );
Log.w(video , video Visibility   + video.getVisibility());
Log.w(video , video Screen On+ video.getKeepScreenOn()  );
Log.w(video , video is Clickable + video.isClickable()  );
Log.w(video , video is Focusable + video.isFocusable()  );
Log.w(video , video is Visibility+ video.getVisibility());
Log.w(video , video  has a  Holder   + (video.getHolder() == null)  );
Log.w(video , video root View+ video.getRootView()  );
Log.w(video , video is Opaque+ video.isOpaque() );
Log.w(video , video is Shown + video.isShown()  );


Thus resulting  in the following LogCat:

11-26 17:21:53.000: E/main(21376): screen   is  true
11-26 17:21:53.000: I/CHECK(21376): Child  0 is of type  
LinearLayout

11-26 17:21:53.250: E/main(21376): view is  true
11-26 17:21:53.250: E/main(21376): parent   is  true
11-26 17:21:53.250: I/video(21376): Mediaconstructor  started
11-26 17:21:53.550: I/video(21376): Mediaconstructor   CALLED
11-26 17:21:53.550: I/video(21376): Media_video constructor  started
11-26 17:21:53.550: E/Video Media(21376): VIDEO Initalized   
[/sdcard/DCIM/Videos/Lazy J_Crystal_20110813_102429.3gp]

11-26 17:21:53.550: I/video(21376): screen   is  true
11-26 17:21:53.550: I/video(21376): videois  true
11-26 17:21:53.550: W/video(21376): How has focus 
android.widget.VideoView@40d50d70

11-26 17:21:53.550: W/video(21376): video Buffer  0
11-26 17:21:53.550: W/video(21376): video Layer Type  0
11-26 17:21:53.550: W/video(21376): video Visibility  0
11-26 17:21:53.550: W/video(21376): video Screen On   true
11-26 17:21:53.550: W/video(21376): video is Clickabletrue
11-26 17:21:53.550: W/video(21376): video is Focusabletrue
11-26 17:21:53.550: W/video(21376): video is Visibility   0
11-26 17:21:53.550: W/video(21376): video  has a  Holder  false
11-26 17:21:53.550: W/video(21376): video root View   
com.android.internal.policy.impl.PhoneWindow$DecorView@4098eb98

11-26 17:21:53.550: W/video(21376): video is Opaque   true
11-26 17:21:53.550: W/video(21376): video is Showntrue
11-26 17:21:53.610: E/main(21376): 
=
11-26 17:21:53.760: E/Surface(21376): surface (identity=3592) is 
invalid, err=-19 (No such device)
11-26 17:21:53.770: D/CallStack(21376): Surface#00  pc 00013b5e  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#01  pc 00013b9c  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#02  pc 00013c1a  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#03  pc 4f38  
/system/lib/libEGL.so
11-26 17:21:53.770: D/CallStack(21376): Surface#04  pc 00036dca  
/system/lib/libandroid_runtime.so

11-26 17:21:54.120: D/MediaPlayer(21376): getMetadata


These all show isHardwareAccelerationastrue
Which still produces  the error  and   Video with NO picture  , Video 
with only audio


What then produces the err=-19  error ?





--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to

Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer
Does hardware acceleration effect in any way   VideoView  when 
displaying a video ?


Thinking back and seeing that onCreate reports hardwareAcceleration as 
false, because this is too early

and in fact it is true when checked after onCreate.

perhaps all along I have had hardware acceleration, so then the question 
should have been does  h/w acc.  effect VideoView

and this is why I can hear but not see the video ?

Thanks


On 11/26/2011 05:31 PM, New Developer wrote:
Ok then perhaps I'm barking up the wrong tree looking at hardware 
acceleration


LayoutInflater inflater = (LayoutInflater) 
getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 


view = inflater.inflate(R.layout.image_viewer, screen);

FrameLayout parent = (FrameLayout) 
view.findViewById(R.id.image);

Log.e(main, view is   + view.isHardwareAccelerated()   );
Media   image  = null;
Log.e(main, parent   is   + parent.isHardwareAccelerated() );

image = new Media_Video  (getApplicationContext() , parent 
, fName);


Log.e(main, =);
Log.e(main, view   is   + view.isHardwareAccelerated()   );
Log.e(main, parent is   + parent.isHardwareAccelerated() );
Log.e(main, image  is   + image.isHardwareAccelerated()  );
Log.e(main, screen is   + screen.isHardwareAccelerated() );
Log.e(main, =);
image.ButtonSetup(view);
screen.setOnTouchListener(image);


Where Media_Video   has the following
video  = (VideoView) screen.findViewById(R.id.video);
video.setKeepScreenOn(true);
video.setClickable(true);
video.setVideoPath(fName);

Log.i(video, screen   is   + screen.isHardwareAccelerated()   );
Log.i(video, videois   + video.isHardwareAccelerated());
Log.w(video , How has focus  + video.findFocus());
Log.w(video , video Buffer   + video.getBufferPercentage()  );
Log.w(video , video Layer Type   + video.getLayerType() );
Log.w(video , video Visibility   + video.getVisibility());
Log.w(video , video Screen On+ video.getKeepScreenOn()  );
Log.w(video , video is Clickable + video.isClickable()  );
Log.w(video , video is Focusable + video.isFocusable()  );
Log.w(video , video is Visibility+ video.getVisibility());
Log.w(video , video  has a  Holder   + (video.getHolder() == null)  );
Log.w(video , video root View+ video.getRootView()  );
Log.w(video , video is Opaque+ video.isOpaque() );
Log.w(video , video is Shown + video.isShown()  );


Thus resulting  in the following LogCat:

11-26 17:21:53.000: E/main(21376): screen   is  true
11-26 17:21:53.000: I/CHECK(21376): Child  0 is of type  
LinearLayout

11-26 17:21:53.250: E/main(21376): view is  true
11-26 17:21:53.250: E/main(21376): parent   is  true
11-26 17:21:53.250: I/video(21376): Mediaconstructor  started
11-26 17:21:53.550: I/video(21376): Mediaconstructor   CALLED
11-26 17:21:53.550: I/video(21376): Media_video constructor  started
11-26 17:21:53.550: E/Video Media(21376): VIDEO Initalized   
[/sdcard/DCIM/Videos/Lazy J_Crystal_20110813_102429.3gp]

11-26 17:21:53.550: I/video(21376): screen   is  true
11-26 17:21:53.550: I/video(21376): videois  true
11-26 17:21:53.550: W/video(21376): How has focus 
android.widget.VideoView@40d50d70

11-26 17:21:53.550: W/video(21376): video Buffer  0
11-26 17:21:53.550: W/video(21376): video Layer Type  0
11-26 17:21:53.550: W/video(21376): video Visibility  0
11-26 17:21:53.550: W/video(21376): video Screen On   true
11-26 17:21:53.550: W/video(21376): video is Clickabletrue
11-26 17:21:53.550: W/video(21376): video is Focusabletrue
11-26 17:21:53.550: W/video(21376): video is Visibility   0
11-26 17:21:53.550: W/video(21376): video  has a  Holder  false
11-26 17:21:53.550: W/video(21376): video root View   
com.android.internal.policy.impl.PhoneWindow$DecorView@4098eb98

11-26 17:21:53.550: W/video(21376): video is Opaque   true
11-26 17:21:53.550: W/video(21376): video is Showntrue
11-26 17:21:53.610: E/main(21376): 
=
11-26 17:21:53.760: E/Surface(21376): surface (identity=3592) is 
invalid, err=-19 (No such device)
11-26 17:21:53.770: D/CallStack(21376): Surface#00  pc 00013b5e  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#01  pc 00013b9c  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#02  pc 00013c1a  
/system/lib/libsurfaceflinger_client.so
11-26 17:21:53.770: D/CallStack(21376): Surface#03  pc 4f38  
/system/lib/libEGL.so
11-26 17:21:53.770: D/CallStack(21376): Surface#04  pc 00036dca  
/system/lib/libandroid_runtime.so

11-26 17:21:54.120: 

Re: [android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Jim Graham
On Sat, Nov 26, 2011 at 03:57:38PM -0500, Kristopher Micinski wrote:

 ESRB?  That huge organization that rates video games and puts the
 little T, E, and occasionally M stickers on the games?

Oh, those ratings.  Ok, got it now


 but it is scary if it is indeed [true] that the market is
 biasing towards games with endorsed ratings..

Well, yes and no  I would just expect the games to end up moving
to a different market (like soc.io, spamazon, etc.).  Of course, if
joe.average Android user doesn't KNOW about those other marketsyeah,
you're right...it's bad.  :-(

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)MiSTie #49997   Running FreeBSD 7.0 
spooky1...@gmail.comICBM/Hurr.: 30.44406N 86.59909W

   Saw something on TV about Psych-os.
 H, Psych OS.  Perhaps the next freeware OS   --me

Android Apps Listing at http://www.jstrack.org/barcodes.html

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


Re: [android-developers] hardware acceleration

2011-11-26 Thread Romain Guy
VideoView should not be affected by hardware acceleration since its
rendering happens in a different window.

On Sat, Nov 26, 2011 at 2:45 PM, New Developer secur...@isscp.com wrote:

  Does hardware acceleration effect in any way   VideoView  when displaying
 a video ?

 Thinking back and seeing that onCreate reports hardwareAcceleration as
 false, because this is too early
 and in fact it is true when checked after onCreate.

 perhaps all along I have had hardware acceleration, so then the question
 should have been does  h/w acc.  effect VideoView
 and this is why I can hear but not see the video ?

 Thanks



 On 11/26/2011 05:31 PM, New Developer wrote:

 Ok then perhaps I'm barking up the wrong tree looking at hardware
 acceleration

 LayoutInflater inflater = (LayoutInflater)
 getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 view = inflater.inflate(R.layout.image_viewer, screen);

 FrameLayout parent = (FrameLayout)
 view.findViewById(R.id.image);
 Log.e(main, view is   + view.isHardwareAccelerated()   );
 Media   image  = null;
 Log.e(main, parent   is   + parent.isHardwareAccelerated() );

 image = new Media_Video  (getApplicationContext() , parent ,
 fName);

 Log.e(main, =);
 Log.e(main, view   is   + view.isHardwareAccelerated()   );
 Log.e(main, parent is   + parent.isHardwareAccelerated() );
 Log.e(main, image  is   + image.isHardwareAccelerated()  );
 Log.e(main, screen is   + screen.isHardwareAccelerated() );
 Log.e(main, =);
 image.ButtonSetup(view);
 screen.setOnTouchListener(image);


 Where Media_Video   has the following
 video  = (VideoView) screen.findViewById(R.id.video);
 video.setKeepScreenOn(true);
 video.setClickable(true);
 video.setVideoPath(fName);

 Log.i(video, screen   is   + screen.isHardwareAccelerated()   );

 Log.i(video, videois   + video.isHardwareAccelerated());

 Log.w(video , How has focus  + video.findFocus());
 Log.w(video , video Buffer   + video.getBufferPercentage()  );
 Log.w(video , video Layer Type   + video.getLayerType() );
 Log.w(video , video Visibility   + video.getVisibility());
 Log.w(video , video Screen On+ video.getKeepScreenOn()  );
 Log.w(video , video is Clickable + video.isClickable()  );
 Log.w(video , video is Focusable + video.isFocusable()  );
 Log.w(video , video is Visibility+ video.getVisibility());
 Log.w(video , video  has a  Holder   + (video.getHolder() == null)  );
 Log.w(video , video root View+ video.getRootView()  );
 Log.w(video , video is Opaque+ video.isOpaque() );
 Log.w(video , video is Shown + video.isShown()  );


 Thus resulting  in the following LogCat:

 11-26 17:21:53.000: E/main(21376): screen   is  true
 11-26 17:21:53.000: I/CHECK(21376): Child  0 is of type
 LinearLayout
 11-26 17:21:53.250: E/main(21376): view is  true
 11-26 17:21:53.250: E/main(21376): parent   is  true
 11-26 17:21:53.250: I/video(21376): Mediaconstructor  started
 11-26 17:21:53.550: I/video(21376): Mediaconstructor   CALLED
 11-26 17:21:53.550: I/video(21376): Media_video constructor  started
 11-26 17:21:53.550: E/Video Media(21376): VIDEO Initalized
 [/sdcard/DCIM/Videos/Lazy J_Crystal_20110813_102429.3gp]
 11-26 17:21:53.550: I/video(21376): screen   is  true
 11-26 17:21:53.550: I/video(21376): videois  true
 11-26 17:21:53.550: W/video(21376): How has focus
 android.widget.VideoView@40d50d70
 11-26 17:21:53.550: W/video(21376): video Buffer  0
 11-26 17:21:53.550: W/video(21376): video Layer Type  0
 11-26 17:21:53.550: W/video(21376): video Visibility  0
 11-26 17:21:53.550: W/video(21376): video Screen On   true
 11-26 17:21:53.550: W/video(21376): video is Clickabletrue
 11-26 17:21:53.550: W/video(21376): video is Focusabletrue
 11-26 17:21:53.550: W/video(21376): video is Visibility   0
 11-26 17:21:53.550: W/video(21376): video  has a  Holder  false
 11-26 17:21:53.550: W/video(21376): video root View
 com.android.internal.policy.impl.PhoneWindow$DecorView@4098eb98
 11-26 17:21:53.550: W/video(21376): video is Opaque   true
 11-26 17:21:53.550: W/video(21376): video is Showntrue
 11-26 17:21:53.610: E/main(21376):
 =
 11-26 17:21:53.760: E/Surface(21376): surface (identity=3592) is invalid,
 err=-19 (No such device)
 11-26 17:21:53.770: D/CallStack(21376): Surface#00  pc 00013b5e
 /system/lib/libsurfaceflinger_client.so
 11-26 17:21:53.770: D/CallStack(21376): Surface#01  pc 00013b9c
 /system/lib/libsurfaceflinger_client.so
 11-26 17:21:53.770: D/CallStack(21376): Surface#02  pc 00013c1a
 

Re: [android-developers] hardware acceleration

2011-11-26 Thread New Developer

Thanks that is good to know,
then what causes the err=-19  and the image not to show , while the 
audio plays.
It is a std  .3gp file recorded using the camera.  and plays fine with 
Gallery


All help has been greatly appreciated


On 11/26/2011 06:35 PM, Romain Guy wrote:
VideoView should not be affected by hardware acceleration since its 
rendering happens in a different window.


On Sat, Nov 26, 2011 at 2:45 PM, New Developer secur...@isscp.com 
mailto:secur...@isscp.com wrote:


Does hardware acceleration effect in any way   VideoView  when
displaying a video ?

Thinking back and seeing that onCreate reports
hardwareAcceleration as false, because this is too early
and in fact it is true when checked after onCreate.

perhaps all along I have had hardware acceleration, so then the
question should have been does  h/w acc.  effect VideoView
and this is why I can hear but not see the video ?

Thanks



On 11/26/2011 05:31 PM, New Developer wrote:

Ok then perhaps I'm barking up the wrong tree looking at hardware
acceleration

LayoutInflater inflater = (LayoutInflater)
getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

view = inflater.inflate(R.layout.image_viewer, screen);

FrameLayout parent = (FrameLayout)
view.findViewById(R.id.image);
Log.e(main, view is   + view.isHardwareAccelerated()   );
Media   image  = null;
Log.e(main, parent   is   + parent.isHardwareAccelerated() );

image = new Media_Video  (getApplicationContext() ,
parent , fName);

Log.e(main, =);
Log.e(main, view   is   + view.isHardwareAccelerated()   );
Log.e(main, parent is   + parent.isHardwareAccelerated() );
Log.e(main, image  is   + image.isHardwareAccelerated()  );
Log.e(main, screen is   + screen.isHardwareAccelerated() );
Log.e(main, =);
image.ButtonSetup(view);
screen.setOnTouchListener(image);


Where Media_Video   has the following
video  = (VideoView) screen.findViewById(R.id.video);
video.setKeepScreenOn(true);
video.setClickable(true);
video.setVideoPath(fName);

Log.i(video, screen   is   + screen.isHardwareAccelerated()   );
Log.i(video, videois   + video.isHardwareAccelerated());
Log.w(video , How has focus  +
video.findFocus());
Log.w(video , video Buffer   +
video.getBufferPercentage()  );
Log.w(video , video Layer Type   +
video.getLayerType() );
Log.w(video , video Visibility   +
video.getVisibility());
Log.w(video , video Screen On+
video.getKeepScreenOn()  );
Log.w(video , video is Clickable +
video.isClickable()  );
Log.w(video , video is Focusable +
video.isFocusable()  );
Log.w(video , video is Visibility+
video.getVisibility());
Log.w(video , video  has a  Holder   + (video.getHolder() ==
null)  );
Log.w(video , video root View+
video.getRootView()  );
Log.w(video , video is Opaque+
video.isOpaque() );
Log.w(video , video is Shown +
video.isShown()  );


Thus resulting  in the following LogCat:

11-26 17:21:53.000: E/main(21376): screen   is  true
11-26 17:21:53.000: I/CHECK(21376): Child  0 is of type 
LinearLayout

11-26 17:21:53.250: E/main(21376): view is  true
11-26 17:21:53.250: E/main(21376): parent   is  true
11-26 17:21:53.250: I/video(21376): Mediaconstructor 
started
11-26 17:21:53.550: I/video(21376): Mediaconstructor  
CALLED

11-26 17:21:53.550: I/video(21376): Media_video constructor  started
11-26 17:21:53.550: E/Video Media(21376): VIDEO Initalized  
[/sdcard/DCIM/Videos/Lazy J_Crystal_20110813_102429.3gp]

11-26 17:21:53.550: I/video(21376): screen   is  true
11-26 17:21:53.550: I/video(21376): videois  true
11-26 17:21:53.550: W/video(21376): How has focus
android.widget.VideoView@40d50d70

11-26 17:21:53.550: W/video(21376): video Buffer  0
11-26 17:21:53.550: W/video(21376): video Layer Type  0
11-26 17:21:53.550: W/video(21376): video Visibility  0
11-26 17:21:53.550: W/video(21376): video Screen On   true
11-26 17:21:53.550: W/video(21376): video is Clickabletrue
11-26 17:21:53.550: W/video(21376): video is Focusabletrue
11-26 17:21:53.550: W/video(21376): video is Visibility   0
11-26 17:21:53.550: W/video(21376): video  has a  Holder  false
11-26 17:21:53.550: W/video(21376): video root View  
com.android.internal.policy.impl.PhoneWindow$DecorView@4098eb98

11-26 

[android-developers] AudioService grabs audio focus on ICS when I do AudioManager#setMode(MODE_IN_COMMUNICATION)

2011-11-26 Thread Shri
My app does requestAudioFocus(STREAM_VOICE_CALL) and then calls
AudioManager#setMode(MODE_IN_COMMUNICATION). The log shows that this
immediately causes the audio focus to be lost to
AudioService.IN_VOICE_COMM_FOCUS_ID
(AudioFocus_For_Phone_Ring_And_Calls):

I/AudioService(23967):  AudioFocus  requestAudioFocus() from
android.media.audiomana...@41a56f58com.shri.MyApp@41b1c450
E/audio_hw_primary(  117): Leaving IN_CALL state, in_call=0, mode=3
I/AudioService(23967):  AudioFocus  requestAudioFocus() from
AudioFocus_For_Phone_Ring_And_Calls

There is no such loss in audio focus on Gingerbread. Also, if I do
AudioManager#setMode(MODE_NORMAL), there is no loss in audio focus,
but I have other issues (volume is low because the GIPS audio library
does not route audio correctly).

Looking at AudioService.java (http://www.java2s.com/Open-Source/
Android/android-core/platform-frameworks-base/android/media/
AudioService.java.htm), I see that AudioService.IN_VOICE_COMM_FOCUS_ID
grabs focus when there is an incoming phone call using
PhoneStateListener. I registered my own PhoneStateListener, but it did
not get called when I called
AudioManager#setMode(MODE_IN_COMMUNICATION).

Can I use AudioManager#setMode(MODE_IN_COMMUNICATION) while keeping
audio focus?

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


[android-developers] Re: Galaxy Nexus can't go in USB Host mode, no mouse no usb stick.

2011-11-26 Thread sblantipodi
Something important don't work as expected and google is in silence.

On Nov 23, 11:15 pm, sblantipodi perini.dav...@dpsoftware.org wrote:
 I'm not talking about USB Mass Storage but about the possibility to
 connect an usb stick or mouse
 to the phone.
 This is possible since a modder enabled a kernel options and now it
 works but a feature like this
 must be enabled by default without any modding needed.

 On Nov 23, 5:39 pm, Christopher Van Kirk







 christopher.vank...@gmail.com wrote:
  They explained this already. It's because the Galaxy Nexus has no SD card.

  On 11/24/2011 12:37 AM, sblantipodi wrote:

     who can explain me why
   galaxy nexus isn't able to go into u

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


[android-developers] any link to browse ICS code online ?

2011-11-26 Thread Dav
any link to browse ICS code online ?

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


[android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread limtc
Yes, I know. Since the default is true, that means I need to declare
to declare autofocus to false too.

On 11月26日, 下午11时14分, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Nov 26, 2011 at 9:12 AM, limtc thyech...@gmail.com wrote:
  I am not too sure whether I need to declare or not? Since autofocus is
  often unnecessary for many apps.

  uses-feature android:name=android.hardware.camera.autofocus
  android:required=false /

 AFAIK, if you do not require a camera, you do not require an autofocus camera.

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

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

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


[android-developers] Re: Where do we use uses-feature android:required=false?

2011-11-26 Thread limtc
What I mean is that since the assumption is both features are true, to
switch it off probably need to set both to false:

uses-feature android:name=android.hardware.camera
android:required=false /
uses-feature android:name=android.hardware.camera.autofocus
android:required=false /

I believe many developers will not declare the camera.autofucus to
false.

On 11月26日, 下午11时14分, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Nov 26, 2011 at 9:12 AM, limtc thyech...@gmail.com wrote:
  I am not too sure whether I need to declare or not? Since autofocus is
  often unnecessary for many apps.

  uses-feature android:name=android.hardware.camera.autofocus
  android:required=false /

 AFAIK, if you do not require a camera, you do not require an autofocus camera.

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

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

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


[android-developers] good videos

2011-11-26 Thread bob
What can I use to make good videos of my Android games?

I tried filming my tablet, but those videos are kind of low quality.

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


Re: [android-developers] good videos

2011-11-26 Thread Miguel Morales
I believe tablets like the Xoom have HDMI out.  Use that.

On Sat, Nov 26, 2011 at 6:58 PM, bob b...@coolgroups.com wrote:

 What can I use to make good videos of my Android games?

 I tried filming my tablet, but those videos are kind of low quality.

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




-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

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

RE: [android-developers] good videos

2011-11-26 Thread Tommy Hartz
This works pretty good. http://code.google.com/p/androidscreencast/

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of bob
Sent: Saturday, November 26, 2011 9:58 PM
To: Android Developers
Subject: [android-developers] good videos

What can I use to make good videos of my Android games?

I tried filming my tablet, but those videos are kind of low quality.

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

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


[android-developers] Details on the load apk and start the app process?

2011-11-26 Thread B Lyon
I am trying to follow the process by which the system takes an apk and
fires up the associated app.  Specifically, I'm trying to find the
framework code where it reads the app manifest and acts on the
user-requested permissions and instrumentation tag (if it is there).
 I've can't seem to find the stuff that does this, and am hoping it's
right in front of my face somewhere on the web.

I've watched logcat to see what seems to happen when an apk is
installed from eclipse, and I see a PackageIntentReceiver do some
stuff (this is a private class in
com.android.settings.applications.ApplicationsState).  But the trail
gets cold for me in ApplicationsState.addPackage.  That might not even
be the class that is doing the work I am interested in.

tia

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


Re: [android-developers] Have an extra $800 lying around for a mobile ESRB rating? Didn't think so.

2011-11-26 Thread Christopher Van Kirk
Once again, where's the evidence of this? The OP implied that Google has 
stipulated games will not make its front view without an ESRB rating, 
yet I find no evidence of a press release that says this.


On 11/27/2011 6:50 AM, Jim Graham wrote:

On Sat, Nov 26, 2011 at 03:57:38PM -0500, Kristopher Micinski wrote:


ESRB?  That huge organization that rates video games and puts the
little T, E, and occasionally M stickers on the games?

Oh, those ratings.  Ok, got it now



but it is scary if it is indeed [true] that the market is
biasing towards games with endorsed ratings..

Well, yes and no  I would just expect the games to end up moving
to a different market (like soc.io, spamazon, etc.).  Of course, if
joe.average Android user doesn't KNOW about those other marketsyeah,
you're right...it's bad.  :-(

Later,
--jim



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


Re: [android-developers] Re: Galaxy Nexus can't go in USB Host mode, no mouse no usb stick.

2011-11-26 Thread Christopher Van Kirk

It's surprising that you're surprised.

On 11/27/2011 9:37 AM, sblantipodi wrote:

Something important don't work as expected and google is in silence.

On Nov 23, 11:15 pm, sblantipodiperini.dav...@dpsoftware.org  wrote:

I'm not talking about USB Mass Storage but about the possibility to
connect an usb stick or mouse
to the phone.
This is possible since a modder enabled a kernel options and now it
works but a feature like this
must be enabled by default without any modding needed.

On Nov 23, 5:39 pm, Christopher Van Kirk







christopher.vank...@gmail.com  wrote:

They explained this already. It's because the Galaxy Nexus has no SD card.
On 11/24/2011 12:37 AM, sblantipodi wrote:

   who can explain me why

  galaxy nexus isn't able to go into u


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