[android-developers] Re: View/onDraw(Canvas) vs. SurfaceView

2011-11-24 Thread BelvCompSvs
well I just got hammered for supposedly being hard to understand but
this is not going to be fun

first off ( short of going an looking ) SurfaceView  should be on the
constructor chain of View as the normal convention of Java suggest so
by the class name

thus I would if coding a short sample here subclass SurfaceView for
you class as all the Veiw stuff would probably be available

then, for what you are asking first go look at the blog post of post
is by Dianne Hackborn, a Software Engineer who sits very near the
exact center of everything Android

Android Developers Blog: Multitasking the Android Way

what happens is that the thread that is launching the application gets
used to draw the screen which it has to or there will be an A.N.R.
if it gets into a lot of calc's or hangs somewhere waiting on
something

to do the moving things around on the screen you all but have to
have another thread doing the moving things around

so how do you do that?...

you have another thread doing the calcs

what you have to figure out is how the two threads talk

simple really but I'm not going to get hammered again so you'll have
to figure it out yourself

On Nov 23, 7:49 am, John Goche johngoch...@googlemail.com wrote:
 Hello,

 Let me rephrase my question. Given the information found 
 athttp://developer.android.com/guide/topics/graphics/2d-graphics.html
 which states:

  The aim of SurfaceView is to offer this drawing surface
 to an application's secondary thread, so that the application isn't
 required to wait until the system's View hierarchy is ready to draw.

 if I have just a single View on my screen (say for a game) why would the
 View hierarchy take a longer time to draw than if the View's Canvas is
 updated from a separate thread?

 Thanks for your feedback,

 John Goche

 On Wed, Nov 23, 2011 at 1:30 PM, John Goche johngoch...@googlemail.comwrote:









  Hello,

  Could anyone kindly explain to me what the difference is between
  using a SurfaceView and subclassing a View class and overriding
  its onDraw() mehtod? Plus I've read a thread on this mailing list
  that SurfaceView has problems on newer phones (and perhaps
  GLSurfaceView is affected as well). Can someone please give
  me an update on this?

  Thanks,

  John Goche

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

2011-11-24 Thread Dav
Can i create two linearlayouts inside the onLayout method (i am
extending from adapterview)? . I want to add couple of views into the
firstlayout and add rest of the views into the second linearlayout .
Is this possible ?

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


[android-developers] OutOfMemoryError

2011-11-24 Thread bob
OutOfMemoryError

I'm getting this OutOfMemoryError:

11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
allocation too large for this process.
11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
144 bytes
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6880)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6883)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.widget.FrameLayout.draw(FrameLayout.java:363)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6883)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.widget.FrameLayout.draw(FrameLayout.java:363)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1862)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.draw(ViewRoot.java:1522)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.os.Looper.loop(Looper.java:123)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.app.ActivityThread.main(ActivityThread.java:3647)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
java.lang.reflect.Method.invokeNative(Native Method)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
java.lang.reflect.Method.invoke(Method.java:507)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
dalvik.system.NativeStart.main(Native Method)

Is there any easy way around this, or do I just have to use less
memory?  This game works fine on my phone, but strangely the error
shows up on my tablet.

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


[android-developers] Re: How to connect to Facebook and publish in the wall

2011-11-24 Thread Ali Chousein
Try asking Facebook dev related questions at this forum:
http://forum.developers.facebook.net/

Hint: If you study either Facebook Android SDK (
https://github.com/facebook/facebook-android-sdk ) or Facebook Graph
API ( https://developers.facebook.com/docs/reference/api/ ) you'll see
that the answer to your question is obvious and trivial.

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com
https://marketplace.cisco.com/apphq/store/products/994

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

2011-11-24 Thread Johan Rydenstam
Are you using different resources for the tablet (like hdpi?).

I would check for memory leaks. There are tools you can use for this ( Eclipse 
memory analyzer)
 
On Nov 24, 2011, at 9:51 AM, bob wrote:

 OutOfMemoryError
 
 I'm getting this OutOfMemoryError:
 
 11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
 allocation too large for this process.
 11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
 144 bytes
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6880)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1644)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.draw(PhoneWindow.java:1862)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.draw(ViewRoot.java:1522)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Looper.loop(Looper.java:123)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.app.ActivityThread.main(ActivityThread.java:3647)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invokeNative(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invoke(Method.java:507)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 dalvik.system.NativeStart.main(Native Method)
 
 Is there any easy way around this, or do I just have to use less
 memory?  This game works fine on my phone, but strangely the error
 shows up on my tablet.
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: Facebook posting not works if any crashing in application

2011-11-24 Thread Ali Chousein
1. Write software which doesn't crash. That's the only approach to
write mobile software. Relying on recovery algorithms after a crash is
simply not an acceptable approach in simple mobile software world.
(No, your software is not complex, all mobile software are simple, I
mean ALL).

2. Try asking Facebook dev related questions at this forum:
http://forum.developers.facebook.net/

3. Study Facebook Android SDK ( https://github.com/facebook/facebook-android-sdk
) and Facebook Graph API ( https://developers.facebook.com/docs/reference/api/
).

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com
https://marketplace.cisco.com/apphq/store/products/994

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

2011-11-24 Thread Ali Chousein
Study the ContactsContract API (
http://developer.android.com/reference/android/provider/ContactsContract.html
). All information you need is there.

-
Ali Chousein
Weather-Buddy
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
Geo-Filtered Assistant
http://geo-filtered-assistant.blogspot.com
https://marketplace.cisco.com/apphq/store/products/994

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

2011-11-24 Thread Francisco Dalla Rosa soares
I don't have the link right now but I read somewhere that if you want to
allocate more memory (especially for images) you can just allocate them as
opengl textures as those don't count as heap memory.

I'll try to find the link and get some more detailed info to you.

2011/11/24 Johan Rydenstam johanrydens...@googlemail.com

 Are you using different resources for the tablet (like hdpi?).

 I would check for memory leaks. There are tools you can use for this ( Eclipse
 memory analyzer)

 On Nov 24, 2011, at 9:51 AM, bob wrote:

 OutOfMemoryError

 I'm getting this OutOfMemoryError:

 11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
 allocation too large for this process.
 11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
 144 bytes
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6880)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1644)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.draw(PhoneWindow.java:1862)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.draw(ViewRoot.java:1522)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Looper.loop(Looper.java:123)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.app.ActivityThread.main(ActivityThread.java:3647)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invokeNative(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invoke(Method.java:507)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 dalvik.system.NativeStart.main(Native Method)

 Is there any easy way around this, or do I just have to use less
 memory?  This game works fine on my phone, but strangely the error
 shows up on my tablet.

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

Re: [android-developers] Dialog Activity

2011-11-24 Thread Aki
Cannot display an AlertDialog from a non-activity context.

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

2011-11-24 Thread limtc
Hi,

I have an issue with photo taking in Android. The code below works for
all the phones I have, but when I am testing this with a Honeycomb
tablet (HTC Jetstream, in portrait mode), the picture will be taken in
landscape mode, then when it returns to the app, wipe out the view (as
if onCreate is being called again)!

How should I prevent this to happen? The code below is pretty standard
photo taking code. My guess is that the orientation changed is causing
the issue (even though the app is set to Portrait only). Thanks for
any help!

--
Taking photo:

  intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  File file = new File(Environment.getExternalStorageDirectory(),
camera.jpg);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
  startActivityForResult(intent, R.id.camera);

Set picture in view:

  if (result == Activity.RESULT_OK) {
File file = new File(Environment.getExternalStorageDirectory(),
camera.jpg);
view.setPicture(BitmapFactory.decodeFile(file.toString()));
file.delete();
  }
  else
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();

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

2011-11-24 Thread limtc
I am using this code to save the image:

--
String fileURL = Media.insertImage(getContentResolver(), bitmap,
KidsPaint, Picture);

if (fileURL != null) {
  Uri uri = Uri.parse(fileURL);
  sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
uri));
}
--

However, the result is pretty inconsistent. On my Nexus One - it goes
to the Gallery app, and on HTC Hero, it goes to the Gallery app but
does not show up until the device is rebooted. When I am testing on
HTC Jetstream Honeycomb tablet, it goes into the SD Card Camera folder
but does not show up at all in the Gallery app (and even reboot does
not help).

What have I done wrong and what's the best way to save a picture to
the Gallery app?

Thanks for advice!

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


[android-developers] handling back button

2011-11-24 Thread karthik
Sir/madam,

i am working on an application in which if i click(normal click) on
the back button the moveTaskToBackgroud(true) must be called. else if
it is a longpress then there id nothing to do.


please help



regards,
karthik

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

2011-11-24 Thread karthik
Sir/madam,

i am working on an application in which if i click(normal click) on
the back button the moveTaskToBackgroud(true) must be called. else if
it is a longpress then there id nothing to do.


please help



regards,
karthik

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

2011-11-24 Thread Naveen
Hello Sir,


I am playing a video file , i want to calculate percentage of video
file . using this code

int current=video.getDuration();
int total= video.getCurrentPosition();
int per = (current/total)*100;


This way is wrong behave please confirm me this is right or wrong.


which is easiest way solve my issue.


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

2011-11-24 Thread arun kumar
*Manually calculate the bitrate**
*The basic bitrate formula is

(*S*ize - (*A*udio x *L*ength )) / *L*ength = *V*ideo bitrate

L = Lenght of the whole movie in seconds
S = Size you like to use in KB (note 700 MB x 1024*°* = 716 800 KB)
A = Audio bitrate in KB/s (note 224 kbit/s = 224 / 8*°* = 28 KB/s)
V = Video bitrate in KB/s, to get kbit/s multiply with 8*°*.

*°8 bit = 1 byte.*
*°1024 = 1 kilo in the computer world.*

Example
90 minutes video, L = 90 x 60 = 5 400 seconds
700 MB CD but be sure that if fits use a bit lower like 695 MB, S = 695 x
1024 = 711 680 KB
Audio bitrate, A = 224 kbit/s / 8 = 28 KB/s

(711 680 - (5400 x 28) ) / 5400 = 104 KB/s x 8*°* = 830 kbit/s.


WITH REGARDS
ARUN KUMAR P D
+91-9663471079

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

2011-11-24 Thread Uberall, Android

Dear Karthik,

I would like to recommend you to use the following code snippet in your 
activity.


@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

super.onKeyDown(keyCode, event);

if (keyCode == KeyEvent.KEYCODE_BACK  
event.getRepeatCount() = 0) {

*   //it is for long press *
return false;
}
if (keyCode == KeyEvent.KEYCODE_BACK  event.getRepeatCount() 
== 0) {


*   //It is for one time press*

return true;
}

return super.onKeyDown(keyCode, event);
}


Regards
Prashant Lal

On 24-11-2011 15:44, karthik wrote:

Sir/madam,

i am working on an application in which if i click(normal click) on
the back button the moveTaskToBackgroud(true) must be called. else if
it is a longpress then there id nothing to do.


please help



regards,
karthik



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

2011-11-24 Thread NaveenShrivastva
In android  i have instance of videoview is video, how to handle this for
calculate percentage?

On Thu, Nov 24, 2011 at 3:51 PM, arun kumar hariarun2...@gmail.com wrote:

 *Manually calculate the bitrate**
 *The basic bitrate formula is

 (*S*ize - (*A*udio x *L*ength )) / *L*ength = *V*ideo bitrate

 L = Lenght of the whole movie in seconds
 S = Size you like to use in KB (note 700 MB x 1024*°* = 716 800 KB)
 A = Audio bitrate in KB/s (note 224 kbit/s = 224 / 8*°* = 28 KB/s)
 V = Video bitrate in KB/s, to get kbit/s multiply with 8*°*.

 *°8 bit = 1 byte.*
 *°1024 = 1 kilo in the computer world.*

 Example
 90 minutes video, L = 90 x 60 = 5 400 seconds
 700 MB CD but be sure that if fits use a bit lower like 695 MB, S = 695 x
 1024 = 711 680 KB
 Audio bitrate, A = 224 kbit/s / 8 = 28 KB/s

 (711 680 - (5400 x 28) ) / 5400 = 104 KB/s x 8*°* = 830 kbit/s.


 WITH REGARDS
 ARUN KUMAR P D
 +91-9663471079

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

2011-11-24 Thread skink


On Nov 24, 11:15 am, Naveen kumarnaveen.si...@gmail.com wrote:
 Hello Sir,

 I am playing a video file , i want to calculate percentage of video
 file . using this code

 int current=video.getDuration();
 int total= video.getCurrentPosition();
 int per = (current/total)*100;

 This way is wrong behave please confirm me this is right or wrong.

 which is easiest way solve my issue.

int per = current *100 / total;

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] Re: WebView lost JavaScript update contents after called goBack()

2011-11-24 Thread alex
seems the page was reloaded after call goBack(), is there any way to
prevent reload page after call goBack() ???

On 11月18日, 下午6时23分, alex medicibusin...@gmail.com wrote:
 I have a problem that when I click back button on a WebView, my
 previous page losts all contents updated by JavaScript.

 My steps in WebView was below:
 - after Main page loaded, JavaScript starts update contents, like
 refresh shoppings with links;
 - user will see some shopping lists after updated;
 - then user click each link will load new url in same WebView;
 - user click back to Main page;

 the problem is when user back to Main page, user cannot see any
 shopping updated by JavaScript, they were gone!
 I tried my page on IE and FF, both works fine, but had problem on
 Android WebView. I'm not sure this issue caused by I'm not set some
 settings correctly or other issues.

 My sample code as below:

 // set settings for webview
         WebSettings webSettings = web.getSettings();
         webSettings.setBuiltInZoomControls(true);
         webSettings.setJavaScriptEnabled(true);
         webSettings.setUseWideViewPort(true);
         webSettings.setDomStorageEnabled(true);
         webSettings.setJavaScriptCanOpenWindowsAutomatically(true);

 // call JavaScript to update shoppings
         webView.loadUrl(javascript:addShoppings( + str + ););

 // add interface for callback
         webView.addJavascriptInterface(new
 BusinessJavaScriptInterface(), business);

 final class BusinessJavaScriptInterface
 {
     public void businessListReceived()
     {
         ... ...
     }

 }

 // handle back key event
     public boolean onKeyDown(int keyCode, KeyEvent event)
     {
         WebView web = (WebView) this.findViewById(R.id.browser);
         if (web != null)
         {
             if ((keyCode == KeyEvent.KEYCODE_BACK)  web.canGoBack())
             {
                 web.goBack();
                 return true;
             }
             return super.onKeyDown(keyCode, event);
         }
         return false;
     }

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

2011-11-24 Thread NaveenShrivastva
OK

Then now i am doing

video.pause();
   int current=video.getDuration();
int total= video.getCurrentPosition();
int per = (current*100)/total;


This is right way for calculate percentage of video?


because when it's reach near 90% then i want to fire a action on the
basis of figured value.



On Thu, Nov 24, 2011 at 4:15 PM, skink psk...@gmail.com wrote:


 On Nov 24, 11:15 am, Naveen kumarnaveen.si...@gmail.com wrote:
 Hello Sir,

 I am playing a video file , i want to calculate percentage of video
 file . using this code

 int current=video.getDuration();
 int total= video.getCurrentPosition();
 int per = (current/total)*100;

 This way is wrong behave please confirm me this is right or wrong.

 which is easiest way solve my issue.

 int per = current *100 / total;

 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


[android-developers] screenshot in android

2011-11-24 Thread vani reddy
Hi friends,

How to take the screeenshot of android device programmatically..Apart from
using in DDMS.
-- 
Regards,
Vani Reddy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] complete video player app crash on back btn

2011-11-24 Thread Naveen
Hello All,

Please see the code

 public void onCompletion(MediaPlayer mp) {
 CompleteFlag = true;

 video.pause();

/* */
/*if(checkNetworkConnection()){

try {
new PostUsesData().execute(T);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}*/
// set the message to display


try {
EncryptVideo(IDValue);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

alertbox.setTitle(Message);
alertbox.setMessage(Do you want to delete this video ?);


// set a positive/yes button and create a listener
alertbox.setPositiveButton(Yes,
new DialogInterface.OnClickListener() {

// do something when the button is 
clicked
public void onClick(DialogInterface 
arg0, int arg1) {
try {
 new File(path).delete();

/*  
Toast.makeText(getApplicationContext(),
Thanks,Inprogress..,

Toast.LENGTH_SHORT).show();*/

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



 try {
Intent myIntent = new 
Intent(VideoPlayer.this,

WatchActivity.class);


// here

myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

startActivity(myIntent);
} catch (Exception e) {
// TODO Auto-generated 
catch block
e.printStackTrace();
}



}
});



alertbox.setNegativeButton(No,
new DialogInterface.OnClickListener() {

// do something when the button is 
clicked
public void onClick(DialogInterface 
arg0, int arg1) {
showDialog(0);
}
});

// display box
alertbox.show();

// IntroFaceBookScreen.mFacebook.dialog(this, stream.publish,
parameters, this);
}



Here i am playing a video when video completed then back button or
navigating on activity gives crash, before finish the video when back
press no error .

Please help me what mistake by me here

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

2011-11-24 Thread NaveenShrivastva
This is not solving my issue , how to calculate 90% of video is
completed or not. i will check this on button click.

On Thu, Nov 24, 2011 at 4:22 PM, NaveenShrivastva
kumarnaveen.si...@gmail.com wrote:
 OK

 Then now i am doing

        video.pause();
               int current=video.getDuration();
                int total= video.getCurrentPosition();
                int per = (current*100)/total;


 This is right way for calculate percentage of video?


 because when it's reach near 90% then i want to fire a action on the
 basis of figured value.



 On Thu, Nov 24, 2011 at 4:15 PM, skink psk...@gmail.com wrote:


 On Nov 24, 11:15 am, Naveen kumarnaveen.si...@gmail.com wrote:
 Hello Sir,

 I am playing a video file , i want to calculate percentage of video
 file . using this code

 int current=video.getDuration();
 int total= video.getCurrentPosition();
 int per = (current/total)*100;

 This way is wrong behave please confirm me this is right or wrong.

 which is easiest way solve my issue.

 int per = current *100 / total;

 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


[android-developers] OrmLite problem with proguard

2011-11-24 Thread Android Developer
Hi All,

I am trying to optimize my apk using proguard.

I keep com.j256.ormlite package at the end of proguard config file.
and i add the library jars also. and also mapping.txt is not getting
created.

My Proguard.cfg

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose

-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/
*

-libraryjars /lib/
-dontwarn *.**

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService


-keepclasseswithmembernames class * {
native methods;
}

-keepclasseswithmembernames class * {
public init(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
public init(android.content.Context, android.util.AttributeSet,
int);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keep class com.j256.**
-keepclassmembers class com.j256.** {
*;
}

-keep public class * extends
com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper


Stack Trace :

11-24 16:50:22.605: ERROR/AndroidRuntime(19401):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.answerforce.mobile/
com.answerforce.mobile.MessageList}: java.lang.IllegalStateException:
Could not find OpenHelperClass because none of its generic parameters
extends OrmLiteSqliteOpenHelper: null
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1647)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1663)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.os.Looper.loop(Looper.java:130)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread.main(ActivityThread.java:3683)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
java.lang.reflect.Method.invokeNative(Native Method)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
java.lang.reflect.Method.invoke(Method.java:507)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
dalvik.system.NativeStart.main(Native Method)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): Caused by:
java.lang.IllegalStateException: Could not find OpenHelperClass
because none of its generic parameters extends
OrmLiteSqliteOpenHelper: null
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.j256.ormlite.android.apptools.OpenHelperManager.lookupHelperClass(Unknown
Source)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.j256.ormlite.android.apptools.OpenHelperManager.getHelper(Unknown
Source)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.j256.ormlite.android.apptools.OrmLiteBaseActivity.getHelperInternal(Unknown
Source)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.j256.ormlite.android.apptools.OrmLiteBaseActivity.onCreate(Unknown
Source)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
com.answerforce.mobile.MessageList.onCreate(Unknown Source)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1611)
11-24 16:50:22.605: ERROR/AndroidRuntime(19401): ... 11 more


I struck with this almost a day. please help me out


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 

[android-developers] Re: Where does the picture saved to?

2011-11-24 Thread limtc
I saw a solution here (http://www.rical.net/blog/
article-1318132709.html), not sure whether this is true as I didn't
see this explanation elsewhere. What it means is that
Media.insertImage() returns the Uri will be in content:// format,
but ACTION_MEDIA_SCANNER_SCAN_FILE intent required format in
file://. This explains why scan files/refresh does NOT work!

Here's the code below, what do you all think?
--
Uri uri = Uri.parse(szUrl);
String[] proj = { MediaStore.Images.Media.DATA };
Cursor actualimagecursor = managedQuery(uri,proj,null,null,null);
int actual_image_column_index =
actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
actualimagecursor.moveToFirst();
String img_path =
actualimagecursor.getString(actual_image_column_index);
uri = Uri.parse(file:// + img_path);

// Send intent
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri));

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

2011-11-24 Thread Ricardo Amaral
On Wednesday, November 23, 2011 6:26:09 PM UTC, Mark Murphy (a Commons Guy) 
wrote:

 On Wed, Nov 23, 2011 at 12:51 PM, Ricardo Amaral
 mas...@ricardoamaral.net wrote:
  I'm a little confused... If SharedPreferences are not safe for this, how 
 are
  apps handling validation if they don't use online validation? I'm sure 
 there
  are a couple who don't use online validation but have some sort of
  validation and they probably use SharedPreferences to control the app
  validation. How come they use it if it's not safe at all?

 Because it is good enough to stop casual piracy. Little will stop a
 serious pirate. This is not significantly different than for any other
 popular platform in the history of computers -- the only platforms
 with no piracy are the platforms nobody uses.

  Online validation is something I really wanted to avoid. I know that most
  people have an internet connection always on, but when they don't, I 
 really
  don't want to downgrade my app or prevent them from using it. I'm not 
 very
  comfortable with such policy. That doesn't leave me with any other 
 options
  does it?

 You could come up with a business model that does not depend upon
 defeating pirates.

It was never my intention to come up with a business model that tries to 
defeat pirates. That's something I'm not worried about, I didn't even 
mentioned piracy in any of my posts. That's really not the issue. I'm just 
trying to understand how secure is SharedPreferences and what alternatives 
are there, that's all.

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

2011-11-24 Thread Ricardo Amaral


 Thanks. This is very basic, so if you decide to use it, you may want to
 improve/tweak it. At least you need to decide how you manage coupons:
  by device (how do you identify devices?), user (google account, email), 
 etc.

I haven't yet installed anything of that but one way would be to have a 
notes field for each coupon you create and then you identify each coupon 
the way you want it. By device, by user, whatever... Or you can just do 
that on a separate document and keep a list of coupon codes and to which 
user/device it corresponds to...

But I liked your other idea , I'll investigate that one...

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

2011-11-24 Thread skink


On 24 Lis, 12:29, NaveenShrivastva kumarnaveen.si...@gmail.com
wrote:
 This is not solving my issue , how to calculate 90% of video is
 completed or not. i will check this on button click.

why? what value do you get in int per?

pskink


 On Thu, Nov 24, 2011 at 4:22 PM, NaveenShrivastva



 kumarnaveen.si...@gmail.com wrote:
  OK

  Then now i am doing

         video.pause();
                int current=video.getDuration();
                 int total= video.getCurrentPosition();
                 int per = (current*100)/total;

  This is right way for calculate percentage of video?


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

2011-11-24 Thread nexbug
Check out that profile. Seems to be a spambot.

On Nov 22, 11:51 pm, Dusk Jockeys Android Apps duskjock...@gmail.com
wrote:
 BelvCompSys

 Like 90% of your posts, due to your opaque references, hints at inside
 knowledge, and otherwise generally obscure method of communication, I
 have no idea what you are talking about.

 On Nov 23, 12:06 pm, BelvCompSvs fa829...@gmail.com wrote:







  (seriously) One of my team leads is a MS Psyche and works in an ultra-
  secure installation ~ this is what they are shipping now - you are
  better off to hire the enemy as at least you can force them to shoot
  back at what they are supposed to

  [ moderators: this post is 100% legit informed and factual ]

  On Nov 22, 9:51 pm, TreKing treking...@gmail.com wrote:

   On Tue, Nov 22, 2011 at 12:53 PM, Kelly88 kely4chr...@gmail.com wrote:
I am a final year student, ... for my research I need a diagram
illustration mobile application architecture, to give my supervisor an 
idea
how an mobile architecture application function.may someone please 
assist
me by sending me diagrams?

   So you want someone to do your homework for you? Is this how you got to
   your final year?

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

  - Show quoted text -

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


[android-developers] Re: Where does the picture saved to?

2011-11-24 Thread limtc
I replaced the ACTION_MEDIA_SCANNER_SCAN_FILE intent by
ACTION_MEDIA_SCANNER_SCAN_FILE intent for saving, and it works for HTC
Hero issue! Now Gallery will be refreshed when we save the file.

sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
Uri.parse(file:// + Environment.getExternalStorageDirectory(;

//  sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
uri));

It still does not work for HTC Jetstream (the pictures do not show up
in Gallery). I am not too sure whether it is a good solution though.

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

2011-11-24 Thread NaveenShrivastva
It's give always maximum value not less than 100 .

On Thu, Nov 24, 2011 at 5:23 PM, skink psk...@gmail.com wrote:


 On 24 Lis, 12:29, NaveenShrivastva kumarnaveen.si...@gmail.com
 wrote:
 This is not solving my issue , how to calculate 90% of video is
 completed or not. i will check this on button click.

 why? what value do you get in int per?

 pskink


 On Thu, Nov 24, 2011 at 4:22 PM, NaveenShrivastva



 kumarnaveen.si...@gmail.com wrote:
  OK

  Then now i am doing

         video.pause();
                int current=video.getDuration();
                 int total= video.getCurrentPosition();
                 int per = (current*100)/total;

  This is right way for calculate percentage of video?


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Re: How secure are SharedPreferences on rooted devices?

2011-11-24 Thread Nikolay Elenkov
On Thu, Nov 24, 2011 at 8:51 PM, Ricardo Amaral
mas...@ricardoamaral.net wrote:
 Thanks. This is very basic, so if you decide to use it, you may want to
 improve/tweak it. At least you need to decide how you manage coupons:
  by device (how do you identify devices?), user (google account, email),
 etc.

 I haven't yet installed anything of that but one way would be to have a
 notes field for each coupon you create and then you identify each coupon
 the way you want it. By device, by user, whatever... Or you can just do that
 on a separate document and keep a list of coupon codes and to which
 user/device it corresponds to...

What I meant by 'manage' was the way you link coupons to users and/or
devices. For example, do you allow 3 people to use the same coupon?
Do you allow 1 person to use it on 3 different devices? What happens
if I reset my phone, can I re-use your coupon (same user, same device,
new installation)? etc.

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

2011-11-24 Thread sam
Hi Everyone,
I have a Table layout done in problematically And I want to to develop
it as first two rows have only one column and other three rows have
two column. First two rows' values should be spread whole row.
Can anyone guide me by sending tutorial or any link regarding this
Thanks

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


[android-developers] Someone has the Galaxy Nexus? :)

2011-11-24 Thread YuviDroid
Hey everyone,

while I'm waiting for the Galaxy Nexus to be available here in Switzerland
I was wondering if somebody who already has it he's willing to quickly test
my app to see how it works there?
(especially with respect to the high screen resolution screen and the
'menu' key not being present). Btw is the Galaxy Nexus a hdpi or xhdpi
device?

I already tested on the emulator (well...kind of...) and on my Nexus S with
ICS 4.0.1...but I'm really curious to test it on the real thing :)


Thanks,
Yuvi

-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
to quickly access your favorite apps and contacts!)
http://www.droidahead.com
http://android.yuvalsharon.net

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

Just tested the same code on a Sony S  same thing
So with both the Sony S   and   Motorola Xoom

You hear the audio ,  but see No video
hardware is accelerated  and first time around I get the following 
message in LogCat


11-24 07:49:23.688: E/Surface(11158): surface (identity=1931) is 
invalid, err=-19 (No such device)
11-24 07:49:23.688: D/CallStack(11158): Surface#00  pc 00013b5e  
/system/lib/libsurfaceflinger_client.so
11-24 07:49:23.688: D/CallStack(11158): Surface#01  pc 00013b9c  
/system/lib/libsurfaceflinger_client.so
11-24 07:49:23.688: D/CallStack(11158): Surface#02  pc 00013c1a  
/system/lib/libsurfaceflinger_client.so
11-24 07:49:23.688: D/CallStack(11158): Surface#03  pc 4f38  
/system/lib/libEGL.so
11-24 07:49:23.688: D/CallStack(11158): Surface#04  pc 00036dca  
/system/lib/libandroid_runtime.so

11-24 07:49:23.898: D/MediaPlayer(11158): getMetadata


Thanks again to all

On 11/23/2011 11:33 PM, Romain Guy wrote:

On what device are you testing this?

On Wed, Nov 23, 2011 at 7:01 PM, New Developer secur...@isscp.com 
mailto:secur...@isscp.com wrote:


My mainfest has

application  android:icon=@drawable/logo  
android:hardwareAccelerated=true  
android:label=@string/app_name android:debuggable=true

android:theme=@android:style/Theme.NoTitleBar
activity android:name=MainActivity
android:hardwareAccelerated=true 
android:screenOrientation=landscape 
android:configChanges=orientation /activity
activity android:name=Display 
android:hardwareAccelerated=true 
android:screenOrientation=landscape 
android:configChanges=orientation /activity



From MainActivity I call Display  using intent

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

Display class has

public class Display extends Activity {
private FrameLayout parent;
private String  fName;
public   static  VideoView  video;

@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, videois   + video.isHardwareAccelerated());

Log.e(display, imageis   + image.isHardwareAccelerated());
image.setLayerType(View.LAYER_TYPE_HARDWARE, null);
Log.e(display, imageis   + image.isHardwareAccelerated());
parent.setOnTouchListener(image);

From my reading and understanding of Hardware acceleration I have
done everything to  enable hardware acceleration
yet  from LogCat

parent is false
video   is false
image  is false
image  is false

Why  ? ?

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%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 android-developers@googlegroups.com
To unsubscribe from this group, 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] C/C++ struct in android

2011-11-24 Thread Aitor Mendaza Ormaza
Hi to everyone:
I want to make something similar to a struct in C/C++, to represent a
collection of structured data.

I first though of making objects with properties, but this might be a
little inefficient (creating objects just to store data).
Is there a more efficient way to do this in android? Something like structs
:)

Thanks in advance!!!

-- 
---
http://aitorTheRed.blogspot.com
http://www.last.fm/user/aitorTheRed/

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 2:26 AM, tobias ecker...@gmx.de wrote:
 So unless you can live with the significantly smaller screen-real-
 estate that the Action Bar will leave you with, the only solution
 seems to be to leave the target-SDK setting at 9, as to ensure Android
 will always display a menu key on the screen.

Or, don't run ads

Or, put the ad in the action bar, if they have an ad size that fits

Or, switch to a different ad style (e.g., interstitials) that does not
take up continuous screen space

Or, skip the action bar and don't use menus, putting whatever had been
in your menu in the UI proper, as many games do

Or, skip the action bar simply plop your own PopupMenu in the
upper-right corner of your UI triggered by an ImageButton using the
same icon as the action bar itself uses for the overflow menu

There are probably other solutions as well, but these should get you started.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 7:56 AM, Aitor Mendaza Ormaza
aitorthe...@gmail.com wrote:
 I want to make something similar to a struct in C/C++, to represent a
 collection of structured data.

In Java, this is called a class.

 Is there a more efficient way to do this in android? Something like structs
 :)

No.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
Use android:layout_span to have your first two rows span the two columns.

On Thu, Nov 24, 2011 at 7:28 AM, sam urweeras...@gmail.com wrote:
 Hi Everyone,
 I have a Table layout done in problematically And I want to to develop
 it as first two rows have only one column and other three rows have
 two column. First two rows' values should be spread whole row.
 Can anyone guide me by sending tutorial or any link regarding this
 Thanks

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




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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 5:57 AM, vani reddy vani.reddy.bl...@gmail.com wrote:
 How to take the screeenshot of android device programmatically..Apart from
 using in DDMS.

This is not supported by Android. There are ways to capture the image
of your own activity (I think using the drawing cache), but you cannot
programmatically capture images of other applications, for obvious
security and privacy reasons.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 5:09 AM, karthik karthik01...@gmail.com wrote:
 i am working on an application in which if i click(normal click) on
 the back button the moveTaskToBackgroud(true) must be called.

Please do not do this. Please leave the BACK button alone. The user
can press HOME to achieve your desired functionality.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Aitor Mendaza Ormaza
On Thu, Nov 24, 2011 at 1:59 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Thu, Nov 24, 2011 at 7:56 AM, Aitor Mendaza Ormaza
 aitorthe...@gmail.com wrote:
  I want to make something similar to a struct in C/C++, to represent a
  collection of structured data.

 In Java, this is called a class.

 Really? I had no idea about this


  Is there a more efficient way to do this in android? Something like
 structs
  :)

 No.


I jut wanted to know if there was a way around of using class only for
storing data, as it will not have any methods attached to it, and object
handling can be expensive.


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

 Android Training in NYC: http://marakana.com/training/android/

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


Thanks for the answer,

Best regards!

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

2011-11-24 Thread lbendlin
Feel free to call it a problem. I call it a reality check. Rethink your 
goals.

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

2011-11-24 Thread Michael A.
FWIW, I have users who have complained about this since I switched to 
target-SDK=14. Action bar is there, but no menu overflow button. Very 
annoying, but unfortunately I do not have any device on which I can 
replicate the issue.

Regards,

Michael A.

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

2011-11-24 Thread Mukesh Srivastav
Let me give u an Example:

Let's say you have a layout and it has a parent layout could be
(Relative,Absoulte or LinerLayout). Take the id out of it. Below are the
steps to do this.

Step 1: Declare a Variable

View screen;

Step 2: in public void onCreate(Bundle savedInstanceState)  Method

   screen = (View) findViewById(R.id.captureimagelayout);  // Change your
Layout id here.

Step 3:   in the Button onclick Listener do this.

screen.setDrawingCacheEnabled(true);
Bitmap imgToSave = screen.getDrawingCache();


Step 4: in the Step 3# you have the Bitmap object,  use File:\\ operations
 to save the bitmap.  you are done.
As simple as that.


Regards,
Mukesh Kumar,
Android Consultant/Freelancer.
India,Hyderabad.









On Thu, Nov 24, 2011 at 6:31 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Thu, Nov 24, 2011 at 5:57 AM, vani reddy vani.reddy.bl...@gmail.com
 wrote:
  How to take the screeenshot of android device programmatically..Apart
 from
  using in DDMS.

 This is not supported by Android. There are ways to capture the image
 of your own activity (I think using the drawing cache), but you cannot
 programmatically capture images of other applications, for obvious
 security and privacy reasons.

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

 Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread lbendlin
on a rooted phone you can dump the contents of the framebuffer into a 
bitmap and then convert either of the frames (the buffer has two) into 
whatever image format you want. something like cat /dev/graphics/fb0  
grab.raw

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 8:09 AM, Aitor Mendaza Ormaza
aitorthe...@gmail.com wrote:
 I jut wanted to know if there was a way around of using class only for
 storing data, as it will not have any methods attached to it, and object
 handling can be expensive.

http://java.sun.com/developer/Books/shiftintojava/page1.html

Upon first exposure to the Java programming language, some C
programmers believe that classes are too heavyweight to replace
structs under some circumstances, but this is not the case. Degenerate
classes consisting solely of data fields are nearly equivalent to C
structs in every respect.

If you choose not to believe Mr. Bloch, that is your decision.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread lbendlin
exactly. Rather than thinking about the technicalities first, approach the 
issue from the other side. What is your user population like? Average users 
that never change phones? Geeks that flash a new ROM every week? Silent 
majority versus vocal few trolls? Once you have decided how you want to 
serve your customers you can then design your verification process.

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

2011-11-24 Thread Aitor Mendaza Ormaza
On Thu, Nov 24, 2011 at 2:18 PM, Mark Murphy mmur...@commonsware.comwrote:

 http://java.sun.com/developer/Books/shiftintojava/page1.html

 Upon first exposure to the Java programming language, some C
 programmers believe that classes are too heavyweight to replace
 structs under some circumstances, but this is not the case. Degenerate
 classes consisting solely of data fields are nearly equivalent to C
 structs in every respect.

 If you choose not to believe Mr. Bloch, that is your decision.


http://developer.android.com/guide/practices/design/performance.html

Object creation is never free. A generational GC with per-thread
allocation pools for temporary objects can make allocation cheaper, but
allocating memory is always more expensive than not allocating memory.

If you allocate objects in a user interface loop, you will force a periodic
garbage collection, creating little hiccups in the user experience. The
concurrent collector introduced in Gingerbread helps, but unnecessary work
should always be avoided.


For what is worth, I don't choose not to believe Mr. Bloch, I was just
wondering if in Android were better choices for classes as structs, as I
know my knowledge of both Java and Android is limited. That's the reason I
asked here after searching the web with no results (again, maybe my results
weren't good enough to get the answers I was looking for).

Thanks, though, for the link, as it seems interesting.

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

2011-11-24 Thread Klimek
Yes u can create plugins :D

Dnia 24 lis 2011 o godz. 04:13 petr.maza...@mautilus.com 
petr.maza...@mautilus.com napisał(a):

 How is the situation with the Android browser plug-ins?
 
 - Can we develop the browser plug-in?
 - Are there any limitations of what the plug-in can do?
 - Can it be developed in C or Java only?
 
 I swa here (https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/
 repository/revisions/cc99b832a941dc8cbb86f1607d04eb87935ddbfd/entry/
 android/development/samples/BrowserPlugin/README):
 
 plugin is intended to give plugin developers a point of reference to
 see how an android browser plugin is created and how to use the available 
 APIs.
 A plugin is packaged like a standard apk and can be installed either via the
 market or adb.
 
 But I did not found anything on the official developer.android.com
 pages as well as any plug-ins and on Android Market...
 
 I am not 100% sure how it should work, but my expectation is that when
 browser loads an
 HTML page that contains the new MIME Type in Object tag, then
 Android brower should
 and create instance of associated my browser plug-in.
 
 In the Android web browser settings is an option to enable/disable
 plug-ins...
 
 Regards,
 STeN
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] C/C++ struct in android

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 8:54 AM, Aitor Mendaza Ormaza
aitorthe...@gmail.com wrote:
 For what is worth, I don't choose not to believe Mr. Bloch, I was just
 wondering if in Android were better choices for classes as structs, as I
 know my knowledge of both Java and Android is limited.

Android doesn't add anything to the Java programming language. It adds
(and removes) from a standard Java class library, but the language is
the same. Hence, Android did not introduce any new language concepts
like a struct. The objective here is maximum compatibility with Java
5/6 code.

Advice for ordinary Java is *generally* a good starting point for
Android -- the places where Android will differ is not in language
features but in VM implementation (e.g., garbage collection). The
biggest exception to this rule will be anything written about Java 7,
as Android does not officially support it, and so you may encounter
problems with new Java 7 language features.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread chander
Hi I need to encrypt my android phone contacts while saving a contact
in android form i want to encrypt it using any encryption algorithm
with the help of Java Cryptography extensions.
can i embed my encryption algorithm like DES or any algorithm in
phonebook contacts while saving them to my android phone.


any help is appreciated.
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


Re: [android-developers] Re: How secure are SharedPreferences on rooted devices?

2011-11-24 Thread Ricardo Amaral
I don't think those issues are really that relevant. For my situation at 
least.

This is only to give out some free copies to some persons, not to use as a 
full validation system for every paying user...

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

2011-11-24 Thread Nikolay Elenkov
On Thu, Nov 24, 2011 at 11:37 PM, Ricardo Amaral
mas...@ricardoamaral.net wrote:
 I don't think those issues are really that relevant. For my situation at
 least.


It's your app, so you should know best... But,

 This is only to give out some free copies to some persons, not to use as a
 full validation system for every paying user...

If you are worried about shared preferences being insecure, you should
probably be worried about one of those persons posting his coupon to a
forum, etc. If you allow coupon sharing, everyone would be able to get
the full version using that coupon. If you think the risk is small enough,
it's OK to ignore this, but you should at least consider the possibility.
It's a lot easier than rooting your phone and changing preferences
manually.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Persistence of complex Java objects (SQLite, Serialization, JSON) and client-server app architecture

2011-11-24 Thread Christine Daunique
I'm working on an Android application which is fetching data from
internet among other things. Actually, the project was started by
someone else which is not here anymore, and now that I have to turn it
into a light client application and implement the server side (in
Java), I'm wondering what would be the best tools/patterns to use to
fit my needs.

Let's say I have to deal with several models (class representing a
category) of objects which all inherits from one class : they have
common attributes (such as name, attache thumbnail...) but specific
properties too. Because of this,you can understand that I can't afford
to manage one specific table to map each single class.

However, I still want to be able to cache my objects somewhere in the
Android device to populate the views of the application when working
in offline mode.

Currently, the solution used by the previous developer was to store
data directly into a TEXT field in the SQLIite database, as serialized
objets. This should be ok on the server side but I've read that the
usual Java serializaton was very slow on the Android platform,
although it is not really noticeable now because I work with around
~50 objects, I was looking for more performant alternatives for the
future.

I've came across the JSON solution which can easily handle complex
structures and Jackson library seems very interesting with its
simplified data binding to POJO objects and its well-known
performance. But then, how should I store my Json objects ? Is it
possible to keep a json string in a TEXT field of a SQlite table ? Or
should I rather store them as .json file for each object ? Which one
is the more efficient to retrieve later lot of data?

Plus, I was thinking that JSON would be a very good exchange format
between the Android client application and my server whould is in
charge of processing the information from internet third-parties apis
and exposing this data with webservices.
Is using the usual Apache HTTPClient enough on Android to communicate
with the server?

For those who successfully developped client-server application (which
seems very common to me) is this a good approach for Android ? It
seems to me that with mobile platforms, you can't really use the
approach that you've learned for more classic J2EE app and such... Any
advice would be greatly appreciated because I'm a student and Android
beginner who really want to improve her mobile development skills !

Thanks :)

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


[android-developers] Re: OutOfMemoryError

2011-11-24 Thread bob


On Nov 24, 12:55 am, Johan Rydenstam johanrydens...@googlemail.com
wrote:
 Are you using different resources for the tablet (like hdpi?).

No, it is mostly loading asset images.


 I would check for memory leaks. There are tools you can use for this ( 
 Eclipse memory analyzer)

 On Nov 24, 2011, at 9:51 AM, bob wrote:







  OutOfMemoryError

  I'm getting this OutOfMemoryError:

  11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
  allocation too large for this process.
  11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
  144 bytes
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
  java.lang.OutOfMemoryError: bitmap size exceeds VM budget
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.View.draw(View.java:6880)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.drawChild(ViewGroup.java:1646)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.drawChild(ViewGroup.java:1644)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.View.draw(View.java:6883)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.widget.FrameLayout.draw(FrameLayout.java:363)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.drawChild(ViewGroup.java:1646)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.View.draw(View.java:6883)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.widget.FrameLayout.draw(FrameLayout.java:363)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.android.internal.policy.impl.PhoneWindow
  $DecorView.draw(PhoneWindow.java:1862)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewRoot.draw(ViewRoot.java:1522)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.os.Handler.dispatchMessage(Handler.java:99)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.os.Looper.loop(Looper.java:123)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  android.app.ActivityThread.main(ActivityThread.java:3647)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  java.lang.reflect.Method.invokeNative(Native Method)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  java.lang.reflect.Method.invoke(Method.java:507)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:839)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  11-24 00:38:11.205: ERROR/AndroidRuntime(1782):     at
  dalvik.system.NativeStart.main(Native Method)

  Is there any easy way around this, or do I just have to use less
  memory?  This game works fine on my phone, but strangely the error
  shows up on my tablet.

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

[android-developers] Need info of Email app in Android source code

2011-11-24 Thread Pradeep
Does anyone have documented the description of the email and its
folder structure in android source code.Please share if anyone
documented.

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

2011-11-24 Thread Jim Graham
On Thu, Nov 24, 2011 at 02:14:21AM -0800, karthik wrote:
 
 i am working on an application in which if i click(normal click) on
 the back button the moveTaskToBackgroud(true) must be called. else if
 it is a longpress then there id nothing to do.

You already got your answer from Mark Murphy...why are you posting
this same post again?

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)|  There it was, right in the title bar:
spooky1...@gmail.com|   Microsoft Operations POS.
 Running FreeBSD 7.0  | 
ICBM / Hurricane:   | Never before has a TLA been so appropriately
   30.44406N 86.59909W  |  mis-parsed. (alt.sysadmin.recovery)

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] Calculate percentage of a video file

2011-11-24 Thread Jim Graham
On Thu, Nov 24, 2011 at 03:51:50PM +0530, arun kumar wrote:

 *The basic bitrate formula is

First, I don't see where you've included framing and CRC overhead.
You need to include that, unless you're only interested in the HDD-HDD
throughput.

 S = Size you like to use in KB (note 700 MB x 1024*?* = 716 800 KB)

KB is not a valid unit.  I think you meant kB  Uppercase 'K' has
absolutely *NO* meaning in this context.  kilo is a lowercase 'k'.

 A = Audio bitrate in KB/s (note 224 kbit/s = 224 / 8*?* = 28 KB/s)
 V = Video bitrate in KB/s, to get kbit/s multiply with 8*?*.

Same for both of these (but you got it right for kb/s).  As for your
formula, I'm not wasting my time to even review it.  Too much to do
this morning.

 Audio bitrate, A = 224 kbit/s / 8 = 28 KB/s
 (711 680 - (5400 x 28) ) / 5400 = 104 KB/s x 8*?* = 830 kbit/s.

Again, you need to get your units straight

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)|  There it was, right in the title bar:
spooky1...@gmail.com|   Microsoft Operations POS.
 Running FreeBSD 7.0  | 
ICBM / Hurricane:   | Never before has a TLA been so appropriately
   30.44406N 86.59909W  |  mis-parsed. (alt.sysadmin.recovery)

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


[android-developers] Lists with white background and black color

2011-11-24 Thread wyo
Ordinary lists have black background and white text yet I'd like to
have it reverse. I've tried to add

android:theme=@android:style/Theme.Light

to the activity in my manifest yet with no effect. Any idea how to
change my list?

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


Re: [android-developers] Lists with white background and black color

2011-11-24 Thread Mark Murphy
That should have worked fine. If you are using Eclipse, try cleaning
the project or otherwise forcing Eclipse to recompile and reinstall
the APK in your emulator.

On Thu, Nov 24, 2011 at 11:35 AM, wyo otto.w...@orpatec.ch wrote:
 Ordinary lists have black background and white text yet I'd like to
 have it reverse. I've tried to add

 android:theme=@android:style/Theme.Light

 to the activity in my manifest yet with no effect. Any idea how to
 change my list?

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




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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread lbendlin
Never assume. There are many device manufacturers out that who have a 
different opinion of ordinary.

You may need to set the attributes for the list elements separately.

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

2011-11-24 Thread Petrea Mitchell
Trying to get at least some minimal layout working, I've now got a
vertical LinearLayout inside a ScrollView for the PopupWindow layout.
Same problems, only along the vertical axis. Could this actually be a
PopupWindow problem? Is it a known bug?

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

2011-11-24 Thread petr.maza...@mautilus.com
Hi Klimek,

Can you provide us more information?? Which Android versions we need,
some examples, etc.

Thanks,
STeN

On Nov 24, 2:11 pm, Klimek oskarklimkow...@gmail.com wrote:
 Yes u can create plugins :D

 Dnia 24 lis 2011 o godz. 04:13 petr.maza...@mautilus.com 
 petr.maza...@mautilus.com napisał(a):

  How is the situation with the Android browser plug-ins?

  - Can we develop the browser plug-in?
  - Are there any limitations of what the plug-in can do?
  - Can it be developed in C or Java only?

  I swa here (https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/
  repository/revisions/cc99b832a941dc8cbb86f1607d04eb87935ddbfd/entry/
  android/development/samples/BrowserPlugin/README):

  plugin is intended to give plugin developers a point of reference to
  see how an android browser plugin is created and how to use the available 
  APIs.
  A plugin is packaged like a standard apk and can be installed either via 
  the
  market or adb.

  But I did not found anything on the official developer.android.com
  pages as well as any plug-ins and on Android Market...

  I am not 100% sure how it should work, but my expectation is that when
  browser loads an
  HTML page that contains the new MIME Type in Object tag, then
  Android brower should
  and create instance of associated my browser plug-in.

  In the Android web browser settings is an option to enable/disable
  plug-ins...

  Regards,
  STeN

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

2011-11-24 Thread petr.maza...@mautilus.com
Hi William,

We, as a company, have no problems dealing with individual consultants
as long as you can give us an invoice and you can provide us some
proof of your knowledge.

Regards,
STeN

On Nov 24, 5:32 am, William Ferguson william.ferguson...@gmail.com
wrote:
 I'll give you a quote. What's your question?

 William

 On Nov 24, 1:34 pm, petr.maza...@mautilus.com

 petr.maza...@mautilus.com wrote:
  Hi,

  The Nokia, Apple and Microsoft as well have for their mobile platforms
  (Symbian, iOS, WP7) the paid technical support - simply sometimes it
  is necessary to ask them for certain issue or SDK feature and
  sometimes the customer needs the 'certified' answer. Google groups,
  stackoverflow.com are great sites, but the customer sometimes really
  needs the reliable answer and there is not always time to check and
  develop this or this...

  Is there anything similar for Android?
  Are there any 3rd companies, who are providing the Android
  consultancy?

  Regards,
  STeN

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

do you know any individuals?

Regards,
Petr

On Nov 24, 4:37 am, Kumar Bibek coomar@gmail.com wrote:
 You could find a lot of individuals doing this, but I don't yet know about
 a company that does this.

 *Thanks and Regards,
 Kumar Bibek*
 *http://techdroid.kbeanie.comhttp://www.kbeanie.com*

 On Thu, Nov 24, 2011 at 9:04 AM, petr.maza...@mautilus.com 

 petr.maza...@mautilus.com wrote:
  Hi,

  The Nokia, Apple and Microsoft as well have for their mobile platforms
  (Symbian, iOS, WP7) the paid technical support - simply sometimes it
  is necessary to ask them for certain issue or SDK feature and
  sometimes the customer needs the 'certified' answer. Google groups,
  stackoverflow.com are great sites, but the customer sometimes really
  needs the reliable answer and there is not always time to check and
  develop this or this...

  Is there anything similar for Android?
  Are there any 3rd companies, who are providing the Android
  consultancy?

  Regards,
  STeN

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

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


[android-developers] Re: How secure are SharedPreferences on rooted devices?

2011-11-24 Thread Kevin TeslaCoil Software
 I'm just
 trying to understand how secure is SharedPreferences and what alternatives
 are there, that's all.

On a rooted device SharedPreferences absolutely can be tampered with.
Same with any on-device storage. However this doesn't mean you can't
use them.

1) Obfuscation. This is how Google recommends handling LVL data in
shared prefs. This is not secure as someone could reverse engineer the
obfuscator, but it makes it a pain in the ass and generally not worth
it (easier to crack the APK itself). Check out the
PreferenceObfuscator used for LVL:
http://code.google.com/p/marketlicensing/source/browse/library/src/com/android/vending/licensing/PreferenceObfuscator.java
. It gives you stuff like this: string name=5h99XZgr
+0i5N2SN0lEDu592x14RTrTj6/VOCCnxGokeazVz9bfLW793kkXg01kaBsJa1//
string
You can seed the obfuscator with a device id of some kind to prevent
users from just copying shared prefs from one device to another.

2) Server signed data. When you authenticate your coupon, instead of
saving a true or false, save a string from your server that is
cryptographically signed. At the launch of the app you can verify this
signature even without internet access. Again this is similar to the
LVL approach. It might be too much work as crypto is very confusing.

---

Along the lines of what others are saying, don't invest too much in
anti-piracy stuff. Release and see what happens, if no one cracks it
then don't waste any more time. If it's cracked, look at how they did
it and block it in the next update. Keep adding features in updates
will keep current and future legit users happy, and have the pirates
always playing catch up to the latest version until they get sick of
it and just buy it.

-Kevin

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

2011-11-24 Thread TreKing
On Thu, Nov 24, 2011 at 3:14 AM, Aki arnab...@gmail.com wrote:

 Cannot display an AlertDialog from a non-activity context.


OK ... so now, what non-activity context are you trying to display a dialog
from and why?

-
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

Re: [android-developers] Re: android app throws exception on map overlays tap events

2011-11-24 Thread TreKing
On Thu, Nov 24, 2011 at 12:35 AM, SripadRaj sripadraj1...@gmail.com wrote:

 the app crashes with null pointer exception.


Use your debugger and LogCat to determine what is null.
Use your debugger and LogCat to determine why the null object is null.
Use your programming skills to prevent the logic that made your null object
null from happening.
If you are stuck on that last part, post your findings from the first two
parts, since no one is going to be able to solve your issue without a
stacktrace at minimum.

-
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

Re: [android-developers] How to access asp.net webservice with authentication

2011-11-24 Thread TreKing
On Thu, Nov 24, 2011 at 1:07 AM, Samuel jrl...@gmail.com wrote:

 Do you have reference or example how to access secure asp.net
 webservice with authentication (user name  password) from android?


Nope, sorry. Then again, this is not specific to Android, so if you use
your favorite search engine, you should find plenty of information on the
topic.

-
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

Re: [android-developers] Two linearlayouts inside onLayout method

2011-11-24 Thread TreKing
On Thu, Nov 24, 2011 at 2:15 AM, Dav sweetcha...@gmail.com wrote:

 Can i create two linearlayouts inside the onLayout method (i am
 extending from adapterview)? .


Yes, you can create two LinearLayouts. Whether this will actually work as
you expect is another question.


 I want to add couple of views into the firstlayout and add rest of the
 views into the second linearlayout . Is this possible ?


Yes, this is possible. Whether this will actually work as you expect is
another question.


Why create this layouts in onLayout? Why not create them in XML and put
them in custom layout at design or initialization time?

-
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

Re: [android-developers] complete video player app crash on back btn

2011-11-24 Thread TreKing
On Thu, Nov 24, 2011 at 5:20 AM, Naveen kumarnaveen.si...@gmail.com wrote:

 Here i am playing a video when video completed then back button
 or navigating on activity gives crash, before finish the video when
 back press no error .


Debug your app. At the very least, post a stacktrace of the crash if you
expect help.

-
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

Re: [android-developers] hardware acceleration

2011-11-24 Thread Kostya Vasilyev
Where do you perform this test relative to the activity's lifecycle?

The method will not return true until the view has been attached to a
hardware accelerated window. The activity's onCreate is too early for that,
so you get false.

-- Kostya

24 ноября 2011 г. 16:50 пользователь New Developer secur...@isscp.comнаписал:

  Just tested the same code on a Sony S  same thing
 So with both the Sony S   and   Motorola Xoom

 You hear the audio ,  but see No video
 hardware is accelerated  and first time around I get the following message
 in LogCat

 11-24 07:49:23.688: E/Surface(11158): surface (identity=1931) is invalid,
 err=-19 (No such device)
 11-24 07:49:23.688: D/CallStack(11158): Surface#00  pc 00013b5e
 /system/lib/libsurfaceflinger_client.so
 11-24 07:49:23.688: D/CallStack(11158): Surface#01  pc 00013b9c
 /system/lib/libsurfaceflinger_client.so
 11-24 07:49:23.688: D/CallStack(11158): Surface#02  pc 00013c1a
 /system/lib/libsurfaceflinger_client.so
 11-24 07:49:23.688: D/CallStack(11158): Surface#03  pc 4f38
 /system/lib/libEGL.so
 11-24 07:49:23.688: D/CallStack(11158): Surface#04  pc 00036dca
 /system/lib/libandroid_runtime.so
 11-24 07:49:23.898: D/MediaPlayer(11158): getMetadata


 Thanks again to all


 On 11/23/2011 11:33 PM, Romain Guy wrote:

 On what device are you testing this?

 On Wed, Nov 23, 2011 at 7:01 PM, New Developer secur...@isscp.com wrote:

  My mainfest has

 application  android:icon=@drawable/logo
 android:hardwareAccelerated=true   android:label=@string/app_name
 android:debuggable=true android:theme=@android:style/Theme.NoTitleBar
 activity android:name=MainActivity
 android:hardwareAccelerated=true  android:screenOrientation=landscape
 android:configChanges=orientation /activity
 activity android:name=Display
 android:hardwareAccelerated=true  android:screenOrientation=landscape
 android:configChanges=orientation /activity


 From MainActivity I call Display  using intent

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

 Display class has

 public class Display extends Activity {
 private FrameLayout parent;
 private String  fName;
 public   static  VideoView  video;

 @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, videois   + video.isHardwareAccelerated());

 Log.e(display, imageis   + image.isHardwareAccelerated());
 image.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 Log.e(display, imageis   + image.isHardwareAccelerated());
 parent.setOnTouchListener(image);

 From my reading and understanding of Hardware acceleration I have done
 everything to  enable hardware acceleration
 yet  from LogCat

 parent is false
 video   is false
 image  is false
 image  is false

 Why  ? ?

 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




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


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

2011-11-24 Thread Lew
On Thursday, November 24, 2011 7:50:07 AM UTC-8, Spooky wrote:

 On Thu, Nov 24, 2011 at 03:51:50PM +0530, arun kumar wrote:

  *The basic bitrate formula is

 First, I don't see where you've included framing and CRC overhead.
 You need to include that, unless you're only interested in the HDD-HDD
 throughput.

  S = Size you like to use in KB (note 700 MB x 1024*?* = 716 800 KB)

 KB is not a valid unit.  I think you meant kB  Uppercase 'K' has
 absolutely *NO* meaning in this context.  kilo is a lowercase 'k'.


It is universal in the computer world to use KB to mean kilobytes.  You 
weren't aware of this?  It's been like this for decades.

In non-standard use, K is often used as a symbol prefix to the units bit 
and byte to designate the binary prefix kibi = 210 = 1024.
- 
 
http://en.wikipedia.org/wiki/SI_prefix#Units_used_in_computing_and_telecommunications

 A = Audio bitrate in KB/s (note 224 kbit/s = 224 / 8*?* = 28 KB/s)
  V = Video bitrate in KB/s, to get kbit/s multiply with 8*?*.

 Same for both of these (but you got it right for kb/s).  As for your
 formula, I'm not wasting my time to even review it.  Too much to do
 this morning.


So basically, you chimed in merely to berate the OP for something they 
hadn't even done wrong, but not to answer their question?  You have too 
much to do this morning but still found a few minutes to troll, eh?

Good you have your priorities straight, at least.

 Audio bitrate, A = 224 kbit/s / 8 = 28 KB/s
  (711 680 - (5400 x 28) ) / 5400 = 104 KB/s x 8*?* = 830 kbit/s.

 Again, you need to get your units straight


That chore list isn't getting any shorter!

One knows the length of the video file up front, be it in seconds or KB or 
whatever unit,  The only tricky thing is to determine what fraction of that 
size/length has been consumed at a particular point in playback.

The technique depends in part on how precise you need to be.  If you're 
just showing a progress bar, or calculating to, say, the nearest 5%, you 
can probably get away with ignoring the wobble factors like CRC, perhaps 
with a correction applied every 100 MB or so to reduce cumulative error. 
 If you need ppm resolution your calculations will need to be more precise.

You can measure time or you can measure stream size.  If you know the 
number of seconds of the entire video, and you have the current tickmark 
from the video, then Bob's your uncle.  You can skip all that fooferol of 
bytes/second, yada yada, and just use the timestamp-to-duration ratio.  If 
you cannot get at that data, you can use the system clock to approximate, 
but you'd have to factor out any pauses, fast-forward or whatnot.

I'd venture that dealing with rewind, pause and fast-forward will cause you 
more trouble than the raw calculation of ratio completed.  It all hinges on 
determination of your current position in the video.

-- 
Lew

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

[android-developers] Re: Calculate percentage of a video file

2011-11-24 Thread Lew
How about you provide an SSCCE http://sscce.org/?

-- 
Lew

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

Re: [android-developers] C/C++ struct in android

2011-11-24 Thread Lew


On Thursday, November 24, 2011 4:59:55 AM UTC-8, Mark Murphy (a Commons 
Guy) wrote:

 On Thu, Nov 24, 2011 at 7:56 AM, Aitor Mendaza Ormaza
 aitor...@gmail.com wrote:
  I want to make something similar to a struct in C/C++, to represent a
  collection of structured data.

 In Java, this is called a class.

  Is there a more efficient way to do this in android? Something like 
 structs
  :)

 No.

Classes *are* something like structs.

-- 
Lew
 

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

Re: [android-developers] C/C++ struct in android

2011-11-24 Thread Lew
A  struct would /be/ an object, thus its overhead would be the same as for 
a class, because in Java, a class *is* a struct, or to put it another way, 
there is no such thing as a struct, and if there were, it would be an 
object.  How do you think you can create an object for free by calling it a 
struct?

As for trying to optimize object creation and GC, what makes you think that 
poses a problem for you?  Where is your evidence - your profiles, timing 
measurements and description of the loads and other conditions under which 
you tested them?

And if you have such masurements, which I sincerely doubt, how would using 
a struct have any remote possibility of improving on that?

Don't waste your time looking for solutions to non-existent problems.

-- 
Lew


On Thursday, November 24, 2011 5:54:07 AM UTC-8, Aitor Mendaza Ormaza wrote:


 On Thu, Nov 24, 2011 at 2:18 PM, Mark Murphy mmu...@commonsware.comwrote:

 http://java.sun.com/developer/Books/shiftintojava/page1.html

 Upon first exposure to the Java programming language, some C
 programmers believe that classes are too heavyweight to replace
 structs under some circumstances, but this is not the case. Degenerate
 classes consisting solely of data fields are nearly equivalent to C
 structs in every respect.

 If you choose not to believe Mr. Bloch, that is your decision.


 http://developer.android.com/guide/practices/design/performance.html

 Object creation is never free. A generational GC with per-thread 
 allocation pools for temporary objects can make allocation cheaper, but 
 allocating memory is always more expensive than not allocating memory.

 If you allocate objects in a user interface loop, you will force a 
 periodic garbage collection, creating little hiccups in the user 
 experience. The concurrent collector introduced in Gingerbread helps, but 
 unnecessary work should always be avoided.


 For what is worth, I don't choose not to believe Mr. Bloch, I was just 
 wondering if in Android were better choices for classes as structs, as I 
 know my knowledge of both Java and Android is limited. That's the reason I 
 asked here after searching the web with no results (again, maybe my results 
 weren't good enough to get the answers I was looking for).

 Thanks, though, for the link, as it seems interesting.

  

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

2011-11-24 Thread Lew
As stated by another poster, this technique will not give you a _screen_ 
shot but a image of GUI elements within the activity.  They are not quite 
the same.  Also, some techniques for grabbing frame-buffer data can 
retrieve partially-drawn frames.

The only way I've found to reliably obtain a full-screen shot is via the 
DDMS library or equivalent (monkeyrunner,ChimpChat).

-- 
Lew

On Thursday, November 24, 2011 5:14:56 AM UTC-8, Mukesh Srivastav wrote:

 Let me give u [sic] an Example [sic]:

 Let's say you have a layout and it has a parent layout could be 
 (Relative,Absoulte or LinerLayout). Take the id out of it. Below are the 
 steps to do this.

 Step 1: Declare a Variable 

 View screen;

 Step 2: in public void onCreate(Bundle savedInstanceState)  Method

screen = (View) findViewById(R.id.captureimagelayout);  // Change your 
 Layout id here.

 Step 3:   in the Button onclick Listener do this.

 screen.setDrawingCacheEnabled(true);
 Bitmap imgToSave = screen.getDrawingCache();


 Step 4: in the Step 3# you have the Bitmap object,  use File:\\ operations 
  to save the bitmap.  you are done. 
 As simple as that.


 Regards,
 Mukesh Kumar,
 Android Consultant/Freelancer.
 India,Hyderabad.









 On Thu, Nov 24, 2011 at 6:31 PM, Mark Murphy mmu...@commonsware.comwrote:

 On Thu, Nov 24, 2011 at 5:57 AM, vani reddy vani.red...@gmail.com 
 wrote:
  How to take the screeenshot of android device programmatically..Apart 
 from
  using in DDMS.

 This is not supported by Android. There are ways to capture the image
 of your own activity (I think using the drawing cache), but you cannot
 programmatically capture images of other applications, for obvious
 security and privacy reasons.

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

 Android Training in NYC: http://marakana.com/training/android/

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@googlegroups.com
 To unsubscribe from this group, send email to
 android-develop...@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] Re: How secure are SharedPreferences on rooted devices?

2011-11-24 Thread Ricardo Amaral
On Thursday, November 24, 2011 2:57:47 PM UTC, Nikolay Elenkov wrote:

 On Thu, Nov 24, 2011 at 11:37 PM, Ricardo Amaral
 mas...@ricardoamaral.net wrote:
  I don't think those issues are really that relevant. For my situation at
  least.
 

 It's your app, so you should know best... But,

  This is only to give out some free copies to some persons, not to use as 
 a
  full validation system for every paying user...

 If you are worried about shared preferences being insecure, you should
 probably be worried about one of those persons posting his coupon to a
 forum, etc. If you allow coupon sharing, everyone would be able to get
 the full version using that coupon. If you think the risk is small enough,
 it's OK to ignore this, but you should at least consider the possibility.
 It's a lot easier than rooting your phone and changing preferences
 manually.


That's why, and for other reasons of course, the cupon system I linked 
above allows you to disable a coupon. If someone does something like that, 
they simply broke my trust and I shall invalidate their coupon. Than, no 
one else can use the app with that coupon. Of course I'll need to wait for 
them to pen my app while connected to the Internet so I can invalidate the 
coupon (cause like I said, I don't want to force an Internet connection to 
run my app every time).

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

2011-11-24 Thread Lew
Mukesh Srivastav wrote:

 L... Step 4: in the Step 3# you have the Bitmap object,  use File:\\ 
 operations  to save the bitmap.  you are done. 


Did you mean file:// operations?  I am not familiar with File:\\ 
operations.  As for file operations, Android (i.e., Linux) doesn't use 
backslash as a directory separator, not that you'd hard-code the separator. 
 

-- 
Lew

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

Re: [android-developers] Calculate percentage of a video file

2011-11-24 Thread Jim Graham
On Thu, Nov 24, 2011 at 10:14:24AM -0800, Lew wrote:
 On Thursday, November 24, 2011 7:50:07 AM UTC-8, Spooky wrote:

 It is universal in the computer world to use KB to mean kilobytes.
 You weren't aware of this?  It's been like this for decades.

Correction:  that's kB (lowercase 'k'.  And yes, I have known this
for decades.  Uppercase 'K' is a common mis-use, but that doesn't make
it correct any more than mb is correct for MB.

Next time you try to correct someone on units used in telecom,
networking, etc., try not to do so with a senior network engineer.

 In non-standard use, K is often used as a symbol prefix to the units bit 
 and byte to designate the binary prefix kibi = 210 = 1024.
 - 
  
 http://en.wikipedia.org/wiki/SI_prefix#Units_used_in_computing_and_telecommunications

Yep...just looked at that.  Notice that the chart shows a *lowercase*
'k'.

Thanks for proving my point.


 So basically, you chimed in merely to berate the OP for something they 
 hadn't even done wrong, but not to answer their question?  You have too 
 much to do this morning but still found a few minutes to troll, eh?

After seeing someone post about how their app was something like
8 mb  (8 millibits) in size...yeah, I felt like the mis-use of these
prefixes is getting out of hand

 Good you have your priorities straight, at least.

Do you have any idea how many times I've run into cases where throughput
is listed as kb/s in one spot, and kB/s in another, on the same screen,
with the same numbers?  So which fscking value is it?  You tell me.

Later,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| Peter da Silva:  No, try rm -rf /
spooky1...@gmail.com| Dave Aronson:As your life flashes before
 Running FreeBSD 7.0  |  your eyes, in the unit of time known as an
ICBM / Hurricane:   |  ohnosecond (alt.sysadmin.recovery)
   30.44406N 86.59909W  |

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


[android-developers] Re: PLEASE HELP . java.lang.NullPointerException when Service uses ArrayList

2011-11-24 Thread Lew
 BelvCompSvs wrote:

 I'm just here to confirm what the other two coders told you ~ I found
 it on first read place a catch( Throwable ) around the call
 to .print_result(MyService.


That's actually pretty bad advice.  Don't place a 'catch (Throwable ...)' 
around anything.
 

 java:62) and look at line 62 in MyService but before you even try that


That's actually pretty good advice.  Take a look at line 62.  (I wonder why 
you didn't identify that line for us, seeing as how you're asking for help) 

do Object someObject= ((val=null)?(error):(val)) all over code as


Huh?  I don't even understand this advice, much less endorse it.  However, 
every interpretation I put on this advice leads to a really bad idea, so 
I'm going to suggest that whatever this advice means, you should not follow 
it.

What you /should/ do is make sure that references point to something other 
than 'null' before you try to dereference them.
 

 what you are looking for is a result of many design types telling
 people that code handles nulls

 it doesn't = you have to go look for it and find it

What? 

Maybe if there were some punctuation, capital letters, and complete 
sentences in there I could understand what this guys is suggesting.

when you do, fix it some way.


I agree with this advice, which boils down to the oh-so-insightful 
suggestion that analyze the problem, determine a solution!  That's good 
advice, and I'm sure you'll find it exceedingly helpful.

Not.

NullPointerExceptions, like other RuntimeExceptions, are a result of 
programmer error, in this case yours.  It means that you have a pointer 
still pointing to 'null', but you tried to use it as if it pointed to 
something not 'null'.  You have to assign your pointers to something not 
'null', and you have to check your pointers before dereferencing them to 
make sure they aren't 'null'.

As stated upthread, the stack trace (plus my hint) will tell you which 
pointer was pointing to 'null' when you tried to dereference it.

-- 
Lew

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

[android-developers] Re: How secure are SharedPreferences on rooted devices?

2011-11-24 Thread Ricardo Amaral
On Thursday, November 24, 2011 5:36:20 PM UTC, Kevin TeslaCoil Software 
wrote:

  I'm just
  trying to understand how secure is SharedPreferences and what 
 alternatives
  are there, that's all.

 On a rooted device SharedPreferences absolutely can be tampered with.
 Same with any on-device storage. However this doesn't mean you can't
 use them.

 1) Obfuscation. This is how Google recommends handling LVL data in
 shared prefs. This is not secure as someone could reverse engineer the
 obfuscator, but it makes it a pain in the ass and generally not worth
 it (easier to crack the APK itself). Check out the
 PreferenceObfuscator used for LVL:

 http://code.google.com/p/marketlicensing/source/browse/library/src/com/android/vending/licensing/PreferenceObfuscator.java
 . It gives you stuff like this: string name=5h99XZgr
 +0i5N2SN0lEDu592x14RTrTj6/VOCCnxGokeazVz9bfLW793kkXg01kaBsJa1//
 string
 You can seed the obfuscator with a device id of some kind to prevent
 users from just copying shared prefs from one device to another.

I haven't yet used the LVL but I'm thinking of using it for the paid 
version of my app. However, my paid app will be a unlocker app, nothing 
else and as you know, you can't use LVL on free apps. But it's the free app 
that will check for the paid app

2) Server signed data. When you authenticate your coupon, instead of
 saving a true or false, save a string from your server that is
 cryptographically signed. At the launch of the app you can verify this
 signature even without internet access. Again this is similar to the
 LVL approach. It might be too much work as crypto is very confusing.

---

 Along the lines of what others are saying, don't invest too much in
 anti-piracy stuff. Release and see what happens, if no one cracks it
 then don't waste any more time. If it's cracked, look at how they did
 it and block it in the next update. Keep adding features in updates
 will keep current and future legit users happy, and have the pirates
 always playing catch up to the latest version until they get sick of
 it and just buy it.

 -Kevin

Again, this has nothing to do with piracy. Of course, I'll do a minimum 
effort to prevent it but that's it, I will never waste too much time trying 
to prevent piracy, that's a lost battle from the beginning.

I simply want some sort of control where I can give out free copies to some 
people. I could just give them the .apk and be done with it. But I don't 
want to go down that road. I only came here asking about the 
SharedPreferences security. If a rooted user can simply pull the file, 
easily swap a boolean value from false to true and push the file back to 
the phone. Than, in my opinion, it's a pointless way of validating a 
license. That's all I wanted to know and all I asked :)

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

2011-11-24 Thread wyo
I've cleaned and rebuild my project twice without a change, still
dark. I've deinstalled the app from the device and tried again, no
change again. I've added the

android:theme=@android:style/Theme.Light

to the application as well with no effect. So what now?

On 24 Nov., 17:50, Mark Murphy mmur...@commonsware.com wrote:
 That should have worked fine. If you are using Eclipse, try cleaning
 the project or otherwise forcing Eclipse to recompile and reinstall
 the APK in your emulator.









 On Thu, Nov 24, 2011 at 11:35 AM, wyo otto.w...@orpatec.ch wrote:
  Ordinary lists have black background and white text yet I'd like to
  have it reverse. I've tried to add

  android:theme=@android:style/Theme.Light

  to the activity in my manifest yet with no effect. Any idea how to
  change my list?

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

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

 Android Training in NYC:http://marakana.com/training/android/

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

2011-11-24 Thread Kostya Vasilyev
If what you want is to be able to give out free copies to some users,
implement another unlocker, that is similar to the paid premium unlocker
you're planning for Market, but is free.

Encrypting preference data has nothing to do with LVL per se, and does not
require that the app is paid or free.

Whatever encryption / obfuscation you choose to go with, make sure to throw
in some device-specific bits, so your data file with the activation state
won't work if copied to another device.

-- Kostya

24 ноября 2011 г. 22:52 пользователь Ricardo Amaral 
mas...@ricardoamaral.net написал:

 On Thursday, November 24, 2011 5:36:20 PM UTC, Kevin TeslaCoil Software
 wrote:

  I'm just
  trying to understand how secure is SharedPreferences and what
 alternatives
  are there, that's all.

 On a rooted device SharedPreferences absolutely can be tampered with.
 Same with any on-device storage. However this doesn't mean you can't
 use them.

 1) Obfuscation. This is how Google recommends handling LVL data in
 shared prefs. This is not secure as someone could reverse engineer the
 obfuscator, but it makes it a pain in the ass and generally not worth
 it (easier to crack the APK itself). Check out the
 PreferenceObfuscator used for LVL:
 http://code.google.com/p/**marketlicensing/source/browse/**
 library/src/com/android/**vending/licensing/**PreferenceObfuscator.javahttp://code.google.com/p/marketlicensing/source/browse/library/src/com/android/vending/licensing/PreferenceObfuscator.java
 . It gives you stuff like this: string name=5h99XZgr
 +0i5N2SN0lEDu592x14RTrTj6/**VOCCnxGokeazVz9bfLW793kkXg01ka**BsJa1//
 string
 You can seed the obfuscator with a device id of some kind to prevent
 users from just copying shared prefs from one device to another.

 I haven't yet used the LVL but I'm thinking of using it for the paid
 version of my app. However, my paid app will be a unlocker app, nothing
 else and as you know, you can't use LVL on free apps. But it's the free app
 that will check for the paid app

 2) Server signed data. When you authenticate your coupon, instead of
 saving a true or false, save a string from your server that is
 cryptographically signed. At the launch of the app you can verify this
 signature even without internet access. Again this is similar to the
 LVL approach. It might be too much work as crypto is very confusing.

 ---

 Along the lines of what others are saying, don't invest too much in
 anti-piracy stuff. Release and see what happens, if no one cracks it
 then don't waste any more time. If it's cracked, look at how they did
 it and block it in the next update. Keep adding features in updates
 will keep current and future legit users happy, and have the pirates
 always playing catch up to the latest version until they get sick of
 it and just buy it.

 -Kevin

 Again, this has nothing to do with piracy. Of course, I'll do a minimum
 effort to prevent it but that's it, I will never waste too much time trying
 to prevent piracy, that's a lost battle from the beginning.

 I simply want some sort of control where I can give out free copies to
 some people. I could just give them the .apk and be done with it. But I
 don't want to go down that road. I only came here asking about the
 SharedPreferences security. If a rooted user can simply pull the file,
 easily swap a boolean value from false to true and push the file back to
 the phone. Than, in my opinion, it's a pointless way of validating a
 license. That's all I wanted to know and all I asked :)

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

2011-11-24 Thread Jim Graham
On Thu, Nov 24, 2011 at 12:51:38PM -0600, Jim Graham wrote:

 Do you have any idea how many times I've run into cases where throughput
 is listed as kb/s in one spot, and kB/s in another, on the same screen,
 with the same numbers?  So which fscking value is it?  You tell me.

Now correcting myself.  :-)  Make that Mb/s and MB/s on the same
screenkB/s went out a long, long time ago.  :-)

Later,
   --jim

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

Do not look into waveguide with remaining eye.

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] Re: Lists with white background and black color

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 1:52 PM, wyo otto.w...@orpatec.ch wrote:
 I've cleaned and rebuild my project twice without a change, still
 dark. I've deinstalled the app from the device and tried again, no
 change again. I've added the

 android:theme=@android:style/Theme.Light

 to the application as well with no effect. So what now?

Throwing android:theme=@android:style/Theme.Light on the activity
in this project works just fine:

https://github.com/commonsguy/cw-android/tree/master/Selection/List

Download that project, add in the theme, and run it. If it works, then
the problem is something with your project. If it does not work, then
the problem is something with your device or emulator.

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

Android Training in NYC: http://marakana.com/training/android/

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

2011-11-24 Thread Lew
On Sunday, November 20, 2011 7:45:01 AM UTC-8, MosToneDef wrote:

 Dear Google;


This isn't Google, this is the Android Developers discussion group.
 

 I've been a Chrome user since its release. I've visited your app
 store  many times. I  recently received my Android phone and have been
 perusing your Android Market.

 I've noticed one very disturbing theme in both the Chrome Store 
 Android Market: The use of the word Addictive.


Really?
 

 I don't have to go into issues of how bad this word is and how it's
 tagged into so many game descriptions.


You didn't have to post this drivel, either, but you did.

The word isn't bad.  Fuck is a bad word, addictive isn't.

You are wrong.
 

 Another argument that works too is: How does a game developer decide


There should be a comma before and after the word, too.
 

 their game is good enough to become addictive? Utilizing this word/
 term/phrase/social label as a sales gimmick, is gratuitous at best.


How does any marketeer decide what adjectives to apply to the product or 
service they market?

Maybe you should Google for that information.


 I would like Google to ask themselves these questions:


 1. Do we want to be recognized  as a corporation that intentionally
 produces content that we hope users will become addicted too?


We?  Are you part of Google?
 

 2. What kind of consumer are we trying to attract with the term
 addictive?


I think that's obvious - a game-playing consumer who wants to be fully 
engaged with the game.

Duh.
 


 3. Why is the developer of this app resorting to the word addictive
 and why doesn't the developer resort to other responsible language to
 sell their product?


Begging the question of what constitutes responsible language.  Your 
whole fetish with the word addictive looks like irresponsible behavior to 
me, personally.

I think you're addicted to political correctness.
 


 4. What responsible language can the developer use instead of the term
 'addictive?


First, define responsible language and why anyone should endorse your 
idiolectic use of the term.

Calling your idea responsible and everyone else's irresponsible is 
fallacious - you have provided no reasoning to induce anyone to accept how 
you've framed the discussion.  You just resort to rhetoric and baloney, 
devoid of logic or evidence or other merit.
 


 5. When has the word addictive ever been a good word?


Since its inception.
 

 6. How is using the term addictive acceptable, but people who are
 labeled addicts, pariahs?

Different meanings in different contexts, Your arguments hold less water 
than a sieve. 
 

 7. Do we need to rely on the word addictive as an ongoing selling
 point?


We don't, but others are certainly free to.
 


 8. Should Google have content that people simply want to use out of
 need, not to fulfill an addiction?

Need?  No one needs a smartphone, much less the games on one.  The 
neuro-liniguistic programming evident in your phrasing inidcates that you 
have addiction issues, referring to luxuries as a need and being all 
obsessed over the word addiction in only one of its many meanings and 
connotations.


 9. Does Google want to rely on the term addictive as a statement of
 quality and playability?


Does Google do that in the first place?  You have not provided any evidence 
that Google does this.
 


 10. What is the difference between wanting to play a game  needing to
 play a game?


You're the one who talks about need.  I suggest you answer that question. 
 It's irrelevant to the marketing tactics to which you refer in any case.


 11. Is Google willing to accept that, when an addictive state of mind
 is realized, ALL choice is removed from our consumer?


Facts not in evidence, thesis is bullshit anyway.
 


 12. Are individuals who are performing any act out of obsession or
 compulsion, having and enjoyable experience?

What individuals are those, and how does that have any relevance whatsoever 
to the marketing technique in question, that of using an innocuous word  in 
one of its innocuous meanings?

13. Is our product something we want our customers to get better from?

Our?  Who is us in this context?  Google?  You aren't complaining about 
Google's products.  To what group or organization do you belong that is the 
antecedent for our?

I ask that Google make some changes. I also ask anyone reading this to


To what?  What independent developers do?  How should Google decide to 
dictate free-speech limitations to people that don't work for it?
 

 abstain from purchasing or interacting with any application that
 contains the base word addict and all it's forms.


The word is its, not it's.
 


 Finally, a simple word search in the Android market proves my point.
 You get multiple hits in games. And you get even more multiple hits in
 self help appsnow that's strange. It's like a candy company
 selling insulin.

No, it isn't.  Your thesis is crap from the ground up.

-- 
Lew

-- 
You received this 

Re: [android-developers] Calculate percentage of a video file

2011-11-24 Thread Raghav Sood
 Now correcting myself.  :-)  Make that Mb/s and MB/s on the same
 screenkB/s went out a long, long time ago.  :-)

Not so. Here in India we still have kB/s connections. MB/s ones have only
recently turned up here.

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

Re: [android-developers] Unit Test Fragment

2011-11-24 Thread Lew
Mark Murphy (a Commons Guy) wrote:

 Stuart Turner wrote:
  I'd like to unit test a fragment but cannot find any documentation or
  examples of how this can be achieved.
 
  Can anyone assist me with this please?

 

 Use the same approaches as you would for a View. Use AndroidTestCase
 to confirm your inflation worked (if you are inflating a layout). Use
 ActivityInstrumentationTestCase2, etc. to test it as used by an
 activity. There may be other options here as well.

You might find Android Mock
http://code.google.com/p/android-mock/
http://code.google.com/p/android-mock/helpful.

-- 
Lew
 

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

[android-developers] Re: C/C++ struct in android

2011-11-24 Thread Bret Foreman
If the OP is really concerned about performance he can create an array
of objects and implement his own protocol for reusing them. Then after
the initial creation of the array, no objects need to be either
created or destroyed.

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

2011-11-24 Thread saex
Ineed to play a short MP4 video when my app starts. I'm searching info
about how to load mp4 videos but i can't find the way to do it on
Android 1.5. My app sould be compatible from Android 1.5 to 4.0

I tryed with a lot of tutorials from google, but none of them works.
For example, now i'm trying with the VideoViewDemo from android
developers: 
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/VideoViewDemo.html

I have a video on my ASSETS folder, and i just need to play the video,
only this. I can not believe that doesn't exists a simple and quick
way to do it.

Please, if someone knows how to do it i will apreciate your help a
lot.

Thanks

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


[android-developers] Re: Action Bar

2011-11-24 Thread b0b
The problem is that the emulator does not emulate the no hardware buttons 
which make things very hard to visualize and test unless you own a Galaxy 
Nexus.
That, and showIfRoom is really a fuzzy concept.

I expect there will be many apps targetting Honeycomb that will look 
initially funny under ICS, assuming anything API LEVEL = 11 is a tablet.

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

2011-11-24 Thread Keith Hill
Right, but my app turns wifi off at screen off and turns it on and
back off on a schedule to get updates.


On Nov 23, 10:51 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 I don't have an answer, but

 The firmware already does all this - disabling WiFi when the screen goes
 off and enabling it when the user unlocks the phone.

 That's one of the three sleep policies anyway.

 24.11.2011 4:01, Keith Hill пишет:









  I just tested the app on a 2.2 tablet and it doesn't have this
  problem, but 2.2. only has one connected icon.  Bummer . . . this
  seems to be a honeycomb specific problem.  Anyone out there know a way
  around this?

  On Nov 22, 10:18 pm, Keith Hilldik...@gmail.com  wrote:
  This is actually happening with the ACTION_SCREEN_OFF part of the
  listener. I am turning wifi off when the screen goes off and even if I
  don't turn it back on when the screen comes on, when I manually turn
  on wifi, I still have this icon problem. I am stumped and I have tried
  everything that I can.

  On Nov 20, 11:03 pm, Keith Hilldik...@gmail.com  wrote:

  I have a service that is using a BroadcastReceiver to watch for
  ACTION_SCREEN_ON.  When that happens, I am using a wifimanager to turn
  wifi back on and reconnect.  For some reason, I connect to the network
  just fine, but the icon in the notification bar shows that I am not
  connected.  Instead of showing the blue icon (honeycomb), it changes
  to a semi white status icon, even though I have a connection.  It
  almost looks like the status when it is in the process of connecting,
  but not as white.  Any ideas as to why this would be happening?
  The only way to fix it is to reboot the device.  Even turning the wifi
  off and back on manually won't fix the icon error.
  Help is greatly appreciated.

 --
 Kostya Vasilyev

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

2011-11-24 Thread Lew
Bret Foreman wrote:

 If the OP is really concerned about performance he can create an array
 of objects and implement his own protocol for reusing them. Then after
 the initial creation of the array, no objects need to be either
 created or destroyed.


This might or might not have any effect on performance, much less a 
noticeable one.

The OP has shared no evidence that they have a performance problem, related 
to GC or otherwise.

There is no evidence that your approach would help, because changing the 
lifetime of objects influences GC in sometimes unexpected ways.  Even if 
the array approach did shave of a few milliseconds here or there, the added 
complexity of manually taking over memory management could create slowdowns 
and likely would create errors, and the effect on overall application 
performance would still be negligible.

If the OP is really concerned about performance, and willing to behave like 
an intelligent person, he can *measure* the app's performance under 
realistic conditions, *profile* it and determine where the inefficient 
spots are *before* and *instead of* engaging cargo-cult superstitions about 
what will help.

If you double the speed of something that only took 0.01% of overall 
execution time, but you have tripled the maintenance costs for the whole 
app and added new bugs that require new fixes, how is that a win?

-- 
Lew

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

Re: [android-developers] Re: C/C++ struct in android

2011-11-24 Thread Kristopher Micinski
On Thu, Nov 24, 2011 at 2:44 PM, Lew lewbl...@gmail.com wrote:
 Bret Foreman wrote:

 If the OP is really concerned about performance he can create an array
 of objects and implement his own protocol for reusing them. Then after
 the initial creation of the array, no objects need to be either
 created or destroyed.

 This might or might not have any effect on performance, much less a
 noticeable one.
 The OP has shared no evidence that they have a performance problem, related
 to GC or otherwise.
 There is no evidence that your approach would help, because changing the
 lifetime of objects influences GC in sometimes unexpected ways.  Even if the
 array approach did shave of a few milliseconds here or there, the added
 complexity of manually taking over memory management could create slowdowns
 and likely would create errors, and the effect on overall application
 performance would still be negligible.
 If the OP is really concerned about performance, and willing to behave like
 an intelligent person, he can *measure* the app's performance under
 realistic conditions, *profile* it and determine where the inefficient spots
 are *before* and *instead of* engaging cargo-cult superstitions about what
 will help.
 If you double the speed of something that only took 0.01% of overall
 execution time, but you have tripled the maintenance costs for the whole app
 and added new bugs that require new fixes, how is that a win?
 --
 Lew


But the whole point is moot:  the vm optimizes things beyond what you
would think.  If you want to know the optimizations that the vm makes,
you can read about it, and unless you do investigate it there's not
point in worrying about it.

(For example, the vm cuts out functions with no effects, think Object
constructor, does jit compilation, etc...)

So until you investigate the details, or have profiled and found a
problem, there's not really any point in worrying about it.

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


[android-developers] Re: Lists with white background and black color

2011-11-24 Thread wyo
There's an error in the build.xml file at

project name=ListViewDemo default=help

default target help does not exist in this project

How do I correct this?


On 24 Nov., 20:06, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, Nov 24, 2011 at 1:52 PM, wyo otto.w...@orpatec.ch wrote:
  I've cleaned and rebuild my project twice without a change, still
  dark. I've deinstalled the app from the device and tried again, no
  change again. I've added the

  android:theme=@android:style/Theme.Light

  to the application as well with no effect. So what now?

 Throwing android:theme=@android:style/Theme.Light on the activity
 in this project works just fine:

 https://github.com/commonsguy/cw-android/tree/master/Selection/List

 Download that project, add in the theme, and run it. If it works, then
 the problem is something with your project. If it does not work, then
 the problem is something with your device or emulator.

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

 Android Training in NYC:http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
Run

android update project -p .

from the project directory. I haven't updated the repo for that
project since the new build tools, sorry.

On Thu, Nov 24, 2011 at 3:06 PM, wyo otto.w...@orpatec.ch wrote:
 There's an error in the build.xml file at

 project name=ListViewDemo default=help

 default target help does not exist in this project

 How do I correct this?


 On 24 Nov., 20:06, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, Nov 24, 2011 at 1:52 PM, wyo otto.w...@orpatec.ch wrote:
  I've cleaned and rebuild my project twice without a change, still
  dark. I've deinstalled the app from the device and tried again, no
  change again. I've added the

  android:theme=@android:style/Theme.Light

  to the application as well with no effect. So what now?

 Throwing android:theme=@android:style/Theme.Light on the activity
 in this project works just fine:

 https://github.com/commonsguy/cw-android/tree/master/Selection/List

 Download that project, add in the theme, and run it. If it works, then
 the problem is something with your project. If it does not work, then
 the problem is something with your device or emulator.

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

 Android Training in NYC:http://marakana.com/training/android/

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

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

2011-11-24 Thread wyo
It updated the local.properties and proguard.cfg files but the
error in build.xml still persist.

On 24 Nov., 21:34, Mark Murphy mmur...@commonsware.com wrote:
 Run

 android update project -p .

 from the project directory. I haven't updated the repo for that
 project since the new build tools, sorry.









 On Thu, Nov 24, 2011 at 3:06 PM, wyo otto.w...@orpatec.ch wrote:
  There's an error in the build.xml file at

  project name=ListViewDemo default=help

  default target help does not exist in this project

  How do I correct this?

  On 24 Nov., 20:06, Mark Murphy mmur...@commonsware.com wrote:
  On Thu, Nov 24, 2011 at 1:52 PM, wyo otto.w...@orpatec.ch wrote:
   I've cleaned and rebuild my project twice without a change, still
   dark. I've deinstalled the app from the device and tried again, no
   change again. I've added the

   android:theme=@android:style/Theme.Light

   to the application as well with no effect. So what now?

  Throwing android:theme=@android:style/Theme.Light on the activity
  in this project works just fine:

 https://github.com/commonsguy/cw-android/tree/master/Selection/List

  Download that project, add in the theme, and run it. If it works, then
  the problem is something with your project. If it does not work, then
  the problem is something with your device or emulator.

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

  Android Training in NYC:http://marakana.com/training/android/

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

 Android Training in NYC:http://marakana.com/training/android/

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

2011-11-24 Thread Mark Murphy
On Thu, Nov 24, 2011 at 4:08 PM, wyo otto.w...@orpatec.ch wrote:
 It updated the local.properties and proguard.cfg files but the
 error in build.xml still persist.

Actually, the files in the repo are up to date for the current build
tools. Make sure you are on the current build tools via the SDK
Manager.

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

Android Training in NYC: http://marakana.com/training/android/

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


  1   2   >