[android-developers] Android input devices

2009-04-01 Thread chen.ju...@zte.com.cn

Who knows how many kinds of input device android can support?
Touchscreen,keyboard are known,about else,e.g. mouse 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] Re: Android Physics Engine

2009-04-01 Thread Anton

OK, for anyone interested in my simple physics demo, check out:

http://www.antonstoys.com/android/BallPit.apk

It's pretty basic, but it shows that you can do some amount of
physics on the G-phone at a reasonable rate.  And as always, there are
many improvements to be made.  :)

-Anton

On Mar 31, 2:12 pm, Anton socialhac...@gmail.com wrote:
     I'll definitely post the app tonight for you guys to check out (at
 work now).  I am an embedded systems programmer by trade.  But I do
 physics toys for fun and am just getting into Java/Android
 optimizations.  I will point out that optimizing for Java and
 optimizing for Android are very different.  As people have pointed out
 before, the key things to be careful with on Android are memory
 allocation and floating point math.  I've removed both of these from
 my physics loop.  I also found that function call overhead was quite
 large and had to manually inline all of my fixed point math code.  I
 think that with the correct spatial data structures I can get a couple
 hundred objects interacting.  I have a 2D rigid body physics engine
 that is currently all C++ (no exceptions or templates or RTTI or
 multiple inheritance) that I may port over as well.

     However, having said all of that, I think it may be the case that
 we will just have to wait until a native SDK is available to really
 write a top notch physics engine.  It's sort of the perfect example of
 a piece of code that doesn't need anything more than libc and JNI
 bindings.  And since you only call it a couple times per frame the JNI
 overhead would be well amortized.

     Anton

 On Mar 31, 9:17 am, mscwd01 mscw...@gmail.com wrote:

  Thanks for your feedback Shaun, I too unfortunately think a bespoke
  engine will need to be written for Android, which is a real pity as
  the iPhone has several physics engines which can easily handle
  hundreds of objects.

  Having said that Anton (2nd reply) has said he has an engine running,
  it would be nice to see a demo of this if that'd be possible?

  Clark, i'd definately host any .apk's on my own site, I wouldn't put
  it on the marketplace if it wasn't a finished app - do people
  actually do that?!

  I think i'll stay away from developing games with physics for the time
  being and concentrate on something else, I cant see it being feasible
  to include it any time soon which is a real pity.

  On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:

   I am the author of simpull.

   Sorry guys for the demo being out of whack for Simpull to the Core.
   The version of PulpCore that I integrated simpull with did not support
   Chrome, but you should be able to see it in IE, FF Safari.  It is nice
   to take a look at that demo to get a feel for what the engine is
   capable of, but the performance does not translate over to the fixed
   point branch/version of simpull when running on Android.

   I ran tests on both the emulator and the actual device and there was a
   significant increase in performance because of the fixed point
   implementation, but I got very frustrated that it still did not
   support the amount of objects in a scene that I considered good for a
   physics-based game.  It seemed to handle ~10 objects moving and
   colliding OK.  It has been a while since I was playing with it, so I
   do not really remember the exact number of objects or the frame rate.
   I mostly remember being upset with it.

   I am leaving the physics ideas for games out of the picture when
   thinking Android for now.  Someone would have to write a ground up
   engine with all the performance and memory concerns of Android in
   mind, which was not the case with Simpull.I created it for
   applets, then thought to port over to fixed-point for Android.  It
   works well with small scenes, but certainly not the staple engine to
   use in my opinion.

   Also, Phys2D will not run worth a damn on Android.  I tried it and I
   even went through some heavy performance tuning.  Garbage collection
   is the major issue even after all I did.  I seriously doubt JBox2D
   will run well either.  I'll stick to what I said earlier, a ground-up
   solution by someone smarter than me is probably required.

   On Mar 31, 9:49 am, admin.androidsl...@googlemail.com

   admin.androidsl...@googlemail.com wrote:
Not tried but if you can provide us with some example source code or
put something on the market, I'm sure we could take a look.

G1 performance is significantly faster than emulator, but there are
limitations.

Particularly with garbage collection and memory allocation on code
that gets run continuously in loops, so I don't know how optimised
these physics engines are for this purpose.

Would be interesting to find out though.

On Mar 31, 12:52 pm, mscwd01 mscw...@gmail.com wrote:

 Oh I forgot to re-ask...

 Has anyone tested Phys2D or JBox2D on an actual device to see if they
 run better than on 

[android-developers] Re: ListView elements in Dialogs never expand to full width

2009-04-01 Thread matthias

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



[android-developers] How to make a ListView adapt to dynamic element sizes?

2009-04-01 Thread Matthias

Hi,

I am struggling over another layouting problem again. I render a
ListView with ellipsized TextView elements, but those text views can
expand in size when the user clicks it. The problem is: If the
ListView doesn't already take the whole screen (e.g. because the total
height of all visible elements is smaller than the screen height),
then when expanding an element, the ListView's size doesn't also
expand accordingly, still obscuring most parts of the now taller text
view.

I have tried practically everything that seemed reasonable to me to
make the ListView get aware of the new height of its children,
including calls to:

invalidate()
measure()
recomputeViewAttributes(textView)

on all participating views (the list view and its elements), but
nothing works.

What am I missing? How can I programmatically tell a container view to
look at its children again in order to resize if necessary?

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



[android-developers] How to set item's height of ListView

2009-04-01 Thread Jiang
Hello, Guys.
The default item's height of ListView is too large, how can I set it's height? 
just like ApiDemos/Views/Lists/6. ListAdapter Collapsed.


Thanks!
-Jiang



  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Media player -38 Error

2009-04-01 Thread Ramesh

Hi,

I am trying to play media player.Its working fine but in log i am
getting this kind of error
Can anybody tell me why this error occured and how to solve this.

03-29 14:33:02.529: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.549: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.549: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
03-29 14:33:02.559: ERROR/MediaPlayer(1980): Error (-38,0)
03-29 14:33:02.559: ERROR/MediaPlayer(1980): start called in state 0

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Performance: pre-instantiate activities on app launch? Good practice or not?

2009-04-01 Thread matthias

Thanks for your reply Dianne.

As to profiling, I looked at traceview, but seems to be a bit overly
simplistic to actually profile a whole app. What I understand from the
documentation, what it actually does is measuring the time it takes
for a single method to complete. That's not a terribly useful
information if you want to see the big picture, however (i.e. get
answers to questions such as: how much time does the app spend in
which parts of the code base?).

Are there any plans to make traceview a tad more capable? That would
be great news!

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

2009-04-01 Thread matthias

Romain,

thanks for pointing out onInterceptTouchEvent()! I'll take a look at
that method ASAP.

As to the it was meant to be part of the UI design, I really wonder
why practically none of the apps shipped with Android use gestures
then (I mean, apart from scrolling up or down of course)? I can only
think of the home app right now. In contrast, the iPhone makes very
consistent use of flings to navigate back and forth between app
screens. We tried to implement this for our app, but as I said, it
wasn't actually an easy thing to do, because, for example, Android
doesn't actually define what a left or right fling is (in terms of
velocity and so forth). So, another app may have a different
understanding of this, and react differently to left and right flings
(in terms of when to interpret it as such, not in terms of the
resulting action, which of course may be different), giving navigation
in the platform an inconsistent feel. That's what I meant with messy
and fragile.

Cheers,
Matthias

On Mar 29, 8:16 pm, Romain Guy romain...@google.com wrote:
  Doesn't look like fling support as known from the iPhone was ever
  meant to be part of Android's UI design. Making your app react to
  flings (or even detect them properly) is a messy and fragile procedure
  in Android.

 It was meant to be part of the UI design. And it's not messy nor
 fragile, you just need to use onInterceptTouchEvent().

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

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] what can I do if I want to register 4 discontiguous buffers to surface flinger?

2009-04-01 Thread jiangchd

Only contiguous buffer is allowed to be registered to Surface flinger
now,  what can I do if I want to register 4 discontiguous buffers to
surface flinger? Any suggestions?

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] How do I know where my app received an ANR

2009-04-01 Thread idev

Hi

Is there a way of finding out where my app threw an ANR (Application
Not Responding). I took a look at the traces.txt file in /data and I
see a trace for my application. This is what I see in the trace.

DALVIK THREADS:
main prio=5 tid=3 TIMED_WAIT
  | group=main sCount=1 dsCount=0 s=0 obj=0x400143a8
  | sysTid=691 nice=0 sched=0/0 handle=-1091117924
  at java.lang.Object.wait(Native Method)
  - waiting on 0x1cd570 (a android.os.MessageQueue)
  at java.lang.Object.wait(Object.java:195)
  at android.os.MessageQueue.next(MessageQueue.java:144)
  at android.os.Looper.loop(Looper.java:110)
  at android.app.ActivityThread.main(ActivityThread.java:3742)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
  at dalvik.system.NativeStart.main(Native Method)

Binder Thread #3 prio=5 tid=15 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x434e7758
  | sysTid=734 nice=0 sched=0/0 handle=1733632
  at dalvik.system.NativeStart.run(Native Method)

Binder Thread #2 prio=5 tid=13 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x433af808
  | sysTid=696 nice=0 sched=0/0 handle=1369840
  at dalvik.system.NativeStart.run(Native Method)

Binder Thread #1 prio=5 tid=11 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x433aca10
  | sysTid=695 nice=0 sched=0/0 handle=1367448
  at dalvik.system.NativeStart.run(Native Method)

JDWP daemon prio=5 tid=9 VMWAIT
  | group=system sCount=1 dsCount=0 s=0 obj=0x433ac2a0
  | sysTid=694 nice=0 sched=0/0 handle=1367136
  at dalvik.system.NativeStart.run(Native Method)

Signal Catcher daemon prio=5 tid=7 RUNNABLE
  | group=system sCount=0 dsCount=0 s=0 obj=0x433ac1e8
  | sysTid=693 nice=0 sched=0/0 handle=1366712
  at dalvik.system.NativeStart.run(Native Method)

HeapWorker daemon prio=5 tid=5 VMWAIT
  | group=system sCount=1 dsCount=0 s=0 obj=0x4253ef88
  | sysTid=692 nice=0 sched=0/0 handle=1366472
  at dalvik.system.NativeStart.run(Native Method)

- end 691 -


How can I find out where the problem is?

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] Help! Process down after loadlibrary in Service

2009-04-01 Thread herain

I need to load a .so library in my Service onCreate method, but the
process just down after System.load. On the other hand, the same code
can work in Activity.
Are there some differences between activity and service in the way of
load .so file.

My code:
class AisoundService extends Service{
@Override
public void onCreate() {
Log.d(TAG,  TestService.onCreate);
String libFile = /data/nativelib/libAisound4.so;
Log.d(TAG, Trying to load +libFile);
System.load(libFile);
Log.d(TAG, Load +libFile+ Succes);
}
}

This is Logcat record:
04-01 07:57:25.761: DEBUG/AisoundService(26726): 
TestService.onCreate
04-01 07:57:25.771: DEBUG/AisoundService(26726): Trying to load /data/
nativelib/libAisound4.so
04-01 07:57:25.771: DEBUG/dalvikvm(26726): Trying to load lib /data/
nativelib/libAisound4.so 0x42fc5230
04-01 07:57:25.781: DEBUG/dalvikvm(26726): Added shared lib /data/
nativelib/libAisound4.so 0x42fc5230
04-01 07:57:25.901: INFO/DEBUG(26719): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
04-01 07:57:25.901: INFO/DEBUG(26719): Build fingerprint: 'tmobile/
kila/dream/trout:1.1/PLAT-RC33/126986:user/ota-rel-keys,release-keys'
04-01 07:57:25.901: INFO/DEBUG(26719): pid: 26726, tid: 26726  
com.iflytek.service 
04-01 07:57:25.901: INFO/DEBUG(26719): signal 11 (SIGSEGV), fault addr
0018
04-01 07:57:25.901: INFO/DEBUG(26719):  r0   r1 ad0665f0  r2
fffee5cc  r3 c33578a5
04-01 07:57:25.901: INFO/DEBUG(26719):  r4 802cc814  r5 ad07edf8  r6
  r7 802cc7e0

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



[android-developers] Re: Dev Phone can not see paid apps using the 1.1 holiday release

2009-04-01 Thread Sergi Velez

 If you install the official v1.1 system image for the ADP1 
 http://www.htc.com/www/support/android/adp.html then the Market client should 
 be able to access both paid and free apps, provided they are not 
 copy-protected.  (ADP1s cannot access copy-protected applications.)

This applies to worldwide developers or just US/UK?

---
[In theory, theory and practice are the same. In practice, they are not.]


On Wed, Apr 1, 2009 at 06:40, Dan Morrill morri...@google.com wrote:

 If you have the holiday devphone build, it's either an actual 
 Google-employee holiday phone, or you've flashed a third-party system image 
 on some other device.  The latter case is an unsupported configuration, and 
 it would not surprise me at all if the Market client in that build simply 
 pre-dates support for paid apps.

 If you install the official v1.1 system image for the ADP1 
 http://www.htc.com/www/support/android/adp.html then the Market client should 
 be able to access both paid and free apps, provided they are not 
 copy-protected.  (ADP1s cannot access copy-protected applications.)

 - Dan

 On Tue, Mar 31, 2009 at 8:11 AM, Eric Schott ericwsch...@gmail.com wrote:

 Here's the specs:

 Model Number: Android Dev Phone 1
 Firmware Version: 1.1
 Kernel Version: 2.6.25-01845-g85d4f0d android-bu...@apa27 #27
 Build number: holiday_devphone_userdebug 1.1

 Phone is registered to my google account ok.

 I go to the Market and search for apps, see them fine.  I then pick
 Priced Items Only and all I get is No matching content in Android
 Market.

 Does any have their dev phone seeing priced apps?  I see lots of
 chatter about this topic, but no definitive answers.

 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] Use native C/C++ libraries

2009-04-01 Thread gunar

Hi!

Is it possible to use a native C/C++ library? If so, are there any
restrictions for those libraries to be used?

Br,
gunar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Display of SQLite database information in tabular format

2009-04-01 Thread Zhubham

Hi,

I am interested in knowing how can we display the SQLite database
information in tabular format, the same way, as it is visible through
the SQL reader (SQLite Database Browser).

Are there any set of commands which help to achieve this??

Looking forward for your replies.

Thanks.

Best Regards,
Zhubham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 make a ListView adapt to dynamic element sizes?

2009-04-01 Thread matthias

Well, I found a really ugly workaround. That workaround is based on my
observation that the problem described does only occur if the
ListView's layout height is set to WRAP_CONTENT. So, since I use a
custom list adapter, I now call listView.getLayoutParams().height =
LayoutParams.FILL_PARENT whenever a text view is about to be
expanded... the reason I do not statically set its height to
FILL_PARENT is because then it will draw line separators below the
last element, which looks ugly if it doesn't expand to the bottom of
the screen.

It works... but, yuck!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Adb connection Error

2009-04-01 Thread jayesh.thadani

Hello All,

After i close my application, immediately after 1-2 min i get error
like mentioned below, with unusual time, and after restarting
application it works fine.

Generally it throws error like this, And i am not been able to
conclude the problem.
Even firewall is turned off.


[2009-04-01 15:03:59 - DeviceMonitor]Adb connection Error:An existing
connection was forcibly closed by the remote host
[2009-04-01 15:03:59 - adb]
[2009-04-01 15:03:59 - ddms]An existing connection was forcibly closed
by the remote host
java.io.IOException: An existing connection was forcibly closed by the
remote host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
at com.android.ddmlib.AdbHelper.write(Unknown Source)
at com.android.ddmlib.AdbHelper.write(Unknown Source)
at com.android.ddmlib.AdbHelper.setDevice(Unknown Source)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(Unknown Source)
at com.android.ddmlib.Device.executeShellCommand(Unknown Source)
at com.android.ddmlib.FileListingService.doLs(Unknown Source)
at com.android.ddmlib.FileListingService.access$3(Unknown Source)
at com.android.ddmlib.FileListingService$1.run(Unknown Source)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] playing video file

2009-04-01 Thread jaimin

hi,
i have problem in playing video file. Video file is playing nice but i
want to play video file in the whole emulator (size).Right now video
file is playing but in small size.
so any suggestion or solution plz help me.

thanks.
jaimin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: dispatchTouchEvent works differently when finger hold on touch screen in G1 emulator

2009-04-01 Thread Oceanedge


Thank you very much. It works fine.

On Mar 31, 10:14 am, Streets Of Boston flyingdutc...@gmail.com
wrote:
 Override you dispatchTouchEvent(...), as you do right now, and forward
 its MotionEvent to a GestureDetector you created.

 public class MyView {

    GestureDetector mGD = new GestureDetector(this);

    public MyView(...) {
       ...
       ...
       mGD.setIsLongPressEnabled(true);
       ...
    }
    public boolean dispatchTouchEvent(MotionEvent event) {
       ... you may want to handle the MotionEvent.ACTION_UP yourself
 first. ...
       ... but always call this at the end:
       return mGD.onTouchEvent(event);
    }

    // Called by the GestureDetector mGD.
    public void onLongPress(MotionEvent event) {
       // do your stuff here.
    }

 }

 On Mar 30, 9:51 pm, Oceanedge newsforhar...@gmail.com wrote:

  Thank you very much!

  But my current usecase is not to detect motion, but hold. I have a
  PhotoView which display an icon. It needs to respond to click and hold
  event.
  If user click on it, it will scroll other widget content in one step.
  If user touch  hold on it, it will scroll the widget content one by
  one continually in about 800ms interval.

  Currently I implement the behavior by setOnClickListener() method for
  the click event.
  For touch  hold, I override dispatchTouchEvent() method and check for
  the holding status by checking the move shall be less than 10 pixels
  and event.getEventTime() - event.getDownTime()  800ms for
  MotionEvent.ACTION_MOVE event.

  It works fine in G1 but not work in emulator.
  Is there any better solution?
  Thanks!

  On Mar 30, 11:17 am, Romain Guy romain...@google.com wrote:

   They work the same.

I have a class inherited from RelativeLayout and override public
booleandispatchTouchEvent(MotionEvent event) method. After I touch 
hold on the touch screen, in emulator I got MotionEvent.ACTION_DOWN
event only. But in G1, I got MotionEvent.ACTION_DOWN first and then
MotionEvent.ACTION_MOVE continuously, even if I try my best to hold
still my finger tip.

   That's simply because you cannot hold your finger still. With a mouse
   cursor you have a 1px precision, with a finger, it's a lot more. The
   way to work around this is simply to use thresholds when you try to
   detect motion. For instance in a ScrollView or ListView a scroll
   happens only if the finger has moved by 16 pixels or more. You can use
   the same values as the framework by looking at the ViewConfiguration
   class.

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

   Note: please don't send private questions to me, as I don't have time
   to provide private support.  All such questions should be posted on
   public forums, where I and others can see and answer them- Hide quoted 
   text -

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



[android-developers] Why isn't the standby instruction able to stop the thread?

2009-04-01 Thread Augustin.CL

Dear  All,
Recently, I have tried to know what would happen to an
alive thread, when the device goes to sleep. I program a simple
activity that will create and start a thread printing HERE AM I
repeatedly through Log.d. I expect the thread would be stopped after I
echo standby  /sys/android_power/request_state. The screen is off,
but the thread still keeps alive and prints out HERE AM I. I don't
know why the thread can't be stopped. I test this through emulator
(1.5cupcake) and G1(1.1?), but the results are the same. Could anyone
give me some suggestions or hints about this question? Thanks in
advanced.

   The following is my simple activity.

===CODE
HERE=
ublic class TestServiceDroid extends Activity {

PowerManager.WakeLock lock;
Thread h;

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

Thread h = new Thread(new Runnable(){
public void run(){
while(true){
try {
Log.d(TEST SERVICE,HERE AM I);

Thread.currentThread().sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch 
block
e.printStackTrace();
}
}
}
});
h.start();
}
}
===CODE
HERE=

Best regards,
Augustin.

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

2009-04-01 Thread MichaMicha

Hi,
I want to create a TextView with the text mirrored vertically.
I tried this code, but it doesn't show anything...

Does anyone have an idea?

/** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);



  setContentView(R.layout.main);

  rl = (RelativeLayout) findViewById(R.id.Rellayout);

  MirrorView speed = new MirrorView(getBaseContext());

  speed.setText(Testtest);

  rl.addView(speed);


}


 private class MirrorView extends TextView {

  public MirrorView(Context context) {
   super(context);
   // TODO Auto-generated constructor stub
  }


  @Override
  protected void onDraw(Canvas canvas) {


   canvas.scale((float) -1.0f, (float) 1.0f, (float)
(canvas
 .getWidth() / 2), (float) (canvas.getHeight
() / 2));
   super.onDraw(canvas);
  }
 }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] send bytes[] buffer in httppost

2009-04-01 Thread zeeshan

Hi Experts,



i need to post image on server by http post with some parameters, here
is a piece of code i am trying:





List NameValuePair nvps = new ArrayList NameValuePair();
nvps.add(new BasicNameValuePair(message[content],abc));
nvps.add(new BasicNameValuePair(message[image],?)); // here i need
image buffer


here is the buffer but this is writing directly to my connection
output stream which i dont have in above httppost,

InputStream is = this.content_resolver.openInputStream(imagefile);

while( (bytesRead = is.read(buffer))  0) {
wr.write(buffer,0,bytesRead);
wr.flush();
}


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

2009-04-01 Thread Weizhong

Hi there

Currently in .../external/ppp/pppd/auth.c, function check_passwd,
somebody write

{
#if 1
return UPAP_AUTHNAK;
#else
   .

This basically means PAP auth is not allowed on android. Is there any
reason behind this? Can I savely change the #if 1 to #if 0?

thanks,
Xia Weizhong
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Text in of a custom drawable

2009-04-01 Thread Erik H

Hi,

I need help to add text in a custom drawable. I'm looking in tha API
(android.graphics...) but cannot find any way of doing this.

What I basically want is a drawable that contains text that I can
change. Is this even possible today?

It must be a drawable as I use it where a drawable is required.

Thanks!

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



[android-developers] Re: *** Why 1 G1 can see Paid Apps in the Android Market and Another Not? ***

2009-04-01 Thread Stoyan Damov

On Wed, Apr 1, 2009 at 7:32 AM, Dan Morrill morri...@google.com wrote:
 This is not true.  Devices that are identified as root-enabled, whether an
 ADP1 or a rooted retail G1, cannot access copy-protected apps. They can
 still access both paid and free apps that are not copy-protected, however.

 - Dan


This is news to me. Was the feature of detecting whether the device is
running as root initially in the Market application, or this is a
recent change?

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] Is it possible to read cellular-network messages?

2009-04-01 Thread szeldon

Hi,

I wonder if it is possible to read messages of cellular network in
Android? By this I mean all those beacons that are transmitted by
cellular network, all the requests for registration, connection etc.
It would be great to see this in Java part of Android, but if it is
possible only in lower parts of the framework, it won't be so bad.

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



[android-developers] Re: ListView elements in Dialogs never expand to full width

2009-04-01 Thread matthias

Okay, I found (once again), a rather ugly workaround for this: Putting
the textview in layout object does the job. Like this:

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=wrap_content
android:paddingLeft=14dip
android:paddingRight=15dip

TextView
android:id=@+id/list_dialog_item
android:layout_width=fill_parent
android:layout_height=wrap_content
android:minHeight=?android:attr/listPreferredItemHeight
android:textAppearance=?android:attr/textAppearanceLarge
android:gravity=center_vertical
/
/RelativeLayout

But, that layout object is unnecessary overhead of course

Is this a bug maybe?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Passing a 2 dimensional array to an Activity

2009-04-01 Thread dillirao malipeddi
you can do in this way also...

Use a static two dimensional array in separate class and use it in service
and activity

On Wed, Apr 1, 2009 at 11:25 AM, Zhubham sahilz...@gmail.com wrote:


 Hi,

 I need to pass a 2 dimensional array to an ACTIVITY  from a SERVICE.
 How can I achieve this in minimum number of statements (as in avoiding
 putExtras for each and every string stored in the array)??

 Please help me with this.

 Thanks.

 Best Regards,
 Zhubham
 



-- 
Dilli Rao. M

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

2009-04-01 Thread dillirao malipeddi
You must not run any complex operations on main thread
like i/o , or network operations

for those operations use separate thread , otherwise it will cause ANR

On Wed, Apr 1, 2009 at 1:32 PM, idev ideveloper...@gmail.com wrote:


 Hi

 Is there a way of finding out where my app threw an ANR (Application
 Not Responding). I took a look at the traces.txt file in /data and I
 see a trace for my application. This is what I see in the trace.

 DALVIK THREADS:
 main prio=5 tid=3 TIMED_WAIT
  | group=main sCount=1 dsCount=0 s=0 obj=0x400143a8
  | sysTid=691 nice=0 sched=0/0 handle=-1091117924
  at java.lang.Object.wait(Native Method)
  - waiting on 0x1cd570 (a android.os.MessageQueue)
  at java.lang.Object.wait(Object.java:195)
  at android.os.MessageQueue.next(MessageQueue.java:144)
  at android.os.Looper.loop(Looper.java:110)
  at android.app.ActivityThread.main(ActivityThread.java:3742)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
 (ZygoteInit.java:739)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
  at dalvik.system.NativeStart.main(Native Method)

 Binder Thread #3 prio=5 tid=15 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x434e7758
  | sysTid=734 nice=0 sched=0/0 handle=1733632
  at dalvik.system.NativeStart.run(Native Method)

 Binder Thread #2 prio=5 tid=13 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x433af808
  | sysTid=696 nice=0 sched=0/0 handle=1369840
  at dalvik.system.NativeStart.run(Native Method)

 Binder Thread #1 prio=5 tid=11 NATIVE
  | group=main sCount=1 dsCount=0 s=0 obj=0x433aca10
  | sysTid=695 nice=0 sched=0/0 handle=1367448
  at dalvik.system.NativeStart.run(Native Method)

 JDWP daemon prio=5 tid=9 VMWAIT
  | group=system sCount=1 dsCount=0 s=0 obj=0x433ac2a0
  | sysTid=694 nice=0 sched=0/0 handle=1367136
  at dalvik.system.NativeStart.run(Native Method)

 Signal Catcher daemon prio=5 tid=7 RUNNABLE
  | group=system sCount=0 dsCount=0 s=0 obj=0x433ac1e8
  | sysTid=693 nice=0 sched=0/0 handle=1366712
  at dalvik.system.NativeStart.run(Native Method)

 HeapWorker daemon prio=5 tid=5 VMWAIT
  | group=system sCount=1 dsCount=0 s=0 obj=0x4253ef88
  | sysTid=692 nice=0 sched=0/0 handle=1366472
  at dalvik.system.NativeStart.run(Native Method)

 - end 691 -


 How can I find out where the problem is?

 Thanks.

 



-- 
Dilli Rao. M

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



[android-developers] android.intent.action.TIME_TICK - Has anyone used it?

2009-04-01 Thread simonc

I'm trying to get an application / reciever / anything that can
perform a task once every minute. I'm trying to use the intent-filter
android.intent.action.TIME_TICK which, in theory, sends an Intent
message every minute.

Does anyone have any code that uses the
android.intent.action.TIME_TICK intent? I can't seem to get it to send
the intent to my application and I can't find anything much on the
internet. Has anyone used it successfully?

I have a manifest.xml as below.

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=xx.xxx.xxx
  android:versionCode=2
  android:versionName=2.0.0
uses-permission
android:name=android.permission.RECEIVE_BOOT_COMPLETED /
uses-permission android:name=android.permission.SET_TIME_ZONE /

application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.xxxApp
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
receiver android:name=.xxxRecvr
android:process=xxx.xxx
intent-filter
action android:name=android.intent.action.TIME_TICK/

action
android:name=android.intent.action.TIMER_TICK/
/intent-filter
/receiver
/application
/manifest
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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.intent.action.TIME_TICK - Has anyone used it?

2009-04-01 Thread Mark Murphy

simonc wrote:
 I'm trying to get an application / reciever / anything that can
 perform a task once every minute.

That seems harsh for battery life, but maybe there's more to this that
I'm not privy to.

 I can't seem to get it to send
 the intent to my application and I can't find anything much on the
 internet.

Per the documentation:

You can not receive this through components declared in manifests, only
by exlicitly [sic] registering for it with Context.registerReceiver().

In your case, you are trying to receive this through a manifest-declared
receiver, which will not work.

Either switch to a registerReceiver() implementation, or use AlarmManager.

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

Android App Developer Training: http://commonsware.com/training.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: Android Physics Engine

2009-04-01 Thread mscwd01

Thanks for the demo Anton,

It certainly runs much smoother than the Phys2D and JBox2D engines I
have tried and you have more objects being simulated - so you must
have done something right ;)

I would expect it to run 2-3 times faster on an actual device too from
what I have read.

Once you have finished off the improvements do you have any plans to
release it?

Thanks

On Apr 1, 7:44 am, Anton socialhac...@gmail.com wrote:
     OK, for anyone interested in my simple physics demo, check out:

    http://www.antonstoys.com/android/BallPit.apk

     It's pretty basic, but it shows that you can do some amount of
 physics on the G-phone at a reasonable rate.  And as always, there are
 many improvements to be made.  :)

     -Anton

 On Mar 31, 2:12 pm, Anton socialhac...@gmail.com wrote:

      I'll definitely post the app tonight for you guys to check out (at
  work now).  I am an embedded systems programmer by trade.  But I do
  physics toys for fun and am just getting into Java/Android
  optimizations.  I will point out that optimizing for Java and
  optimizing for Android are very different.  As people have pointed out
  before, the key things to be careful with on Android are memory
  allocation and floating point math.  I've removed both of these from
  my physics loop.  I also found that function call overhead was quite
  large and had to manually inline all of my fixed point math code.  I
  think that with the correct spatial data structures I can get a couple
  hundred objects interacting.  I have a 2D rigid body physics engine
  that is currently all C++ (no exceptions or templates or RTTI or
  multiple inheritance) that I may port over as well.

      However, having said all of that, I think it may be the case that
  we will just have to wait until a native SDK is available to really
  write a top notch physics engine.  It's sort of the perfect example of
  a piece of code that doesn't need anything more than libc and JNI
  bindings.  And since you only call it a couple times per frame the JNI
  overhead would be well amortized.

      Anton

  On Mar 31, 9:17 am, mscwd01 mscw...@gmail.com wrote:

   Thanks for your feedback Shaun, I too unfortunately think a bespoke
   engine will need to be written for Android, which is a real pity as
   the iPhone has several physics engines which can easily handle
   hundreds of objects.

   Having said that Anton (2nd reply) has said he has an engine running,
   it would be nice to see a demo of this if that'd be possible?

   Clark, i'd definately host any .apk's on my own site, I wouldn't put
   it on the marketplace if it wasn't a finished app - do people
   actually do that?!

   I think i'll stay away from developing games with physics for the time
   being and concentrate on something else, I cant see it being feasible
   to include it any time soon which is a real pity.

   On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:

I am the author of simpull.

Sorry guys for the demo being out of whack for Simpull to the Core.
The version of PulpCore that I integrated simpull with did not support
Chrome, but you should be able to see it in IE, FF Safari.  It is nice
to take a look at that demo to get a feel for what the engine is
capable of, but the performance does not translate over to the fixed
point branch/version of simpull when running on Android.

I ran tests on both the emulator and the actual device and there was a
significant increase in performance because of the fixed point
implementation, but I got very frustrated that it still did not
support the amount of objects in a scene that I considered good for a
physics-based game.  It seemed to handle ~10 objects moving and
colliding OK.  It has been a while since I was playing with it, so I
do not really remember the exact number of objects or the frame rate.
I mostly remember being upset with it.

I am leaving the physics ideas for games out of the picture when
thinking Android for now.  Someone would have to write a ground up
engine with all the performance and memory concerns of Android in
mind, which was not the case with Simpull.I created it for
applets, then thought to port over to fixed-point for Android.  It
works well with small scenes, but certainly not the staple engine to
use in my opinion.

Also, Phys2D will not run worth a damn on Android.  I tried it and I
even went through some heavy performance tuning.  Garbage collection
is the major issue even after all I did.  I seriously doubt JBox2D
will run well either.  I'll stick to what I said earlier, a ground-up
solution by someone smarter than me is probably required.

On Mar 31, 9:49 am, admin.androidsl...@googlemail.com

admin.androidsl...@googlemail.com wrote:
 Not tried but if you can provide us with some example source code or
 put something on the market, I'm sure we could take a look.

 G1 

[android-developers] Re: Android Physics Engine

2009-04-01 Thread Stoyan Damov

I'm quite interested as well.

On Wed, Apr 1, 2009 at 3:04 PM, mscwd01 mscw...@gmail.com wrote:

 Thanks for the demo Anton,

 It certainly runs much smoother than the Phys2D and JBox2D engines I
 have tried and you have more objects being simulated - so you must
 have done something right ;)

 I would expect it to run 2-3 times faster on an actual device too from
 what I have read.

 Once you have finished off the improvements do you have any plans to
 release it?

 Thanks

 On Apr 1, 7:44 am, Anton socialhac...@gmail.com wrote:
     OK, for anyone interested in my simple physics demo, check out:

    http://www.antonstoys.com/android/BallPit.apk

     It's pretty basic, but it shows that you can do some amount of
 physics on the G-phone at a reasonable rate.  And as always, there are
 many improvements to be made.  :)

     -Anton

 On Mar 31, 2:12 pm, Anton socialhac...@gmail.com wrote:

      I'll definitely post the app tonight for you guys to check out (at
  work now).  I am an embedded systems programmer by trade.  But I do
  physics toys for fun and am just getting into Java/Android
  optimizations.  I will point out that optimizing for Java and
  optimizing for Android are very different.  As people have pointed out
  before, the key things to be careful with on Android are memory
  allocation and floating point math.  I've removed both of these from
  my physics loop.  I also found that function call overhead was quite
  large and had to manually inline all of my fixed point math code.  I
  think that with the correct spatial data structures I can get a couple
  hundred objects interacting.  I have a 2D rigid body physics engine
  that is currently all C++ (no exceptions or templates or RTTI or
  multiple inheritance) that I may port over as well.

      However, having said all of that, I think it may be the case that
  we will just have to wait until a native SDK is available to really
  write a top notch physics engine.  It's sort of the perfect example of
  a piece of code that doesn't need anything more than libc and JNI
  bindings.  And since you only call it a couple times per frame the JNI
  overhead would be well amortized.

      Anton

  On Mar 31, 9:17 am, mscwd01 mscw...@gmail.com wrote:

   Thanks for your feedback Shaun, I too unfortunately think a bespoke
   engine will need to be written for Android, which is a real pity as
   the iPhone has several physics engines which can easily handle
   hundreds of objects.

   Having said that Anton (2nd reply) has said he has an engine running,
   it would be nice to see a demo of this if that'd be possible?

   Clark, i'd definately host any .apk's on my own site, I wouldn't put
   it on the marketplace if it wasn't a finished app - do people
   actually do that?!

   I think i'll stay away from developing games with physics for the time
   being and concentrate on something else, I cant see it being feasible
   to include it any time soon which is a real pity.

   On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:

I am the author of simpull.

Sorry guys for the demo being out of whack for Simpull to the Core.
The version of PulpCore that I integrated simpull with did not support
Chrome, but you should be able to see it in IE, FF Safari.  It is nice
to take a look at that demo to get a feel for what the engine is
capable of, but the performance does not translate over to the fixed
point branch/version of simpull when running on Android.

I ran tests on both the emulator and the actual device and there was a
significant increase in performance because of the fixed point
implementation, but I got very frustrated that it still did not
support the amount of objects in a scene that I considered good for a
physics-based game.  It seemed to handle ~10 objects moving and
colliding OK.  It has been a while since I was playing with it, so I
do not really remember the exact number of objects or the frame rate.
I mostly remember being upset with it.

I am leaving the physics ideas for games out of the picture when
thinking Android for now.  Someone would have to write a ground up
engine with all the performance and memory concerns of Android in
mind, which was not the case with Simpull.I created it for
applets, then thought to port over to fixed-point for Android.  It
works well with small scenes, but certainly not the staple engine to
use in my opinion.

Also, Phys2D will not run worth a damn on Android.  I tried it and I
even went through some heavy performance tuning.  Garbage collection
is the major issue even after all I did.  I seriously doubt JBox2D
will run well either.  I'll stick to what I said earlier, a ground-up
solution by someone smarter than me is probably required.

On Mar 31, 9:49 am, admin.androidsl...@googlemail.com

admin.androidsl...@googlemail.com wrote:
 Not tried but if you can provide us with 

[android-developers] Re: Passing a 2 dimensional array to an Activity

2009-04-01 Thread Miguel Paraz

On Apr 1, 1:55 pm, Zhubham sahilz...@gmail.com wrote:
 I need to pass a 2 dimensional array to an ACTIVITY  from a SERVICE.
 How can I achieve this in minimum number of statements (as in avoiding
 putExtras for each and every string stored in the array)??

Hi,
You could use the JSON en/decoding functions. You can store lists and
maps of Strings. They probably consume more CPU, 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
-~--~~~~--~~--~--~---



[android-developers] Re: Passing a 2 dimensional array to an Activity

2009-04-01 Thread Mark Murphy

Miguel Paraz wrote:
 On Apr 1, 1:55 pm, Zhubham sahilz...@gmail.com wrote:
 I need to pass a 2 dimensional array to an ACTIVITY  from a SERVICE.
 How can I achieve this in minimum number of statements (as in avoiding
 putExtras for each and every string stored in the array)??
 
 Hi,
 You could use the JSON en/decoding functions. You can store lists and
 maps of Strings. They probably consume more CPU, though.

If the service is in the same process as the activity, you can use the
singleton pattern and have the activity call some method on the service
object.

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

Android App Developer Books: http://commonsware.com/books.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: Is it possible to read cellular-network messages?

2009-04-01 Thread David Turner
I believe most radio messages are handled by the radio firmware which, in
the case of the G1 and ADP1,
runs on a separate ARM9 processor which doesn't share a memory bus with the
ARM11 Android itself
runs on. In other words, they are not available.

On Wed, Apr 1, 2009 at 12:36 PM, szeldon szeldon@gmail.com wrote:


 Hi,

 I wonder if it is possible to read messages of cellular network in
 Android? By this I mean all those beacons that are transmitted by
 cellular network, all the requests for registration, connection etc.
 It would be great to see this in Java part of Android, but if it is
 possible only in lower parts of the framework, it won't be so bad.

 Thanks in advance
 


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



[android-developers] Re: Use native C/C++ libraries

2009-04-01 Thread Mark Murphy

gunar wrote:
 Is it possible to use a native C/C++ library? 

If you are developing changes to the firmware, yes. Questions on this
are best address to a mailing list appropriate for firmware-level
discussions:

http://source.android.com/discuss

If you are developing an application designed to be installed on
existing devices (e.g., off of the Android Market), no.

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

Android App Developer Books: http://commonsware.com/books.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] Calender application

2009-04-01 Thread swapnil

Do android have Calender application present in it?

If not how can we put any appointments or reminders in the Calender?


Thanks in Advance.


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

2009-04-01 Thread David Turner
Do you have example sentences that demonstrate the problem.
For the record, the emulator-specific GPS support in the system will only
record GPRMC sentence with a fix status of 'A'

On Tue, Mar 31, 2009 at 1:51 PM, malt alt.mi...@googlemail.com wrote:


 I'm writing a Android gps application using locationmanager with
 locationlistener and I'm only testing with the emulator. This is my
 problem.
 - When sending only $GPGGA nmea sentences to emulator by telnet,
 everything works fine.
 - When sending only $GPRMC nmea sentences to emulator by telnet, the
 first location is recognized by locationmanager, the gps provider goes
 into status 2, next $GPRMC sentence is not recognized.

 This happens not only with my application, the Google Maps application
 and also others show the same behaviour: they get only the first
 $GPRMC location.

 When sending a $GPGGA sentence after the $GPRMC, the locationlistener
 gets controll and location is shown.

 


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

2009-04-01 Thread David Turner
Did you enabled the GPS with Settings  Security  location  Enable GPS
satellites ?

On Mon, Mar 16, 2009 at 7:56 AM, Kumar androidq.ku...@gmail.com wrote:


 Hi, Alex Thanks for your reply to my earlier mail,
 I am unable to get the location updates when i use Network location
 provider.
 From the older posts i understood that to use NW location provider we
 need to do the following.

 for  GPS provider
  lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1l, 1f,
 TestGPS.this);
 for N/W location provider
  lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1l, 1f,
 TestGPS.this);

 And in my Android manifest file i have included the permissions
 ACCESS_COARSE_LOCATION( for N/W) and ACCESS_FINE_LOCATION (for GPS).

 But still the location is not updated.


 Regards
 Kumar.
 


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



[android-developers] Re: Dev Phone can not see paid apps using the 1.1 holiday release

2009-04-01 Thread Evgeny V
I have unlocked phone purchased from ebay.
I can't see the paid APP too.


On Wed, Apr 1, 2009 at 11:36 AM, Sergi Velez sergi.ve...@gmail.com wrote:


  If you install the official v1.1 system image for the ADP1
 http://www.htc.com/www/support/android/adp.html then the Market client
 should be able to access both paid and free apps, provided they are not
 copy-protected.  (ADP1s cannot access copy-protected applications.)

 This applies to worldwide developers or just US/UK?

 ---
 [In theory, theory and practice are the same. In practice, they are not.]


 On Wed, Apr 1, 2009 at 06:40, Dan Morrill morri...@google.com wrote:
 
  If you have the holiday devphone build, it's either an actual
 Google-employee holiday phone, or you've flashed a third-party system image
 on some other device.  The latter case is an unsupported configuration, and
 it would not surprise me at all if the Market client in that build simply
 pre-dates support for paid apps.
 
  If you install the official v1.1 system image for the ADP1
 http://www.htc.com/www/support/android/adp.html then the Market client
 should be able to access both paid and free apps, provided they are not
 copy-protected.  (ADP1s cannot access copy-protected applications.)
 
  - Dan
 
  On Tue, Mar 31, 2009 at 8:11 AM, Eric Schott ericwsch...@gmail.com
 wrote:
 
  Here's the specs:
 
  Model Number: Android Dev Phone 1
  Firmware Version: 1.1
  Kernel Version: 2.6.25-01845-g85d4f0d android-bu...@apa27 #27
  Build number: holiday_devphone_userdebug 1.1
 
  Phone is registered to my google account ok.
 
  I go to the Market and search for apps, see them fine.  I then pick
  Priced Items Only and all I get is No matching content in Android
  Market.
 
  Does any have their dev phone seeing priced apps?  I see lots of
  chatter about this topic, but no definitive answers.
 
  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: Display of SQLite database information in tabular format

2009-04-01 Thread Mark Murphy

Zhubham wrote:
 I am interested in knowing how can we display the SQLite database
 information in tabular format, the same way, as it is visible through
 the SQL reader (SQLite Database Browser).
 
 Are there any set of commands which help to achieve this??

Pull the database off the device, using adb pull, DDMS, or the DDMS
perspective in Eclipse. Then, use whatever tools you want (I'm fond of
the SQLite Manager plugin for Firefox).

If you modify the database, use adb push or DDMS to put it back on the
device.

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

Android App Developer Training: http://commonsware.com/training.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: Cupcake coming in April? Where is the SDK?

2009-04-01 Thread David Turner
There is a pending fix here:
https://review.source.android.com/Gerrit#change,9452

Note that the build system is a bit buggy and will not re-generate
system.img if you integrate this (even though it copies the proper file to
out/.../system/etc/vold.conf).
One way to force it is:

touch system/core/init/init.c
m


On Wed, Apr 1, 2009 at 4:00 AM, Eric Chen jude...@gmail.com wrote:

 Hi Cupcake today build version seems has same sdcard mount problem

 Best Regards

 Eric Chen



 On Thu, Mar 26, 2009 at 9:05 AM, Anonymous Anonymous 
 firewallbr...@googlemail.com wrote:

 Sorry i coundt find mmcblk0 but i can see mtdblock0 mtdblock1 and
 mtdblock2
 *and btw this will not help much :( as i need it inside application to
 browse data
 Thanks everyone



 On Thu, Mar 26, 2009 at 6:26 AM, Victor vkrugli...@gmail.com wrote:


 you may try:

 1. adb shell
 2. mount -t vfat /dev/block/mmcblk0 /sdcard
 but Gallery and Camera do not recognize the SD card even it's mounted,
 but you may brows sd card by adb shell and Eclipse



 On Mar 26, 9:48 am, Anonymous Anonymous firewallbr...@googlemail.com
 wrote:
  Hi JBQ,
  Thanks for the reply.. i do see mountd.conf in my older version and no
  mountd.conf or vold.conf in my current working version.. i do have a
 valid
  sdcard image.. by any chance can i mount it?
 
  On Thu, Mar 26, 2009 at 6:16 AM, Jean-Baptiste Queru j...@android.com
 wrote:
 
 
 
   Code drops before the one that was done about 2 weeks ago had another
   mechanism for the management of the SD card (mountd vs vold), so that
   vold.conf wouldn't be necessary there.
 
   JBQ
 
   On Wed, Mar 25, 2009 at 5:27 PM, Anonymous Anonymous
   firewallbr...@googlemail.com wrote:
For me too the sdcard problem ...The file is missing(vold.conf) :(
 , but
   i
checked another old sourcebase..where sdcard work.. there also that
 file
missing !!
 
Any clues?
Thanks
 
On Wed, Mar 25, 2009 at 10:55 PM, David Turner di...@android.com
   wrote:
 
I fear it's a packaging problem. Is there a file named vold.conf
 in
/system/etc ?
I.e. what is the output of adb shell /system/etc/vold.conf
If the file is missing, the SDCard cannot be mounted even if it is
recognized by the kernel.
 
On Wed, Mar 25, 2009 at 12:40 PM, Victor vkrugli...@gmail.com
 wrote:
 
I'm also expirienced some problem with a today build of cupcake
 
I just download a cupcake branch of source code and build it.
I configured Eclipse for a new SDK, and appear the things is
 works
great, EXCEPT emulator.
1. I configured a new AVD as parameter i pointed my old
 sdcard.img
then loaded and do not see my sdcard
2. then I back and configure another AVD with a parameter to
 create a
new sdcard.img, when the emulator loaded I still not seen sdcard
 in
emulator.
3. then I try to something like: emulator -avd myavd -sdcard
mysdcard.img and there is still no sd card.
 
How can I restore my sd card in emulator.
 
   --
   Jean-Baptiste M. JBQ Queru
   Android Engineer, Google.
 
   Questions sent directly to me that have no reason for being private
   will likely get ignored or forwarded to a public forum with no
 further
   warning.






 


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

2009-04-01 Thread Bobbie

I tried this code, and every time it force closes.  The Uri object
gives me the Uri, but I can't see why it's failing... Please help!!!

Uri photoUri = intent.getData();
Cursor cursor = getContentResolver().query(photoUri, new String[]
{MediaStore.Images.ImageColumns.DATA}, null, null, null);
String absoluteFilePath = cursor.getString(0);



On Mar 26, 8:57 am, beachy beachy.g...@gmail.com wrote:
 cheers, did not know that about Drawables will use Bitmaps then.

 Thanks,
 Greg.

 On Mar 25, 3:23 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

  This Uri is the logical (not physical) path used by theimagecontent
  provider.
  If you want to get the physical path to the actual file on the SD-
  card, query this Uri:

    Cursor cursor = query(photoUri, new String[]
  {MediaStore.Images.ImageColumns.DATA}, null, null, null);
    String absoluteFilePath = cursor.getString(0);

  Now, absoluteFilePath is the physical path to yourimage, which you
  can use in Drawable.createFromPath

  Question: Why don't you create a Bitmap instead?

     ...
     InputStream is = getContentResolver().openInputStream(photoUri);
     Bitmap bm = BitmapFactory.decodeStream(is);
     ...
     is.close();

  I ask this, because it is safer to cache Bitmaps instead of Drawables.
  If you cache Drawables, you run the risk of memory leaks. Drawables
  have handles to your activity and when your activity gets destroyed
  while your Drawables are still cached, your activiy will never be
  garbage collected -- memory leak.
  Bitmaps don't have this problem. They are basically byte-arrays with
  some behavior :).

  On Mar 25, 3:15 am, beachy beachy.g...@gmail.com wrote:

   In some code I call this;
                                           Intent photoPickerIntent = new 
   Intent
   (Intent.ACTION_PICK);
                                       photoPickerIntent.setType(image/*);
                                       
   startActivityForResult(photoPickerIntent,
   1);

   then implement this method

   protected void onActivityResult(int requestCode, int resultCode,
   Intent intent)
           {
                super.onActivityResult(requestCode, resultCode, intent);

                if (resultCode == RESULT_OK)
                {
                        Uri photoUri = intent.getData();
                        Log.d(TAG, should be adding a photo);
                        if (photoUri != null)
                        {

                                Log.d(TAG, photo uri is not blank);
                                    // do something with the content Uri
                                //TODO figure out why this does not work!!
                                Log.d(TAG, the photo URI is  + 
   photoUri.getPath());
                            Drawable thePic = Drawable.createFromPath
   (photoUri.getPath());
                            //thePic is Null
                                        if(thePic != null){
                                Log.d(TAG, the pic has loaded);
                                    myRecipe.addPic(thePic);
                                    ((RecipeAdapter)myListView.getAdapter
   ()).notifyDataSetChanged();

                            }
                        }
                }
           }

   trying to get aimageand load it in to a drawable object. The Uri
   that is returned seems logical

   03-25 08:12:58.554: DEBUG/ConvertScaleScreen(174): the photo URI is /
   external/images/media/1

   but when i start up a shell with adb the file location or even the
   root drive does not exitst, am I missing something here? should the be
   a symbolic link on the file system?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 make a ListView adapt to dynamic element sizes?

2009-04-01 Thread Streets Of Boston

If your list-view uses a (list-)adapter (or a subclass of this), did
you try to call notifyDataSetInvalidated() on the adapter?
This will cause your adapter's getView(int position, View convertView,
ViewGroup parent) to be called again and you can handle your changed
list-item in there.

On Apr 1, 5:24 am, matthias m.kaepp...@googlemail.com wrote:
 Well, I found a really ugly workaround. That workaround is based on my
 observation that the problem described does only occur if the
 ListView's layout height is set to WRAP_CONTENT. So, since I use a
 custom list adapter, I now call listView.getLayoutParams().height =
 LayoutParams.FILL_PARENT whenever a text view is about to be
 expanded... the reason I do not statically set its height to
 FILL_PARENT is because then it will draw line separators below the
 last element, which looks ugly if it doesn't expand to the bottom of
 the screen.

 It works... but, yuck!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: photo picker Uri issue

2009-04-01 Thread Streets Of Boston

I can't tell.

Debug your code and see which statement throws an exception and see
what exception is thrown and note the values of the variables (are
some set to null when they shouldn't, for example).

On Apr 1, 9:35 am, Bobbie bobbie.st...@gmail.com wrote:
 I tried this code, and every time it force closes.  The Uri object
 gives me the Uri, but I can't see why it's failing... Please help!!!

 Uri photoUri = intent.getData();
 Cursor cursor = getContentResolver().query(photoUri, new String[]
 {MediaStore.Images.ImageColumns.DATA}, null, null, null);
 String absoluteFilePath = cursor.getString(0);

 On Mar 26, 8:57 am, beachy beachy.g...@gmail.com wrote:



  cheers, did not know that about Drawables will use Bitmaps then.

  Thanks,
  Greg.

  On Mar 25, 3:23 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

   This Uri is the logical (not physical) path used by theimagecontent
   provider.
   If you want to get the physical path to the actual file on the SD-
   card, query this Uri:

     Cursor cursor = query(photoUri, new String[]
   {MediaStore.Images.ImageColumns.DATA}, null, null, null);
     String absoluteFilePath = cursor.getString(0);

   Now, absoluteFilePath is the physical path to yourimage, which you
   can use in Drawable.createFromPath

   Question: Why don't you create a Bitmap instead?

      ...
      InputStream is = getContentResolver().openInputStream(photoUri);
      Bitmap bm = BitmapFactory.decodeStream(is);
      ...
      is.close();

   I ask this, because it is safer to cache Bitmaps instead of Drawables.
   If you cache Drawables, you run the risk of memory leaks. Drawables
   have handles to your activity and when your activity gets destroyed
   while your Drawables are still cached, your activiy will never be
   garbage collected -- memory leak.
   Bitmaps don't have this problem. They are basically byte-arrays with
   some behavior :).

   On Mar 25, 3:15 am, beachy beachy.g...@gmail.com wrote:

In some code I call this;
                                        Intent photoPickerIntent = new 
Intent
(Intent.ACTION_PICK);
                                    
photoPickerIntent.setType(image/*);
                                    
startActivityForResult(photoPickerIntent,
1);

then implement this method

protected void onActivityResult(int requestCode, int resultCode,
Intent intent)
        {
             super.onActivityResult(requestCode, resultCode, intent);

             if (resultCode == RESULT_OK)
             {
                     Uri photoUri = intent.getData();
                     Log.d(TAG, should be adding a photo);
                     if (photoUri != null)
                     {

                             Log.d(TAG, photo uri is not blank);
                                 // do something with the content Uri
                             //TODO figure out why this does not work!!
                             Log.d(TAG, the photo URI is  + 
photoUri.getPath());
                         Drawable thePic = Drawable.createFromPath
(photoUri.getPath());
                         //thePic is Null
                                     if(thePic != null){
                             Log.d(TAG, the pic has loaded);
                                 myRecipe.addPic(thePic);
                                 ((RecipeAdapter)myListView.getAdapter
()).notifyDataSetChanged();

                         }
                     }
             }
        }

trying to get aimageand load it in to a drawable object. The Uri
that is returned seems logical

03-25 08:12:58.554: DEBUG/ConvertScaleScreen(174): the photo URI is /
external/images/media/1

but when i start up a shell with adb the file location or even the
root drive does not exitst, am I missing something here? should the be
a symbolic link on the file system?- 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: Dev Phone can not see paid apps using the 1.1 holiday release

2009-04-01 Thread Eric
The HTC 1.1 image and instructions that you have linked to is what I
originally put on the phone and still could not see any paid apps, even my
own which are not copy protected.  After seeing some chatter about this
holiday release, I tried that and still no luck.  I'm going back to the
HTC 1.1 image and will try that one again and see if it makes any
difference.




On Wed, Apr 1, 2009 at 12:40 AM, Dan Morrill morri...@google.com wrote:

 If you have the holiday devphone build, it's either an actual
 Google-employee holiday phone, or you've flashed a third-party system image
 on some other device.  The latter case is an unsupported configuration, and
 it would not surprise me at all if the Market client in that build simply
 pre-dates support for paid apps.

 If you install the official v1.1 system image for the ADP1
 http://www.htc.com/www/support/android/adp.html then the Market client
 should be able to access both paid and free apps, provided they are not
 copy-protected.  (ADP1s cannot access copy-protected applications.)

 - Dan


 On Tue, Mar 31, 2009 at 8:11 AM, Eric Schott ericwsch...@gmail.comwrote:


 Here's the specs:

 Model Number: Android Dev Phone 1
 Firmware Version: 1.1
 Kernel Version: 2.6.25-01845-g85d4f0d android-bu...@apa27 #27
 Build number: holiday_devphone_userdebug 1.1

 Phone is registered to my google account ok.

 I go to the Market and search for apps, see them fine.  I then pick
 Priced Items Only and all I get is No matching content in Android
 Market.

 Does any have their dev phone seeing priced apps?  I see lots of
 chatter about this topic, but no definitive answers.

 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: Android Physics Engine

2009-04-01 Thread Streets Of Boston

Two thumbs up!

It's fast, not superfast, but there are quite a number of balls in the
pit. I'm impressed.
If this code could get into the native system, into the firmware...

On Apr 1, 2:44 am, Anton socialhac...@gmail.com wrote:
     OK, for anyone interested in my simple physics demo, check out:

    http://www.antonstoys.com/android/BallPit.apk

     It's pretty basic, but it shows that you can do some amount of
 physics on the G-phone at a reasonable rate.  And as always, there are
 many improvements to be made.  :)

     -Anton

 On Mar 31, 2:12 pm, Anton socialhac...@gmail.com wrote:



      I'll definitely post the app tonight for you guys to check out (at
  work now).  I am an embedded systems programmer by trade.  But I do
  physics toys for fun and am just getting into Java/Android
  optimizations.  I will point out that optimizing for Java and
  optimizing for Android are very different.  As people have pointed out
  before, the key things to be careful with on Android are memory
  allocation and floating point math.  I've removed both of these from
  my physics loop.  I also found that function call overhead was quite
  large and had to manually inline all of my fixed point math code.  I
  think that with the correct spatial data structures I can get a couple
  hundred objects interacting.  I have a 2D rigid body physics engine
  that is currently all C++ (no exceptions or templates or RTTI or
  multiple inheritance) that I may port over as well.

      However, having said all of that, I think it may be the case that
  we will just have to wait until a native SDK is available to really
  write a top notch physics engine.  It's sort of the perfect example of
  a piece of code that doesn't need anything more than libc and JNI
  bindings.  And since you only call it a couple times per frame the JNI
  overhead would be well amortized.

      Anton

  On Mar 31, 9:17 am, mscwd01 mscw...@gmail.com wrote:

   Thanks for your feedback Shaun, I too unfortunately think a bespoke
   engine will need to be written for Android, which is a real pity as
   the iPhone has several physics engines which can easily handle
   hundreds of objects.

   Having said that Anton (2nd reply) has said he has an engine running,
   it would be nice to see a demo of this if that'd be possible?

   Clark, i'd definately host any .apk's on my own site, I wouldn't put
   it on the marketplace if it wasn't a finished app - do people
   actually do that?!

   I think i'll stay away from developing games with physics for the time
   being and concentrate on something else, I cant see it being feasible
   to include it any time soon which is a real pity.

   On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:

I am the author of simpull.

Sorry guys for the demo being out of whack for Simpull to the Core.
The version of PulpCore that I integrated simpull with did not support
Chrome, but you should be able to see it in IE, FF Safari.  It is nice
to take a look at that demo to get a feel for what the engine is
capable of, but the performance does not translate over to the fixed
point branch/version of simpull when running on Android.

I ran tests on both the emulator and the actual device and there was a
significant increase in performance because of the fixed point
implementation, but I got very frustrated that it still did not
support the amount of objects in a scene that I considered good for a
physics-based game.  It seemed to handle ~10 objects moving and
colliding OK.  It has been a while since I was playing with it, so I
do not really remember the exact number of objects or the frame rate.
I mostly remember being upset with it.

I am leaving the physics ideas for games out of the picture when
thinking Android for now.  Someone would have to write a ground up
engine with all the performance and memory concerns of Android in
mind, which was not the case with Simpull.I created it for
applets, then thought to port over to fixed-point for Android.  It
works well with small scenes, but certainly not the staple engine to
use in my opinion.

Also, Phys2D will not run worth a damn on Android.  I tried it and I
even went through some heavy performance tuning.  Garbage collection
is the major issue even after all I did.  I seriously doubt JBox2D
will run well either.  I'll stick to what I said earlier, a ground-up
solution by someone smarter than me is probably required.

On Mar 31, 9:49 am, admin.androidsl...@googlemail.com

admin.androidsl...@googlemail.com wrote:
 Not tried but if you can provide us with some example source code or
 put something on the market, I'm sure we could take a look.

 G1 performance is significantly faster than emulator, but there are
 limitations.

 Particularly with garbage collection and memory allocation on code
 that gets run continuously in loops, so I 

[android-developers] Re: Photo Picker

2009-04-01 Thread Bobbie

Any other ideas Boston?  Eclipse won't even let me compile that code
without putting it in debug mode, so there is something different in
that code.  Could you take another look?  Thanks!



On Mar 31, 5:57 pm, Bobbie bobbie.st...@gmail.com wrote:
 No, I have nothing in onPause().  I guess I'll just have to keep
 playing with it.

 Bobbie

 On Mar 31, 4:05 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

  Do you have code in your 'onPause()' method of your activity.
  If so, it looks like this code is blocking (never returning).

  On Mar 31, 11:39 am, Bobbie bobbie.st...@gmail.com wrote:

   When I choose the image, this is what Igetin the debug log:

   03-31 11:34:36.055: INFO/ActivityManager(55): Displayed activity
   com.android.camera/.ImageGallery2: 2455 ms
   03-31 11:34:39.525: VERBOSE/ImageGallery2(11143): /
   ImageBlockManager.onPause
   03-31 11:34:49.519: WARN/ActivityManager(55): Launch timeout has
   expired, giving up wake lock!

   On Mar 31, 10:24 am, Streets Of Boston flyingdutc...@gmail.com
   wrote:

Did you debug it?
Did yougeta null-pointer-exception?

(The code i gave you may have some issues: I just typed it in, without
using any IDE such as Eclipse. But it should give you a general idea
of what to do)

On Mar 30, 10:16 pm, Bobbie bobbie.st...@gmail.com wrote:

 I must have a bad phone or something...  Now the program force closes
 on me?  Here's what I have for onActivityResult.

 Cursor cursor = getContentResolver().query(intent.getData(), null,
 null, null, null);
 int idx = cursor.getColumnIndex(ImageColumns.DATA);
 String fname = cursor.getString(idx);

 On Mar 30, 9:08 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

  int idx = cursor.getColumnIndex(ImageColumn.DATA);
  String fname = cursor.getString(idx);

  On Mar 30, 7:45 pm, Bobbie bobbie.st...@gmail.com wrote:

   Wow... It's so simple, but still got an error... I got this:

   Cursor cursor = getContentResolver().query(datatoget, null, null,
   null, null);
   String fname = cursor.getString(ImageColumns.DATA);

   It won't let me run the code... getString is underlined in red 
   and
   it just wants me to change it to getLong but if I do that, it 
   just
   tells me to change it back to getString again... Am I doing
   something wrong here, or am I that bad at coding Android?

   On Mar 30, 4:37 pm, Streets Of Boston flyingdutc...@gmail.com 
   wrote:

This works as designed.

The getDataString() is the string of the contentUrithat refers 
to
theimage.
If you want the physical filename, do a 'Cursor cursor =
getContentResolver().query(intent.getData(), null, null, null, 
null)'
and query the column ImageColumns.DATA on the returned cursor.

Thecursor.getString(ImageColumns.DATA) will return the physical 
file-
   pathon your SC-card.

On Mar 30, 3:58 pm, Bobbie bobbie.st...@gmail.com wrote:

 I am having issues with some photo picker code that I am 
 using.  All
 of my pictures are stored on an SD card.  The SD card is 
 mounted and I
 can take pictures no problem.  However, when I select a 
 picture from
 the picker and output the location of the file, I shouldget:

 /sdcard/dcim/Camera/FILENAME.jpg

 But instead, Iget:

 content://media/external/images/media/7

 Any ideas what could be causing this?  Here is my code, a 
 button
 invokes the takePic() function:

 

     public void takePic() {
         Intent photoPickerIntent = new Intent
 (Intent.ACTION_GET_CONTENT);
         photoPickerIntent.setType(image/*);
         startActivityForResult(photoPickerIntent, 1);
     }

     @Override
     protected void onActivityResult(int i, int j, Intent 
 intent) {
         super.onActivityResult(i, j, intent);

         textview.append(intent.getDataString());
     }- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

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

2009-04-01 Thread Bobbie

Here's my debug errors:

04-01 10:01:33.318: ERROR/AndroidRuntime(30289): Uncaught handler:
thread main exiting due to uncaught exception
04-01 10:01:33.418: ERROR/AndroidRuntime(30289):
java.lang.RuntimeException: Failure delivering result ResultInfo
{who=null, request=1, result=-1, data=Intent { data=content://media/
external/images/media/2 }} to activity {com.app.name/
com.app.name.activity}:
android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread.deliverResults(ActivityThread.java:2840)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread.handleSendResult(ActivityThread.java:2882)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread.access$2300(ActivityThread.java:112)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.os.Handler.dispatchMessage(Handler.java:88)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.os.Looper.loop(Looper.java:123)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread.main(ActivityThread.java:3739)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
java.lang.reflect.Method.invokeNative(Native Method)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
java.lang.reflect.Method.invoke(Method.java:515)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
dalvik.system.NativeStart.main(Native Method)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): Caused by:
android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.database.AbstractCursor.checkPosition(AbstractCursor.java:559)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.database.AbstractWindowedCursor.checkPosition
(AbstractWindowedCursor.java:172)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.database.AbstractWindowedCursor.getString
(AbstractWindowedCursor.java:41)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.database.CursorWrapper.getString(CursorWrapper.java:138)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
com.indigital.IM911.IM911.onActivityResult(IM911.java:516)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.Activity.dispatchActivityResult(Activity.java:3415)
04-01 10:01:33.418: ERROR/AndroidRuntime(30289): at
android.app.ActivityThread.deliverResults(ActivityThread.java:2836)


On Apr 1, 9:52 am, Bobbie bobbie.st...@gmail.com wrote:
 Any other ideas Boston?  Eclipse won't even let me compile that code
 without putting it in debug mode, so there is something different in
 that code.  Could you take another look?  Thanks!

 On Mar 31, 5:57 pm, Bobbie bobbie.st...@gmail.com wrote:

  No, I have nothing in onPause().  I guess I'll just have to keep
  playing with it.

  Bobbie

  On Mar 31, 4:05 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

   Do you have code in your 'onPause()' method of your activity.
   If so, it looks like this code is blocking (never returning).

   On Mar 31, 11:39 am, Bobbie bobbie.st...@gmail.com wrote:

When I choose the image, this is what Igetin the debug log:

03-31 11:34:36.055: INFO/ActivityManager(55): Displayed activity
com.android.camera/.ImageGallery2: 2455 ms
03-31 11:34:39.525: VERBOSE/ImageGallery2(11143): /
ImageBlockManager.onPause
03-31 11:34:49.519: WARN/ActivityManager(55): Launch timeout has
expired, giving up wake lock!

On Mar 31, 10:24 am, Streets Of Boston flyingdutc...@gmail.com
wrote:

 Did you debug it?
 Did yougeta null-pointer-exception?

 (The code i gave you may have some issues: I just typed it in, without
 using any IDE such as Eclipse. But it should give you a general idea
 of what to do)

 On Mar 30, 10:16 pm, Bobbie bobbie.st...@gmail.com wrote:

  I must have a bad phone or something...  Now the program force 
  closes
  on me?  Here's what I have for onActivityResult.

  Cursor cursor = getContentResolver().query(intent.getData(), null,
  null, null, null);
  int idx = cursor.getColumnIndex(ImageColumns.DATA);
  String fname = cursor.getString(idx);

  On Mar 30, 9:08 pm, Streets Of Boston flyingdutc...@gmail.com 
  wrote:

   int idx = cursor.getColumnIndex(ImageColumn.DATA);
   String fname = cursor.getString(idx);

   On Mar 30, 7:45 pm, Bobbie bobbie.st...@gmail.com wrote:

Wow... It's so simple, but still got an error... I got this:


[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-04-01 Thread Tom

Try this:

Create a set of volatile variables (toPause, isPaused, toStop,
isStopped).

Outside the thread, in the methods mentioned previously, set or clear
the appropriate variables.
Inside the thread, be checking the appropriate variables to determine
if the thread needs to be paused or stopped.

Put the use of the variable within synchronized blocks.
Use wait and notify to avoid busy polling.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] OpenGL SurfaceView renders black on first start - works after orientation change

2009-04-01 Thread Ulrich Scheller

I have an Activity that was created based on the TriangleRenderer
example. It works flawlessly as a standalone project, but when I use
it as the tab of a tabhost there is a problem. At startup the whole
activity is just black - I can get touch events and do everything else
but it doesnt show anything. When I change the orientation (and
therefore recreate the activity) it all works well.

Maybe the problem comes from the View focus. My SurfaceView is not
focused when created inside of the tabhost. I tried to fiddle around
with the methods available in my onCreate() and onPostCreate(), but
couldnt find a way to get the SurfaceView focused.

The following sourcecode blocks in the guardedRun() method because
needToWait() is true because !mHasFocus is true. If I exclude the !
mHasFocus, it goes on but shows a black View anyways.

Do you have any idea why it does work after orientation change, but
not at the first startup?




The Activity looks quite simple:
===

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create our Preview view and set it as the content of our
// Activity
mGLSurfaceView = new GLSurfaceView(this);
mGLSurfaceView.setRenderer(new ContactsRenderer(this));
setContentView(mGLSurfaceView);
System.out.println(focused:  + mGLSurfaceView.isFocused() +
 focusable:  + mGLSurfaceView.isFocusable());
}

@Override
protected void onResume() {
// Ideally a game should implement onResume() and onPause()
// to take appropriate action when the activity looses focus
super.onResume();
mGLSurfaceView.onResume();
}

@Override
protected void onPause() {
// Ideally a game should implement onResume() and onPause()
// to take appropriate action when the activity looses focus
super.onPause();
mGLSurfaceView.onPause();
}



Thats my SurfaceView Class:
==
/**
 * An implementation of SurfaceView that uses the dedicated surface
for
 * displaying an OpenGL animation.  This allows the animation to run
in a
 * separate thread, without requiring that it be driven by the update
mechanism
 * of the view hierarchy.
 *
 * The application-specific rendering code is delegated to a
GLView.Renderer
 * instance.
 */
public class GLSurfaceView extends SurfaceView implements
SurfaceHolder.Callback {
private float touch_x = 0;
private long touch_time = 0;
private int touch_selected = 0;
private Context contactScreen;

public GLSurfaceView(Context context) {
super(context);
this.contactScreen = context;
init();
}

public GLSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

private void init() {
setFocusable(true);
// Install a SurfaceHolder.Callback so we get notified when
the
// underlying surface is created and destroyed
mHolder = getHolder();
mHolder.addCallback(this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}

public SurfaceHolder getSurfaceHolder() {
return mHolder;
}

public void setGLWrapper(GLWrapper glWrapper) {
mGLWrapper = glWrapper;
}

public void setRenderer(Renderer renderer) {
mGLThread = new GLThread(renderer);
mGLThread.start();
}

public void surfaceCreated(SurfaceHolder holder) {
mGLThread.surfaceCreated();
}

public void surfaceDestroyed(SurfaceHolder holder) {
// Surface will be destroyed when we return
mGLThread.surfaceDestroyed();
}

public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
// Surface size or format has changed. This should not happen
in this
// example.
mGLThread.onWindowResize(w, h);
}

/**
 * Inform the view that the activity is paused.
 */
public void onPause() {
mGLThread.onPause();
}

/**
 * Inform the view that the activity is resumed.
 */
public void onResume() {
mGLThread.onResume();
}

@Override
public boolean onTouchEvent(MotionEvent event) {
ContactsRenderer render = (ContactsRenderer) mGLThread.mRenderer;
if (event.getAction() == MotionEvent.ACTION_DOWN) {
touch_x = event.getX();
touch_time = System.currentTimeMillis();
touch_selected = render.getSelectedContact();
return true;
} else {
float diff = touch_x - event.getX();
long time_diff = System.currentTimeMillis() - touch_time;
if (event.getAction() == MotionEvent.ACTION_MOVE){
render.move(-diff/1000f);
touch_x  = event.getX();
return true;
} else if (event.getAction() == 

[android-developers] Re: *** Why 1 G1 can see Paid Apps in the Android Market and Another Not? ***

2009-04-01 Thread clark

Root-enabled G1s are still able to see copy-protected apps.  I think
it is just the ADP phones that the market detects, because my rooted
G1 is able to see copy-protected apps, and download them.  I have
verified this by looking in the app-private folder on the phone and
seeing that the app that I purhcased was there.


~clark

On Mar 31, 9:32 pm, Dan Morrill morri...@google.com wrote:
 This is not true.  Devices that are identified as root-enabled, whether an
 ADP1 or a rooted retail G1, cannot access copy-protected apps. They can
 still access both paid and free apps that are not copy-protected, however.

 - Dan

 On Tue, Mar 31, 2009 at 2:09 PM, Michael MacDonald 

 googlec...@antlersoft.com wrote:
   Developer phones can't see paid apps in the market.  This is because the
  root access available on the developer
  phones breaks the Market copy-protection model.

  The Market copy-protection model ignores that there are many consumer
  phones that have been rooted...

  Eric Schott wrote:

  I have a developers phone running: 1.1 specifically
  holiday_devphone_userdebug 1.1  Kernel version is: 2.6.25-01845-
  g85d4f0d android-bu...@apa27 #27

  and I can not see any paid apps.  I still see lots of chatter about
  some who can see paid apps and some who can not.  What the magic
  button to make this work?  :)

  On Mar 10, 11:14 am, Brodsky peter.brod...@gmail.com 
  peter.brod...@gmail.com wrote:

   I've got the same problem.  If Ican'tseepaidappsoff this dev
  phone, how do I get my money back for it?  No one ever told me it'd be
  crippled...

  On Feb 20, 4:19 pm, Michael Martin mi...@mm-agency.com 
  mi...@mm-agency.com wrote:

   *** Can anyone at Google explain why some G1s can seepaidappswhile
  otherscan’t? 

   I don’t believe this is a matter of an OTA updates but rather
  datacenter propagation thus it would depend on which Android Market
  datacenter the G1 is pinging.

   In my case I have 2 G1s (side by side) and 1 canseethepaidapps
  while the other doesn’t….could only assume they are both pinging the
  same DC.

   (I have already tried the reboot theory to no avail)

   Any formal explanation for this???

   Thank You,
  Michael Martinhttp://www.googleandblog.com/


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



[android-developers] Re: Display of SQLite database information in tabular format

2009-04-01 Thread Zhubham

Hi,

My intention is to display the record in tabular format on the
emulator. I intetnd to display the database table on the emulator very
much similar to the way your tool( OR any other tool) would display
it.

Any suggestions how i can do that.

Thanks in advance.

Best Regards,
Zhubham.

*
On Apr 1, 6:29 pm, Mark Murphy mmur...@commonsware.com wrote:
 Zhubham wrote:
  I am interested in knowing how can we display the SQLite database
  information in tabular format, the same way, as it is visible through
  the SQL reader (SQLite Database Browser).

  Are there any set of commands which help to achieve this??

 Pull the database off the device, using adb pull, DDMS, or the DDMS
 perspective in Eclipse. Then, use whatever tools you want (I'm fond of
 the SQLite Manager plugin for Firefox).

 If you modify the database, use adb push or DDMS to put it back on the
 device.

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

 Android App Developer Training:http://commonsware.com/training.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] Byte code format

2009-04-01 Thread Zhubham

Hi,

I am keen on understanding how the DVM works and finally what's the
format of the generated byte code. Can anyone please recommend a
weblink for this.

As such, i am looking for the size of Code Segment, Data Segment,
Stack, Heap. How can I find these details for any Android application
written by me??

Looking forward for your opinions and suggestions.

Thanks.

Best Regards,
Zhubham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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-discuss] Unused java hardware acceleration on the G1 (was Re: Android game developers desperately need optimised game engine example code ...)

2009-04-01 Thread clark

Is this even a topic for google's engineers?  The way I see it is it
would be up to the manufacturer of the hardware to decide whether to
implement the Java VM or Dalvik.  There is no guarantee that hardware
will have a processor that is optimized for java byte code, and
therefore should not be in the core android OS.


~clark

On Mar 31, 2:18 pm, Stoyan Damov stoyan.da...@gmail.com wrote:
 Dianne,

 I can't see why are you taking this personally.
 FWIW, you, Android engineers, are the only people we're getting *any*
 answers to all our non-development questions.

 Is it so hard to accept the fact that people can think that Google,
 the company, is for example bad or deaf, but at the same time think
 that some or many of its employees are great and responsive?
 For me, Google is deaf. You, Romain, JBQ, David, etc. (I don't want to
 miss someone, but will inevitably do so) are not.

 Now, that love is all around, do you have something to say about the
 original subject? ;)

 Cheers

 On Wed, Apr 1, 2009 at 12:05 AM, Dianne Hackborn hack...@android.com wrote:
  On Tue, Mar 31, 2009 at 12:42 PM, Stoyan Damov stoyan.da...@gmail.com
  wrote:

  If the answer is yes, I then expect to hear what was that Google
  couldn't agree on with Sun (although I don't expect to hear that from
  Google Android engineers, but like I've said many times, Google is
  f...@#ing DEAF, and you, Android engineers, are the only people who
  actually listen to us)?

  Congratulations, at this point I have stopped listening to you too.

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.


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



[android-developers] SystemProperties.get()/set()

2009-04-01 Thread Lawrence

Hi all,
In case of reading/setting properties defined in
/default.prop
/system/build.prop
/system/default.prop
/data/local.prop,
i am finding many source code in android release are using
SystemProperties.get()/set() for this purpose. But i am also finding
that SystemProperties is not published any more. I am really confused
about this. Anyone can kindly give me a clue on this?
Since SystemProperties is not exposed, could System.getProperty()/
setProperty() take its place?

Thanks,


Lawrrence


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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-discuss] Unused java hardware acceleration on the G1 (was Re: Android game developers desperately need optimised game engine example code ...)

2009-04-01 Thread Ecthelion

Google is not forced by Sun in any way. It's just that Sun requests
license fees for their JVM and that does not fit with Android being
planned by Google as a platform where the manufacturers have no
license fees to pay for.

On Mar 31, 8:42 pm, Stoyan Damov stoyan.da...@gmail.com wrote:
 If Google were not forced by Sun because of WHATEVER to NOT run java
 bytecode on the Android, would it be WAY WAY faster for games, apps,
 and the Android stack on top of Linux, which is also a Dalvik
 bytecode, because of the java hardware acceleration?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Unused java hardware acceleration on the G1 (was Re: Android game developers desperately need optimised game engine example code ...)

2009-04-01 Thread Ecthelion

This I cannot confirm. The C64 emulator Mobile C64 runs with AFAIK
10-15% of the original C64 speed on a G1 with its 528 MHz CPU. On my
Samsung SGH-i600, with a 624 MHz CPU, the J2ME variant ran at close to
100% of the original C64 speed. This is a factor of 6-10 faster
although the device's CPU is only 20% faster. So the Jazelle
advantages can be quite considerable, at least for some applications.

On Mar 31, 9:36 pm, thesquib thesq...@gmail.com wrote:
 Stoyan - the optimisation from the Jazelle is apparently not that good
 anyway, partially because a software JVM performs all sorts of
 optimisations on the fly.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: OpenGL SurfaceView renders black on first start - works after orientation change

2009-04-01 Thread Ulrich Scheller

I have solved it with an ugly hack. This is not a solution but a
workaround until I find a better way:

private GLSurfaceView mGLSurfaceView;
private static boolean firstCreate = true;

/*
 * Constructors
 */

/*
 * Methods
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create our Preview view and set it as the content of our
// Activity
mGLSurfaceView = new GLSurfaceView(this);
mGLSurfaceView.setRenderer(new ContactsRenderer(this));
setContentView(mGLSurfaceView);

if (firstCreate) {
setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
firstCreate = false;
}
}




On Apr 1, 4:10 pm, Ulrich Scheller ulrich.schel...@gmail.com wrote:
 I have an Activity that was created based on the TriangleRenderer
 example. It works flawlessly as a standalone project, but when I use
 it as the tab of a tabhost there is a problem. At startup the whole
 activity is just black - I can get touch events and do everything else
 but it doesnt show anything. When I change the orientation (and
 therefore recreate the activity) it all works well.

 Maybe the problem comes from the View focus. My SurfaceView is not
 focused when created inside of the tabhost. I tried to fiddle around
 with the methods available in my onCreate() and onPostCreate(), but
 couldnt find a way to get the SurfaceView focused.

 The following sourcecode blocks in the guardedRun() method because
 needToWait() is true because !mHasFocus is true. If I exclude the !
 mHasFocus, it goes on but shows a black View anyways.

 Do you have any idea why it does work after orientation change, but
 not at the first startup?

 The Activity looks quite simple:
 ===

     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         // Create our Preview view and set it as the content of our
         // Activity
         mGLSurfaceView = new GLSurfaceView(this);
         mGLSurfaceView.setRenderer(new ContactsRenderer(this));
         setContentView(mGLSurfaceView);
         System.out.println(focused:  + mGLSurfaceView.isFocused() +
  focusable:  + mGLSurfaceView.isFocusable());
     }

     @Override
     protected void onResume() {
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
         mGLSurfaceView.onResume();
     }

     @Override
     protected void onPause() {
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onPause();
         mGLSurfaceView.onPause();
     }

 Thats my SurfaceView Class:
 ==
 /**
  * An implementation of SurfaceView that uses the dedicated surface
 for
  * displaying an OpenGL animation.  This allows the animation to run
 in a
  * separate thread, without requiring that it be driven by the update
 mechanism
  * of the view hierarchy.
  *
  * The application-specific rendering code is delegated to a
 GLView.Renderer
  * instance.
  */
 public class GLSurfaceView extends SurfaceView implements
 SurfaceHolder.Callback {
     private float touch_x = 0;
         private long touch_time = 0;
         private int touch_selected = 0;
         private Context contactScreen;

         public GLSurfaceView(Context context) {
         super(context);
         this.contactScreen = context;
         init();
     }

     public GLSurfaceView(Context context, AttributeSet attrs) {
         super(context, attrs);
         init();
     }

     private void init() {
         setFocusable(true);
         // Install a SurfaceHolder.Callback so we get notified when
 the
         // underlying surface is created and destroyed
         mHolder = getHolder();
         mHolder.addCallback(this);
         mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
     }

     public SurfaceHolder getSurfaceHolder() {
         return mHolder;
     }

     public void setGLWrapper(GLWrapper glWrapper) {
         mGLWrapper = glWrapper;
     }

     public void setRenderer(Renderer renderer) {
         mGLThread = new GLThread(renderer);
         mGLThread.start();
     }

     public void surfaceCreated(SurfaceHolder holder) {
         mGLThread.surfaceCreated();
     }

     public void surfaceDestroyed(SurfaceHolder holder) {
         // Surface will be destroyed when we return
         mGLThread.surfaceDestroyed();
     }

     public void surfaceChanged(SurfaceHolder holder, int format, int
 w, int h) {
         // Surface size or format has changed. 

[android-developers] Re: *** Why 1 G1 can see Paid Apps in the Android Market and Another Not? ***

2009-04-01 Thread Stoyan Damov

Aha, so until rooted phones can't see copy-protected apps I don't see
any reasons to protect my app. If just 1 user can download and share
it with the world it is meaningless to waste twice the space on the
user's phone for nothing.

On Wed, Apr 1, 2009 at 5:15 PM, clark clarkd...@gmail.com wrote:

 Root-enabled G1s are still able to see copy-protected apps.  I think
 it is just the ADP phones that the market detects, because my rooted
 G1 is able to see copy-protected apps, and download them.  I have
 verified this by looking in the app-private folder on the phone and
 seeing that the app that I purhcased was there.


 ~clark

 On Mar 31, 9:32 pm, Dan Morrill morri...@google.com wrote:
 This is not true.  Devices that are identified as root-enabled, whether an
 ADP1 or a rooted retail G1, cannot access copy-protected apps. They can
 still access both paid and free apps that are not copy-protected, however.

 - Dan

 On Tue, Mar 31, 2009 at 2:09 PM, Michael MacDonald 

 googlec...@antlersoft.com wrote:
   Developer phones can't see paid apps in the market.  This is because the
  root access available on the developer
  phones breaks the Market copy-protection model.

  The Market copy-protection model ignores that there are many consumer
  phones that have been rooted...

  Eric Schott wrote:

  I have a developers phone running: 1.1 specifically
  holiday_devphone_userdebug 1.1  Kernel version is: 2.6.25-01845-
  g85d4f0d android-bu...@apa27 #27

  and I can not see any paid apps.  I still see lots of chatter about
  some who can see paid apps and some who can not.  What the magic
  button to make this work?  :)

  On Mar 10, 11:14 am, Brodsky peter.brod...@gmail.com 
  peter.brod...@gmail.com wrote:

   I've got the same problem.  If Ican'tseepaidappsoff this dev
  phone, how do I get my money back for it?  No one ever told me it'd be
  crippled...

  On Feb 20, 4:19 pm, Michael Martin mi...@mm-agency.com 
  mi...@mm-agency.com wrote:

   *** Can anyone at Google explain why some G1s can seepaidappswhile
  otherscan’t? 

   I don’t believe this is a matter of an OTA updates but rather
  datacenter propagation thus it would depend on which Android Market
  datacenter the G1 is pinging.

   In my case I have 2 G1s (side by side) and 1 canseethepaidapps
  while the other doesn’t….could only assume they are both pinging the
  same DC.

   (I have already tried the reboot theory to no avail)

   Any formal explanation for this???

   Thank You,
  Michael Martinhttp://www.googleandblog.com/


 


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



[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-04-01 Thread Streets Of Boston

Do *not* use volatile variables. They are not guaranteed to be atomic.
It's just a compiler hint.

Instead, use synchronized blocks:

class MyThread extends Thread {
  boolean mPaused;
  boolean mStopped;

  public void run() {
...
...
mStopped = false;
mPaused = true or false, depends on your application.
while (!mStopped) {
  if (waitForResume())
break;

  // do your thing.
  ...
}
  }

  public void stopThread() {
syncrhonized(this) {
  mPaused = false;
  mStopped = true;
  this.notify();
}
// optionally, code an extra 'join()' statement if the caller
needs
// to wait until the thread has completely finished.
  }

  public void pauseThread() {
syncrhonized(this) {
  mPaused = true;
  this.notify();
}
  }

  public void resumeThread() {
syncrhonized(this) {
  mPaused = false;
  this.notify();
}
  }

  private boolean waitForResume() {
synchronized(this) {
  if (mStopped)
return false;

  while (mPaused) {
this.wait();
  }

  if (mStopped)
return false;
}
  }
  ...
  ...
}


Then code that needs to control your thread, just call
myThread.pauseThread() or myThread.resumeThread() and stops the thread
entirely by calling myThread.stopThread();

Note: you could replace 'this' with another object to use for
synchronization.

On Apr 1, 10:06 am, Tom tom_a_h...@yahoo.com wrote:
 Try this:

 Create a set of volatile variables (toPause, isPaused, toStop,
 isStopped).

 Outside the thread, in the methods mentioned previously, set or clear
 the appropriate variables.
 Inside the thread, be checking the appropriate variables to determine
 if the thread needs to be paused or stopped.

 Put the use of the variable within synchronized blocks.
 Use wait and notify to avoid busy polling.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 make a ListView adapt to dynamic element sizes?

2009-04-01 Thread Romain Guy

ListView supports the WRAP_CONTENT height mode but it is really not
meant for that. First of all, having a ListView in WRAP_CONTENT is
very costly in terms of layout. It is also meaningless. What does
WRAP_CONTENT mean for a ListView since the goal of ListView is to
virtualize its children? Because of this, ListView just does not
support growing or shrinking when you modify its adapter.

You should simply use FILL_PARENT for your ListView. And you may find
the last divider ugly but *every* ListView in the system behaves that
way. Your WRAP_CONTENT ListView just looks different from the rest of
the system for absolutely no good reason.

Consistency matters.

On Wed, Apr 1, 2009 at 6:40 AM, Streets Of Boston
flyingdutc...@gmail.com wrote:

 If your list-view uses a (list-)adapter (or a subclass of this), did
 you try to call notifyDataSetInvalidated() on the adapter?
 This will cause your adapter's getView(int position, View convertView,
 ViewGroup parent) to be called again and you can handle your changed
 list-item in there.

 On Apr 1, 5:24 am, matthias m.kaepp...@googlemail.com wrote:
 Well, I found a really ugly workaround. That workaround is based on my
 observation that the problem described does only occur if the
 ListView's layout height is set to WRAP_CONTENT. So, since I use a
 custom list adapter, I now call listView.getLayoutParams().height =
 LayoutParams.FILL_PARENT whenever a text view is about to be
 expanded... the reason I do not statically set its height to
 FILL_PARENT is because then it will draw line separators below the
 last element, which looks ugly if it doesn't expand to the bottom of
 the screen.

 It works... but, yuck!
 




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

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



[android-developers] Discussion on localizing-android-apps-draft

2009-04-01 Thread Matthias

Xavier,

very helpful! thanks for sharing, works perfectly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Fling on ListView

2009-04-01 Thread Romain Guy

 As to the it was meant to be part of the UI design, I really wonder
 why practically none of the apps shipped with Android use gestures
 then (I mean, apart from scrolling up or down of course)?

We use gestures for scrolling: ListView, GridView, Gallery, MapView,
WebView, ScrollView. Calendar uses gestures to navigate between
months/weeks/days. Calculator uses gestures to switch between the
simple and complex operations. Etc.

Using gestures to navigate within an app has a HUGE problem: it is
totally undiscoverable.

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

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



[android-developers] Re: can i add a click listener to a drawable?

2009-04-01 Thread Marco Nelissen
You might want to look at the source code for the camera app, which uses a
SurfaceView for its preview, and puts controls on top of it.



On Tue, Mar 31, 2009 at 9:21 PM, Josh Dobbs joshdo...@gmail.com wrote:

 I am using in ImageButton Now and am using the following code to ad the
 button to the surfaceview..

 myImgTest
 .setBackgroundDrawable(mBalloon1);

 myImgTest.draw(canvas);
 This seems to work as I do not get any errors however i don't see the
 button. What is the proper way to add the button to the surface view and how
 do I specify cordinates?




 On Sun, Mar 29, 2009 at 11:41 PM, Marco Nelissen marc...@android.comwrote:


 Your Drawable itself is not part of the UI, but is drawn onto
 something that is part of your UI. Therefore, you should attach your
 listener to the UI object that displays the Drawable.
 See also
 http://developer.android.com/reference/android/graphics/drawable/Drawable.html
 ,
 which says Unlike a View, a Drawable does not have any facility to
 receive events or otherwise interact with the user. 



 On Sun, Mar 29, 2009 at 10:24 PM, Josh joshdo...@gmail.com wrote:
 
  I currently have a drawable and i need to know when it's clicked. Is
  there a way to add an event listener to a drawable?
 
  I realize that there may be a better control to use for me needs so I
  tried ImageButton but Im a bit confused on how to position the
  ImageButton. For example whe i position the drawable i just use
  setBounds. Is there a way to specify the x and y coordinates for an
  image button?
  
 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Scroll and drag a TileView widget around by finger / touch

2009-04-01 Thread Streets Of Boston

What about using a ScrollView as your container view?:

LinearLayout
  |--ScrollView
|-- SkyView


On Apr 1, 11:49 am, acrosser toned...@gmail.com wrote:
 Surely this hasn't stumped the group of brilliant Android
 developers! :-) Is there any tutorial or reference page someone can
 point me to?

 On Mar 31, 9:10 am, acrosser toned...@gmail.com wrote:



  In the Android API examples there is a Snake game. This game uses a
  class
  called SnakeView, which inherits from TileView.

  I am doing something very similar to this. I am inheriting from
  TileView to create a class (SkyView), which will become a square board
  for a board game (similar to the board for Checkers).

  However, I would like for my game board to be 400x400 pixels in size,
  which will be bigger than the screens of some Android devices (such as
  the G1). And I would like for the user to be able to freely scroll and
  drag the board around with their finger (both horizontal and vertical
  scrolling/dragging).

  Can someone please point me in the correct direction for implementing
  this? The board must be no smaller than 400x400px in size. And however
  much of the board that can be displayed at once on the screen, should
  be displayed
  at once.

  Should I wrap my SkyView widget in an AbsoluteLayout and use
  Scrollbars? If so, what Scrollbar properties to I need to use? I
  played around with Scrollbars in both directions but couldn't get it
  to work. Is there another view layout I should put it inside? Code
  examples would be nice! Thanks for the help. I am at a loss with this
  one.- Hide quoted text -

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



[android-developers] How to handle HTTP/1.1 416 Requested Range Not Satisfiable

2009-04-01 Thread manoj

Hi friends,

In my app, I am getting this response. I dont know how to handle this.

Please can some one suggest me.

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



[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-04-01 Thread kbeal10

Thank you, I will try to implement this when I have time. I now
understand where my confusion was stemming from. I was under the
impression that each time the CupView Activity was resumed, a new
CupView object was created thus creating a new CupThread. However I
now see that is not the case, the CupView object is not destroyed and
recreated, thus no new thread to call start() on.

On Apr 1, 11:34 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 Do *not* use volatile variables. They are not guaranteed to be atomic.
 It's just a compiler hint.

 Instead, use synchronized blocks:

 class MyThread extends Thread {
   boolean mPaused;
   boolean mStopped;

   public void run() {
 ...
 ...
 mStopped = false;
 mPaused = true or false, depends on your application.
 while (!mStopped) {
   if (waitForResume())
 break;

   // do your thing.
   ...
 }
   }

   public void stopThread() {
 syncrhonized(this) {
   mPaused = false;
   mStopped = true;
   this.notify();
 }
 // optionally, code an extra 'join()' statement if the caller
 needs
 // to wait until the thread has completely finished.
   }

   public void pauseThread() {
 syncrhonized(this) {
   mPaused = true;
   this.notify();
 }
   }

   public void resumeThread() {
 syncrhonized(this) {
   mPaused = false;
   this.notify();
 }
   }

   private boolean waitForResume() {
 synchronized(this) {
   if (mStopped)
 return false;

   while (mPaused) {
 this.wait();
   }

   if (mStopped)
 return false;
 }
   }
   ...
   ...

 }

 Then code that needs to control your thread, just call
 myThread.pauseThread() or myThread.resumeThread() and stops the thread
 entirely by calling myThread.stopThread();

 Note: you could replace 'this' with another object to use for
 synchronization.

 On Apr 1, 10:06 am, Tom tom_a_h...@yahoo.com wrote:

  Try this:

  Create a set of volatile variables (toPause, isPaused, toStop,
  isStopped).

  Outside the thread, in the methods mentioned previously, set or clear
  the appropriate variables.
  Inside the thread, be checking the appropriate variables to determine
  if the thread needs to be paused or stopped.

  Put the use of the variable within synchronized blocks.
  Use wait and notify to avoid busy polling.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 handle HTTP/1.1 416 Requested Range Not Satisfiable

2009-04-01 Thread Mark Murphy

manoj wrote:
 In my app, I am getting this response. I dont know how to handle this.

That would probably be best answered by whoever is running the server
you are trying to download data from.

If you can give us more information, such as which HTTP client library
you are using, we might be able to give you more ideas or other places
to learn more.

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

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

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



[android-developers] Re: How to handle HTTP/1.1 416 Requested Range Not Satisfiable

2009-04-01 Thread manoj

Actually, I am trying to request some data which is available at
remote site.

On Apr 1, 8:57 pm, manoj manojkumar.m...@gmail.com wrote:
 Hi friends,

 In my app, I am getting this response. I dont know how to handle this.

 Please can some one suggest me.

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



[android-developers] Re: How to handle HTTP/1.1 416 Requested Range Not Satisfiable

2009-04-01 Thread manoj

Actually I am implementing socket connection, with some range headers.
For some urls I am getting the nice response (206), but for some urls
I am getting this response.

On Apr 1, 9:05 pm, Mark Murphy mmur...@commonsware.com wrote:
 manoj wrote:
  In my app, I am getting this response. I dont know how to handle this.

 That would probably be best answered by whoever is running the server
 you are trying to download data from.

 If you can give us more information, such as which HTTP client library
 you are using, we might be able to give you more ideas or other places
 to learn more.

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

 _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Use native C/C++ libraries

2009-04-01 Thread ambrosehua

Yes.
The C lib is bionic which didnot provide  exactly the  same functions
as  glibc!

On 4月1日, 下午4时47分, gunar adrian.proco...@gmail.com wrote:
 Hi!

 Is it possible to use a native C/C++ library? If so, are there any
 restrictions for those libraries to be used?

 Br,
 gunar

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

2009-04-01 Thread l hx
today i get the master code. when I  compile ALSA, and it says
external/alsa-lib/src/shmarea.c:27:21: error: sys/shm.h: No such file or
directory
what should I do now? now i copy the shm.h from the former version android.
can be ok?

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

2009-04-01 Thread wacamoe

Hello all,
   I have noticed in my application(s) that after a call to
Activity.finish() that the static variables that I declared in my
classes still hold the values that they were changed to during the
activity's life cycle. Upon the re-launch of the activity, the program
does not re-instantiate the variables as declared or set them to the
default java behavior. Is there something that I can do to cause this
to happen, other than re-setting every static variable in my
application?

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

2009-04-01 Thread sirius

Hi,
I read in the documentation for SQLite that there should be some core
functions and aggregate functions available, but I can't seem to use
them in my code.. Can anyone help?

Here's the documentation i read:
 http://www.sqlite.org/lang_aggfunc.html
 http://www.sqlite.org/lang_corefunc.html

There is for example the function count() but how do I use it?
I have tried to use it as stated below, but none of the functions in
the documentation is available that way (i.e when I type db. the
list that shows in Eclipse documentation doesn't include any of the
functions from the SQLite doc except from execSQL):


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DbAdapter{
...
 private SQLiteDatabase db;
...

public Cursor getRow(long rowId) throws SQLException {
Cursor c =
db.query(true, TABLE_NAME, new String[] {
KEY_COL1,
 
KEY_COL2},
KEY_ROWID + = + rowId,
null,
null,
null,
null,
null);
int numberOfRows = c.count(); //This doen't work!
if (c != null) {
c.moveToFirst();
}
return c;
}

}


Thankful for any help!

PS. I haven't worked with databases before, so please keep that in
mind when you answer me. DS.

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

2009-04-01 Thread Bin Chen

I am a C programmer before, and I am looking into android source code
right now, some JAVA syntax is confusing, I am not sure whether or not
it's android related, see:

@Override
protected void onDraw(Canvas canvas) {
synchronized (this) {
if (mBitmap != null) {
final Paint paint = mPaint;
final Path path = mPath;
final int outer = 0xFFC0C0C0;
final int inner = 0xFFff7010;

1) What's the meaning of Override? Is it ommitable?
2) What does the synchronized mean?

Thanks.
Bin

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



[android-developers] android.provider.MediaStore.RECORD_SOUND

2009-04-01 Thread estivenrpo

Hi,

I try to use the android.provider.MediaStore.RECORD_SOUND intent and
it work perfect, the problem that i have is whit the uri when the file
is saved...  the file is saved on /sdcard but i don't know the path or
the uri of the file...   I try to send a uri through the putExtra but
it did not work

Intent i = new Intent(android.provider.MediaStore.RECORD_SOUND);
i.putExtra(output, Uri.parse(file:///sdcard/audio));
startActivityForResult(i, 0);


@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
Log.d(tiferson, Entro a onActivityResult);
switch (requestCode) {
case 0:
if (resultCode == RESULT_OK) {
Log.d(tiferson, on the result ok...);
String s = data.getAction();
Log.d(tiferson, despues del 
data.getExtras...);
if(s == null) {
Log.d(tiferson, don't return 
getAction);
}
Bundle b = data.getExtras();
if(b == null) {
Log.d(tiferson, don't return 
getExtras);
}
  }

And on the logcat i can see:  don't return getAction and don't
return getExtras.

can i  know the path where the file is saved or send the path for it?

thanks in advance

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



[android-developers] Re: Android Physics Engine

2009-04-01 Thread Daniel Sargeant
It does look smooth on the G1.  The use of accelerometers is quite cool.
Good job on minimizing the GC jitters. The screen has horrible ghosting with
green to grey transitions, however, which mars the smooth framerate a bit.
Red balls would probably reduce that.

-Daniel Sargeant

On Wed, Apr 1, 2009 at 7:04 AM, mscwd01 mscw...@gmail.com wrote:


 Thanks for the demo Anton,

 It certainly runs much smoother than the Phys2D and JBox2D engines I
 have tried and you have more objects being simulated - so you must
 have done something right ;)

 I would expect it to run 2-3 times faster on an actual device too from
 what I have read.

 Once you have finished off the improvements do you have any plans to
 release it?

 Thanks

 On Apr 1, 7:44 am, Anton socialhac...@gmail.com wrote:
  OK, for anyone interested in my simple physics demo, check out:
 
 http://www.antonstoys.com/android/BallPit.apk
 
  It's pretty basic, but it shows that you can do some amount of
  physics on the G-phone at a reasonable rate.  And as always, there are
  many improvements to be made.  :)
 
  -Anton
 
  On Mar 31, 2:12 pm, Anton socialhac...@gmail.com wrote:
 
   I'll definitely post the app tonight for you guys to check out (at
   work now).  I am an embedded systems programmer by trade.  But I do
   physics toys for fun and am just getting into Java/Android
   optimizations.  I will point out that optimizing for Java and
   optimizing for Android are very different.  As people have pointed out
   before, the key things to be careful with on Android are memory
   allocation and floating point math.  I've removed both of these from
   my physics loop.  I also found that function call overhead was quite
   large and had to manually inline all of my fixed point math code.  I
   think that with the correct spatial data structures I can get a couple
   hundred objects interacting.  I have a 2D rigid body physics engine
   that is currently all C++ (no exceptions or templates or RTTI or
   multiple inheritance) that I may port over as well.
 
   However, having said all of that, I think it may be the case that
   we will just have to wait until a native SDK is available to really
   write a top notch physics engine.  It's sort of the perfect example of
   a piece of code that doesn't need anything more than libc and JNI
   bindings.  And since you only call it a couple times per frame the JNI
   overhead would be well amortized.
 
   Anton
 
   On Mar 31, 9:17 am, mscwd01 mscw...@gmail.com wrote:
 
Thanks for your feedback Shaun, I too unfortunately think a bespoke
engine will need to be written for Android, which is a real pity as
the iPhone has several physics engines which can easily handle
hundreds of objects.
 
Having said that Anton (2nd reply) has said he has an engine running,
it would be nice to see a demo of this if that'd be possible?
 
Clark, i'd definately host any .apk's on my own site, I wouldn't put
it on the marketplace if it wasn't a finished app - do people
actually do that?!
 
I think i'll stay away from developing games with physics for the
 time
being and concentrate on something else, I cant see it being feasible
to include it any time soon which is a real pity.
 
On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:
 
 I am the author of simpull.
 
 Sorry guys for the demo being out of whack for Simpull to the Core.
 The version of PulpCore that I integrated simpull with did not
 support
 Chrome, but you should be able to see it in IE, FF Safari.  It is
 nice
 to take a look at that demo to get a feel for what the engine is
 capable of, but the performance does not translate over to the
 fixed
 point branch/version of simpull when running on Android.
 
 I ran tests on both the emulator and the actual device and there
 was a
 significant increase in performance because of the fixed point
 implementation, but I got very frustrated that it still did not
 support the amount of objects in a scene that I considered good for
 a
 physics-based game.  It seemed to handle ~10 objects moving and
 colliding OK.  It has been a while since I was playing with it, so
 I
 do not really remember the exact number of objects or the frame
 rate.
 I mostly remember being upset with it.
 
 I am leaving the physics ideas for games out of the picture when
 thinking Android for now.  Someone would have to write a ground up
 engine with all the performance and memory concerns of Android in
 mind, which was not the case with Simpull.I created it for
 applets, then thought to port over to fixed-point for Android.  It
 works well with small scenes, but certainly not the staple engine
 to
 use in my opinion.
 
 Also, Phys2D will not run worth a damn on Android.  I tried it and
 I
 even went through some heavy performance tuning.  Garbage
 collection
 is the 

[android-developers] Which android's version can support file transfer through bluetooth?

2009-04-01 Thread Kelly Mao

Which android's version can support file transfer through bluetooth?

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

2009-04-01 Thread Google_Android_discussion

Hi,

Is it possible to alter the string values(in resources) in APK after
creating it.

Br,
Vikram

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

2009-04-01 Thread lkelemen

Hello everyone,

I was also disappointed with jbox2d's performance so I checked APE
(Actionscript Physics Engine) from http://www.cove.org/ape/ .
It was converted to java (http://www.cove.org/ape/java_ape.zip) so I
started to convert the java version to Android.

The performance is quite OK for 10-20 objects at the first start of
the app but if you exit with the back key and restart it form the
installed copy
(either in the emulator or on the dev phone) then it gets slower and
slower with each start. If you restart it from the emulator (by
reinstalling it) then it is faster again.
Neither the pressed keys are not working (probably it is because of my
poor Android programming knowledge).

Here is a zipped Android project of it. Please experiment with it and
send results to here i.e. is it slow for you also after re-re-re-..
staring?
www.kotiposti.net/lkelemen/android/testape2d.zip

thanks
Lajos Kelemen


On Mar 31, 9:26 pm, shaun shashepp...@gmail.com wrote:
 I started going down the path of Object pooling.  It seemed the only
 solution when taking an existing engine and making work on a resource
 constrained system like Android on a phone.  Determining the strategy
 for returning objects to the pool proved quite tough for me.  I have
 no doubt there are some experts on embedded systems programming with
 tons of experience with object pooling.  We just would be too lucky if
 that person(s) was also experienced with Java, physics engines and had
 a passion for open source and games!  Is that too much to ask?  LOL!!

 On Mar 31, 12:17 pm, mscwd01 mscw...@gmail.com wrote:

  Thanks for your feedback Shaun, I too unfortunately think a bespoke
  engine will need to be written for Android, which is a real pity as
  the iPhone has several physics engines which can easily handle
  hundreds of objects.

  Having said that Anton (2nd reply) has said he has an engine running,
  it would be nice to see a demo of this if that'd be possible?

  Clark, i'd definately host any .apk's on my own site, I wouldn't put
  it on the marketplace if it wasn't a finished app - do people
  actually do that?!

  I think i'll stay away from developing games with physics for the time
  being and concentrate on something else, I cant see it being feasible
  to include it any time soon which is a real pity.

  On Mar 31, 3:28 pm, shaun shashepp...@gmail.com wrote:

   I am the author ofsimpull.

   Sorry guys for the demo being out of whack forSimpullto the Core.
   The version of PulpCore that I integratedsimpullwith did not support
   Chrome, but you should be able to see it in IE, FF Safari.  It is nice
   to take a look at that demo to get a feel for what the engine is
   capable of, but the performance does not translate over to the fixed
   point branch/version ofsimpullwhen running on Android.

   I ran tests on both the emulator and the actual device and there was a
   significant increase in performance because of the fixed point
   implementation, but I got very frustrated that it still did not
   support the amount of objects in a scene that I considered good for a
   physics-based game.  It seemed to handle ~10 objects moving and
   colliding OK.  It has been a while since I was playing with it, so I
   do not really remember the exact number of objects or the frame rate.
   I mostly remember being upset with it.

   I am leaving the physics ideas for games out of the picture when
   thinking Android for now.  Someone would have to write a ground up
   engine with all the performance and memory concerns of Android in
   mind, which was not the case withSimpull.I created it for
   applets, then thought to port over to fixed-point for Android.  It
   works well with small scenes, but certainly not the staple engine to
   use in my opinion.

   Also, Phys2D will not run worth a damn on Android.  I tried it and I
   even went through some heavy performance tuning.  Garbage collection
   is the major issue even after all I did.  I seriously doubt JBox2D
   will run well either.  I'll stick to what I said earlier, a ground-up
   solution by someone smarter than me is probably required.

   On Mar 31, 9:49 am, admin.androidsl...@googlemail.com

   admin.androidsl...@googlemail.com wrote:
Not tried but if you can provide us with some example source code or
put something on the market, I'm sure we could take a look.

G1 performance is significantly faster than emulator, but there are
limitations.

Particularly with garbage collection and memory allocation on code
that gets run continuously in loops, so I don't know how optimised
these physics engines are for this purpose.

Would be interesting to find out though.

On Mar 31, 12:52 pm, mscwd01 mscw...@gmail.com wrote:

 Oh I forgot to re-ask...

 Has anyone tested Phys2D or JBox2D on an actual device to see if they
 run better than on the emulator?

 I have a feeling the performance will better on a G1 than the emulator
 for 

[android-developers] Signing Problem of an APK

2009-04-01 Thread androch...@gmail.com

Hi

i try to sign my apk.. i exportet it unsigned.. created my keys and
when i start now jarsigner i get:

I get the following Error  .. what can i do??

Enter Passphrase for keystore:
Exception in thread main java.util.zip.ZipError: jzentry == 0,
 jzfile = 34283992,
 total = 22,
 name = mydays04.apk,
 i = 1,
 message = null
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:321)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:299)
at sun.security.tools.JarSigner.getManifestFile(JarSigner.java:
1554)
at sun.security.tools.JarSigner.signJar(JarSigner.java:892)
at sun.security.tools.JarSigner.run(JarSigner.java:203)
at sun.security.tools.JarSigner.main(JarSigner.java:74)

greets
chris

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

2009-04-01 Thread l hx
Hi.
 today i get the newest code and make it .but when i mksdcard, and mount
it as same as i did before. but now i can not acces sd card int the emulate.
who know why?

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

2009-04-01 Thread BJP

I would like to write a file to the SD card from my application, but
the following code throws an IOException when debugged on a T-Mobile
G1:

String p = Environment.getExternalStorageDirectory() + /log.txt;
File recfile = new File(p);
recfile.createNewFile();

The last line throws an IOException with detailMessage = Cannot
create: /sdcard/log.txt.  The MOUNT_UNMOUNT_FILESYSTEMS permission is
set in the manifest.  And yes, I really do want to write to the SD
card; I don't want to use the logging features Android includes for
this particular application.  The Android documentation does not seem
to give any specifics on how one might write files to removable
storage in Data Storage under Framework Topics.  What am I doing
wrong, or where can I read more about this topic?

Thanks,
Ben

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

2009-04-01 Thread Alexey

I think you have to get WakeLock to avoid your media stop when phone
is going to sleep.
Try to use setWakeMode() method of MediaPlayer or if it won't help for
some reason, you can use PowerManager/WakeLock classes directly.

On 1 апр, 04:35, Eric M. Burke burke.e...@gmail.com wrote:
 I have an Activity that plays a brief OGG pop sound effect when
 bubbles pop. To keep it fast and to ensure I can play several pops, I
 create four MediaPlayer instances. I synchronize access to a pool of
 instances, so I can play up to four pops at once. Once a sound
 completes, I call seekTo(0) and return the MediaPlayer instance to my
 pool.

 Here is a rough sketch of the code:

 // when the activity resumes...
 for (int i=0; i4; i++) {
   MediaPlayer mp = MediaPlayer.create(context, R.raw.pop);
   mp.setOnCompletionListener(this);
   mp.setVolume(1f, 1f);
   players.add(mp); // put into a pool of available players

 }

 // when a bubble pops...
 MediaPlayer mp = ...get player instance from the pool
 if (mp != null) {
   mp.start(); // works! plays the pop sound

 }

 // implement the OnCompletionListener interface
 public void onCompletion(MediaPlayer mp) {
   // seek to the start so I can play the sound fast the next time
   mp.seekTo(0);
   return the MediaPlayer to the pool

 }

 Here is the problem. The pops all work so long as my game is active.
 But if I let it sit there for just a few seconds, I see this in the
 LogCat console: (on my G1 phone)

 AudioHardwareMSM72xx Going to standby

 Once this happens, the next several calls to MediaPlayer's start()
 method play nothing...but they do cause the audio hardware to wake up
 again, so then my sounds eventually (after a few seconds) start
 playing again.

 My question is, how do I prevent the AudioHardwareMSM72xx from going
 to standby mode while my Activity is active?

 One hacky idea...I could loop a continuous sound at extremely low
 volume level in another MediaPlayer instance to force it to stay
 awake. That's not appealing to me.

 Ideas?

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



[android-developers] Static Variable Instantiation

2009-04-01 Thread wacamoe

Hello all,
  I have noticed in my application(s) that after a call to
Activity.finish() that the static variables that I declared in my
classes still hold the values that they were changed to during the
activity's life cycle. Upon the re-launch of the activity, the program
does not re-instantiate the variables as declared or set them to the
default java behavior. Is there something that I can do to cause this
to happen, other than re-setting every static variable in my
application?

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

2009-04-01 Thread reck.wh...@gmail.com

Hello,

Does anyone know how to add email accounts to the default email
application programatically?


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] Some questions about Bluetooth A2DP.

2009-04-01 Thread Kelly Mao

I have got the code of Android 1.5,But i haven't downloaded in the
phone.
During read the code,I have some question about the A2DP.
1) The bluetooth earphone have connected with the phone,How does it
switch to A2DP channel when we play mp3 ? Auto-switch or Depending on
events from application?
2) If we are enjoying the music at that time have a incoming call,
What does it work in this situation?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Help! Process down after loadlibrary in Service

2009-04-01 Thread ambrosehua

It seems that the process(26719) shut down, rather than the service
(26726);
Do you mean whether  the service which loaded the .so shut down or
after service loaded .so, the process(26719) which maybe use the
service got killed?

On 4月1日, 下午4时32分, herain herainw...@gmail.com wrote:
 I need to load a .so library in my Service onCreate method, but the
 process just down after System.load. On the other hand, the same code
 can work in Activity.
 Are there some differences between activity and service in the way of
 load .so file.

 My code:
 class AisoundService extends Service{
 @Override
 public void onCreate() {
 Log.d(TAG,  TestService.onCreate);
 String libFile = /data/nativelib/libAisound4.so;
 Log.d(TAG, Trying to load +libFile);
 System.load(libFile);
 Log.d(TAG, Load +libFile+ Succes);
 }

 }

 This is Logcat record:
 04-01 07:57:25.761: DEBUG/AisoundService(26726): 
 TestService.onCreate
 04-01 07:57:25.771: DEBUG/AisoundService(26726): Trying to load /data/
 nativelib/libAisound4.so
 04-01 07:57:25.771: DEBUG/dalvikvm(26726): Trying to load lib /data/
 nativelib/libAisound4.so 0x42fc5230
 04-01 07:57:25.781: DEBUG/dalvikvm(26726): Added shared lib /data/
 nativelib/libAisound4.so 0x42fc5230
 04-01 07:57:25.901: INFO/DEBUG(26719): *** *** *** *** *** *** *** ***
 *** *** *** *** *** *** *** ***
 04-01 07:57:25.901: INFO/DEBUG(26719): Build fingerprint: 'tmobile/
 kila/dream/trout:1.1/PLAT-RC33/126986:user/ota-rel-keys,release-keys'
 04-01 07:57:25.901: INFO/DEBUG(26719): pid: 26726, tid: 26726  
 com.iflytek.service 
 04-01 07:57:25.901: INFO/DEBUG(26719): signal 11 (SIGSEGV), fault addr
 0018
 04-01 07:57:25.901: INFO/DEBUG(26719):  r0   r1 ad0665f0  r2
 fffee5cc  r3 c33578a5
 04-01 07:57:25.901: INFO/DEBUG(26719):  r4 802cc814  r5 ad07edf8  r6
   r7 802cc7e0

 Thanks for any help!

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



[android-developers] How to get the current webpage title and url

2009-04-01 Thread Rain

I want to use the webview's getTitle() and getUrl() to get the current
webpage title and url,but i don't know how to do...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] For Bluetooth File Transfer What I can do?

2009-04-01 Thread Kelly Mao

Android 1.0 can't support file transfer.If I want to do by myself what
I can do?
It seems don't have OBEX protocol.
who knows? Please give me reply.
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: How to run apk file on SDcard?

2009-04-01 Thread Fred Grott(shareme)

not possible

Stephen Le wrote:
 Hi all,
 How to run one or more apk programmess base on Emulator's SDcard?
 Thanks!
 --
 Sincerely!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: *** Why 1 G1 can see Paid Apps in the Android Market and Another Not? ***

2009-04-01 Thread Joseph Arceneaux
I read somewhere that Google forbids the availability of paid apps to
[unlocked] developer phones.  It's very frustrating.  Also, it seems that
dev phones don't get Over The Air (OTA) updates of software.
Joe

On Tue, Mar 31, 2009 at 6:40 AM, Eric Schott ericwsch...@gmail.com wrote:


 I have a developers phone running: 1.1 specifically
 holiday_devphone_userdebug 1.1  Kernel version is: 2.6.25-01845-
 g85d4f0d android-bu...@apa27 #27

 and I can not see any paid apps.  I still see lots of chatter about
 some who can see paid apps and some who can not.  What the magic
 button to make this work?  :)



 On Mar 10, 11:14 am, Brodsky peter.brod...@gmail.com wrote:
  I've got the same problem.  If Ican'tseepaidappsoff this dev
  phone, how do I get my money back for it?  No one ever told me it'd be
  crippled...
 
  On Feb 20, 4:19 pm, Michael Martin mi...@mm-agency.com wrote:
 
   *** Can anyone at Google explain why some G1s can seepaidappswhile
   otherscan’t? 
 
   I don’t believe this is a matter of an OTA updates but rather
   datacenter propagation thus it would depend on which Android Market
   datacenter the G1 is pinging.
 
   In my case I have 2 G1s (side by side) and 1 canseethepaidapps
   while the other doesn’t….could only assume they are both pinging the
   same DC.
 
   (I have already tried the reboot theory to no avail)
 
   Any formal explanation for this???
 
   Thank You,
   Michael Martinhttp://www.googleandblog.com/

 


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



[android-developers] Static Variables after Application life cycle

2009-04-01 Thread wacamoe

Hello all,
  I have noticed in my application(s) that after a call to
Activity.finish() that the static variables that I declared in my
classes still hold the values that they were changed to during the
activity's life cycle. Upon the re-launch of the activity, the program
does not re-instantiate the variables as declared or set them to the
default java behavior. Is there something that I can do to cause this
to happen, other than re-setting every static variable in my
application?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Bluetooth : RFCOMM connection fails while connecting to a headset which is in discoverable mode.

2009-04-01 Thread Bhargavi

Hi,
  Iam novice to android and i have seen a issue in G1. can some one
help me to proceed further ?
Steps to reproduce:
1.Pair and connect to a BT mono / Stereo headset.
2. Disconnect the headset from the G1 phone.
3. Switch off the headset.(Plantronics 320 / Motorola HT820)
4. Put the headset back in discoverable mode.
5. Now initiate a connection from G1.
6. Problem in connecting to Headset message pops up.
Note: when a stereo headset is connected in the same way (step 5) ,
only a2dp connection succeeds and HFP connection always fails. when a
mono headset is connected (step 5) , failure happens as it supports
only hfp.
From my initial analysis , i found that HFP conenction failed because
of the RFCOMM connection failure. I see the below message in the log:

rfcomm async connect() error: CONNECTION REFUSED (111).40 attempts of
calls to waitForAsyncConnectNative has failed and the result was
returned as  0..
Reference: waitForAsyncConnectNative() function in
android_server_headsetbase.cpp.

Any help would be really useful.

Thanks in advance,
Bhargavi


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

2009-04-01 Thread Romain Guy

This is the correct and normal behavior of static fields :) If you
need to reset them, you will have to do so manually.

On Tue, Mar 31, 2009 at 10:37 PM, wacamoe waca...@gmail.com wrote:

 Hello all,
  I have noticed in my application(s) that after a call to
 Activity.finish() that the static variables that I declared in my
 classes still hold the values that they were changed to during the
 activity's life cycle. Upon the re-launch of the activity, the program
 does not re-instantiate the variables as declared or set them to the
 default java behavior. Is there something that I can do to cause this
 to happen, other than re-setting every static variable in my
 application?

 




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

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



[android-developers] Re: SQLite functions - how to use them?

2009-04-01 Thread Mark Murphy

sirius wrote:
 Hi,
 I read in the documentation for SQLite that there should be some core
 functions and aggregate functions available, but I can't seem to use
 them in my code.. Can anyone help?
 
 Here's the documentation i read:
  http://www.sqlite.org/lang_aggfunc.html
  http://www.sqlite.org/lang_corefunc.html

Those are functions available to SQL statements executed by SQLite.

 There is for example the function count() but how do I use it?

For example:

SELECT count(*) FROM sometable WHERE column1='somevalue';

The above SQL statement will return a count of the number of rows in
sometable that have a value of 'somevalue' for column1.

 I have tried to use it as stated below, but none of the functions in
 the documentation is available that way (i.e when I type db. the
 list that shows in Eclipse documentation doesn't include any of the
 functions from the SQLite doc except from execSQL):

SQL is not Java. You can execute SQL statements against SQLite via the
Java rawQuery() method available on SQLiteDatabase.

You are attempting to call SQLite functions as if they were methods on
the SQLiteDatabase object, which generally will not work.

 PS. I haven't worked with databases before, so please keep that in
 mind when you answer me. DS.

I would recommend you learn SQL outside of Android at the outset. If you
specifically want to focus on SQLite, _The Definitive Guide to SQLite_
(Apress) is a good book.

Once you are comfortable with the notion of executing queries to get
results back, possibly including the functions you linked to, then it
will be easier for you to see how to access databases from inside Android.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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

2009-04-01 Thread Mark Murphy

l hx wrote:
 today i get the master code. when I  compile ALSA, and it says
 external/alsa-lib/src/shmarea.c:27:21: error: sys/shm.h: No such file or
 directory
 what should I do now? now i copy the shm.h from the former version
 android. can be ok?

Questions regarding the Android source code are best asked on a mailing
list focused on the Android source code:

http://source.android.com/discuss

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

Warescription: Three Android Books, Plus Updates, $35/Year

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

2009-04-01 Thread sirius

Hi,
You can drop the table by writing DROP TABLE tablename IF EXISTS
But after that it is good to do a VACUUM (info about that in the link
below).

I.e the code might look like:

  private SQLiteDatabase db;
  private static final String TABLE_NAME = name_of_table;

  try{db.execSQL(DROP TABLE IF EXISTS  + TABLE_NAME);
  db.execSQL(VACUUM);}
  catch(SQLException sqle){}

Here is a good link to the SQLite documentation: http://www.sqlite.org/lang.html

BR

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Which android's version can support file transfer through bluetooth?

2009-04-01 Thread Mark Murphy

Kelly Mao wrote:
 Which android's version can support file transfer through bluetooth?

None, presently.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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