[android-developers] Format or example required for writing script for monkey tool

2010-09-06 Thread ankit
Hi,

Can someone please provide the example or format for writing my own
script to be used with monkey tool. It would be of great help for me.

Regards
Ankit Aggarwal

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


Re: [android-developers] about android Reversepengineering !!!!

2010-09-06 Thread TreKing
On Sun, Sep 5, 2010 at 11:38 PM, xc s sxchao2...@gmail.com wrote:

 how should I do?


Make an app that sucks so much no one would want to even use it, let alone
reverse engineer it.

...

...

...

Or try obfuscating your code, for starters.

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

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

[android-developers] What is INSTRUMENTATION_CODE refers to

2010-09-06 Thread manohar
Hello Guys,

I have been working with Instrumentation test for couple of days, i
will get the output as follows
INSTRUMENTATION_STATUS_CODE: 1
 * INSTRUMENTATION_STATUS: class=com.foo.FooTest
 * INSTRUMENTATION_STATUS: test=testFoo
 * INSTRUMENTATION_STATUS: numtests=2
 * INSTRUMENTATION_STATUS_CODE: -2

I understood what does STATUS CODe stands for start(1)/pass(0)/
fail(-2)/error(-1)

At the end of my all the tests, after it displays time, it returns

INSTRUMENTATION_CODE: -1,  what does exactly it means?  Where i can
get more information?

Regards
Manohar

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

2010-09-06 Thread mikedroid
I need to bypass the Activity upon enabling the DevicePolicy in my
device, so far it will still ask the user to activate or cancel it, Is
there a workaround on how to remove this UI and implicitly enabled the
admin policy ?

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

2010-09-06 Thread ko5tik


On Sep 5, 8:11 pm, sws-vinpa vincepascu...@gmail.com wrote:
 Serial ports would be valuable for this sort of application.  ;-)

I heard of bluetooth dongles which can be plugged to CAN - even more
valuable

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

2010-09-06 Thread Nand
Hi,
I'm developing an application which connects to some agent running on
desktop via Wi-Fi. After it connects and receives some data, stack
corruption detected error encountered and gets aborted. I'm calling a
recursive function for my data processing Can anyone please tell me
what might be the problem? And also how to solve this issue?

09-06 11:11:51.517: ERROR/Common(537): 0 File:apps/Common/project/
jni/per_decoder.cLine:39
09-06 11:11:51.517: ERROR/Common(537): 4555afd4 File:apps/Common/
project/jni/per_decoder.cLine:48
09-06 11:11:51.517: ERROR/Common(537): 4555afd4 File:apps/Common/
project/jni/per_decoder.cLine:63
09-06 11:11:51.517: ERROR/Common(537): 0 File:apps/Common/project/
jni/per_decoder.cLine:66
09-06 11:11:51.517: ERROR/Common(537): 0 File:apps/Common/project/
jni/per_decoder.cLine:71
09-06 11:11:51.517: ERROR/Common(537): 20 File:apps/Common/project/
jni/per_decoder.cLine:75
09-06 11:11:51.517: ERROR/Common Exit(537): 20 File:apps/Common/
project/jni/per_decoder.cLine:82
09-06 11:11:51.517: ERROR/Common Exit(537): [ 09-06 11:11:51.517
537:0x221 F/unknown  ]
09-06 11:11:51.517: ERROR/Common Exit(537): stack corruption detected:
aborted
09-06 11:11:51.546: INFO/WindowManager(61): WIN DEATH: Window{43b62e28
com.android.manager/com.android.manager.Manager paused=false}
09-06 11:11:51.546: INFO/ActivityManager(61): Process
com.android.manager (pid 537) has died.
09-06 11:11:51.596: DEBUG/Zygote(36): Process 537 terminated by signal
(6)
09-06 11:11:51.636: INFO/UsageStats(61): Unexpected resume of
com.android.settings while already resumed in com.android.manager


Regards,
Nand

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

2010-09-06 Thread Kumar Bibek
Can you post some code for this? I am not sure if it's a bug in your
code, or the Android source.

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 6, 11:34 am, Nand nandithab...@gmail.com wrote:
 Hi,
 I'm developing an application which connects to some agent running on
 desktop via Wi-Fi. After it connects and receives some data, stack
 corruption detected error encountered and gets aborted. I'm calling a
 recursive function for my data processing Can anyone please tell me
 what might be the problem? And also how to solve this issue?

 09-06 11:11:51.517: ERROR/Common(537): 0     File:apps/Common/project/
 jni/per_decoder.c    Line:39
 09-06 11:11:51.517: ERROR/Common(537): 4555afd4     File:apps/Common/
 project/jni/per_decoder.c    Line:48
 09-06 11:11:51.517: ERROR/Common(537): 4555afd4     File:apps/Common/
 project/jni/per_decoder.c    Line:63
 09-06 11:11:51.517: ERROR/Common(537): 0     File:apps/Common/project/
 jni/per_decoder.c    Line:66
 09-06 11:11:51.517: ERROR/Common(537): 0     File:apps/Common/project/
 jni/per_decoder.c    Line:71
 09-06 11:11:51.517: ERROR/Common(537): 20     File:apps/Common/project/
 jni/per_decoder.c    Line:75
 09-06 11:11:51.517: ERROR/Common Exit(537): 20     File:apps/Common/
 project/jni/per_decoder.c    Line:82
 09-06 11:11:51.517: ERROR/Common Exit(537): [ 09-06 11:11:51.517
 537:0x221 F/unknown  ]
 09-06 11:11:51.517: ERROR/Common Exit(537): stack corruption detected:
 aborted
 09-06 11:11:51.546: INFO/WindowManager(61): WIN DEATH: Window{43b62e28
 com.android.manager/com.android.manager.Manager paused=false}
 09-06 11:11:51.546: INFO/ActivityManager(61): Process
 com.android.manager (pid 537) has died.
 09-06 11:11:51.596: DEBUG/Zygote(36): Process 537 terminated by signal
 (6)
 09-06 11:11:51.636: INFO/UsageStats(61): Unexpected resume of
 com.android.settings while already resumed in com.android.manager

 Regards,
 Nand

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Capturing RAW data in Android 2.2(HTC Desire)

2010-09-06 Thread blindfold
Yes, many have reported problems with camera preview in portrait mode,
and one way out is to force your app in landscape mode and just not
use portrait. Otherwise, consider the solutions suggested in
http://code.google.com/p/android/issues/detail?id=1193 (I have not
tested those because landscape suited me best).

The vOICe for Android
http://www.seeingwithsound.com/android.htm


On Sep 6, 4:57 am, uday uday.pic...@gmail.com wrote:
 Thanks Blindfold for ur information... Currently im working on Camera
 Capture in Android. I can able to display the image in portrait by
 forcing the preview as portrait in AndroidManifest.xml file.. But the
 image preview is not correct as i expected.. The image preview is like
 streched... I dont have an idea of how to maintain the Aspect ratio so
 that the image preview will be clear..

 Do u have any idea on this?? I saw some of the blogs on this but no
 luck..

 On Sep 5, 1:09 pm, blindfold seeingwithso...@gmail.com wrote:

  You can do image processing on camera preview images, which are
  smaller and almost raw even while not supporting the raw format
  either: the default YCbCr_420_SP format uses 1.5 bytes per pixel by
  subsampling U and V by a factor 2 in YUV color space; 1.5 times the
  number of pixels in a typical preview size is still manageable in
  terms of the amount of memory, but you need to do your own color
  conversion/decoding to maybe arrive at a byte count of 4 times the
  number of pixels for an RGBA integer-per-pixel (4 bytes per pixel)
  encoding for more convenient image processing. This is a hassle in
  Android for lack of conversion/decoding APIs, but doable and not very
  memory hungry as long as you do image processing on preview images
  from PreviewCallback.

  Regards

  The vOICe for Android http://www.seeingwithsound.com/android.htm

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

2010-09-06 Thread ytbryan
thanks guys

On Sep 6, 12:42 am, Kumar Bibek coomar@gmail.com wrote:
 Do test out your apps on emulators.

 http://techdroid.kbeanie.com/2010/09/getting-started-with-tablets-the...

 -Kumar Bibekhttp://techdroid.kbeanie.com

 On Sep 5, 9:32 pm, ben benbros...@gmail.com wrote:



  I would make sure your app isn't drawing anything to exact pixel
  locations and sizes. If you're using the built in layouts you should
  be in good shape. Also you can use the AVD manager to create an
  emulator with larger resolutions and screen sizes. That should at
  least give you some idea of what it will look like.

  On Sep 5, 11:56 am, Droid rod...@gmail.com wrote:

   And is landscape view preferred or default for these bigger screens?
   Many of my apps are fixed to portrait...

   On Sep 5, 1:50 pm, ytbryan ytbr...@gmail.com wrote:

Hi all,

do we(developer) need to alter our app to suit the android
tablet(samsung galaxy tab)? or will them automatically run on the
tablet?

Is a documentation on developing for android tablet?

thanks!
bryan

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

2010-09-06 Thread Rajesh Pelluru
Hi,
  I have three screens in my sample application i.e. MainScreen,
Screen1, and Screen2.

If I click on Button in Main Screen then Screen1 appears in my device.

If I click on Button in Screen1 then Screen2 appears in my device.

Now if I click on home button and again if I tap on my app it displays
Screen2.

Actual requirement of mine is it should display every time MainScreen if we
tap on my app in device.

Could anyone help me on the same.

--Rajesh

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

2010-09-06 Thread Indicator Veritatis
Well, you got one thing right: you do not understand. You have been
too close to Android for too long, you simply do not understand how
the documentation is read by people who are not so close (or even by
those as close who are more careful readers). That is why you
underestimate how bad this one spot in the documentation is. For the
section I quoted, when read alone, really does read as if the issue of
those values is settled by those few lines. This is, after all, all on
the topic at that 'node' in the Javadoc, the node on supports-
screens.

So it is a surprise to the reader to find out that no, it is not
settled: the values are set by minSDKversion as well (in the default
case). By no means is the latter section clearly there to expand upon
that material as you say, since it is so far away, being a separate
and apparently unrelated node. Nor is this the only spot in the
documentation with such unexpected expansion in an even more
unexpected place. Why, the former is under supports-screens and the
latter is under uses-sdk. These are effectively two different
documents, since each gets its own distinct node in Javadoc. Nor is
there even a cross-reference suggesting to the reader of the one that
he needs to see the other for the 'expansion'.

Now I will admit there are bigger problems in the documentation. But I
haven't seen those get fixed in between 1.5 and 2.2 either. It seems
everyone at Google is as cavalier about it as you are. This does not
bode well for the future of Android.

On Sep 4, 5:56 pm, Dianne Hackborn hack...@android.com wrote:
 Okay, look at it another way: the documentation you are quoting says that
 those control the different screen sizes you support.  And let's say it
 states: these attributes, and nothing else, determine the screen sizes you
 support.  It doesn't say anything about what the values are if you don't
 specify them.  That is covered *in the same document* only a couple
 paragraphs down (in the sections that are clearly there to expand upon that
 material) in the text I pointed to.

 I mean...  there are a lot of places I could point to in the documentation
 that are not so good or outright bad.  To have a problem with this
 particular part...  I don't understand.

 On Sat, Sep 4, 2010 at 4:11 PM, Indicator Veritatis mej1...@yahoo.comwrote:

  It is not being uber-pedantic. And your example of guns killing
  bunnies is irrelevant. It would have been relevant if you had followed
  the wording of the citation a little more closely, and said,
  this gun lets me specify whether the bunny will live or die. But of
  course, you did not say that, since that does not support your
  position.

  The truth is that as happens all too often, the online documentation
  says one thing in one place, and contradicts that one thing in another
  place.

  On Sep 4, 12:36 am, Dianne Hackborn hack...@android.com wrote:
   Also on that page:

   Default values for attributes

   The default values for the supports-screens attributes differs,
  depending
   on the value of
   theandroid:minSdkVersion
 http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
   attribute
   in the application's manifest, as well as on the value of
   android:targetSdkVersion, if declared:

      - If android:minSdkVersion or android:targetSdkVersion is 3 (Android
      1.5) or lower, the default value for everything except
  android:normalScreens
      is false. If you are primarily targeting pre-Android 1.6 platforms but
      also want to support other densities/screen sizes, you need to set the
      appropriate attributes to true.
      - If android:minSdkVersion or android:targetSdkVersion is 4 (Android
      1.6) or higher, the default value for everything is true. If your
      application requires Android 1.6 features, but does not support these
      densities and/or screen sizes, you need to set the appropriate
  attributes
      to false.
      - Note that android:normalScreens always defaults to true.

   But um yeah if you want to be uber-pedantic...  wait, no, not even in
  that
   case.  This gun lets me kill the bunny.  That doesn't imply to me that
  the
   gun is the only way I have to kill the bunny. :)

   On Fri, Sep 3, 2010 at 11:57 PM, Indicator Veritatis mej1...@yahoo.com
  wrote:

I take your word for this, that it really is true. But I must point
out: strictly speaking that contradicts
   http://developer.android.com/guide/practices/screens_support.html
which reads in part:

The platform also provides a supports-screens manifest element,
whose attributes android:largeScreens, android:normalScreens, and
android:smallScreens let you specify what generalized screen sizes
your application supports. 

By the rules of English grammar, this means that this manifest element
ALONE lets you specify it, minSdkVersion has NO part in it.

On Sep 3, 5:14 pm, Dianne Hackborn hack...@android.com wrote:
 On Fri, Sep 3, 2010 at 1:31 PM, 

[android-developers] android design pattern

2010-09-06 Thread ytbryan
hi all,

I'm new to android.

As i am building multiple activities, i realise that i have to code
out repetitively this segment.

Intent i = new Intent();
i.setClass(this, Main_Form.class);
startActivity(i);

So that i can return to the home page.

Is there some structural pattern or design pattern that i am missing
out? Like a Activities Manager that manage all the activities? can
someone give me some advice?

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: Statistics on Rooted Phones

2010-09-06 Thread Chris Stratton
You must not make assuming rooted devices are uncommon or even
detectable part of your business statements, as that would be
dangerously misleading to anyone who might rely on it.

On Sep 6, 1:36 am, Tez earlencefe...@gmail.com wrote:
 Its just a research study we are carrying. Certain operations can be
 performed on a rooted phone and some of them are security threats.
 We would like to quantify certain statements we make.
 Also, now that rooting is legal, I expect a rise in the no. of users
 who would root their phones.

 Cheers,
 Earlence

 On Sep 6, 9:35 am, Kumar Bibek coomar@gmail.com wrote:



  Ummm, not that I know of. Even if it were there, it would be an
  enormous task to update it regularly. Users keep on switching. Even a
  small sample of users cannot actually give you the approx numbers.

  But, I am wondering how will this number help anyone. :)

  -Kumar Bibekhttp://techdroid.kbeanie.com

  On Sep 4, 7:14 pm, Tez earlencefe...@gmail.com wrote:

   Hi,

   Is there any statistic/research study on the no. of users who root
   their phones?

   Cheers,
   Earlence

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

2010-09-06 Thread Nand
Hi,
Thanks for replying.
I cant post the code as it is large application calling multiple
functions at runtime. I'm also using native functions for thread
creation and socket connection.

If you can tell me the reasons for this issue to occur, I can look and
try to check if any such exist in my application.

Thanks in advance.

 Regards,
 Nand

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


Re: [android-developers] about android Reversepengineering !!!!

2010-09-06 Thread xc s

  So Actually this no answer really? no any method?


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

Re: [android-developers] android design pattern

2010-09-06 Thread xc s
Actually I also do this.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: List Item (a view) order changes unexpextedly while (fast) scrolling in a ListView

2010-09-06 Thread jamesc
OK.  I've had a quick look.

1) I take it that your View (MyView) is the item in the ListView?
2) Why are you doing the measuring (and implementing onDraw())?  I
would have thought that you should be using a layout to declare the
ListView item and then backing that with a BaseAdapter implementation
(where you should look at using the view holder pattern to allow re-
use of inflated objects.

On Sep 6, 5:15 am, rious.delie rious.de...@gmail.com wrote:
 somebody please...

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

2010-09-06 Thread Kumar Bibek
Go through this link. It might help you.

http://rxwen.blogspot.com/2009/04/detect-stack-corruption.html

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 6, 12:06 pm, Nand nandithab...@gmail.com wrote:
 Hi,
 Thanks for replying.
 I cant post the code as it is large application calling multiple
 functions at runtime. I'm also using native functions for thread
 creation and socket connection.

 If you can tell me the reasons for this issue to occur, I can look and
 try to check if any such exist in my application.

 Thanks in advance.

  Regards,
  Nand

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

2010-09-06 Thread Indicator Veritatis
This sounds like it is an Eclipse issue rather than an Android issue.
And depending on what you mean by goes out of sync very easily, it
might not even be an Eclipse bug, just an odd consequence of their
decision of how to build the abstraction project file on top of the
simpler abstraction, operating system file. For I have noticed it
gets out of sync too, but I have never had an out of sync problem
that I could not deal with easily by resyncing the folder from inside
of Eclipse. That is, if I edit a source file w/ Emacs instead of the
built-in Eclipse editor, I then resync the folder it is in from the
Eclipse menu, and all is right again. Likewise if some other file in
the project changes for some other reason.

But if you mean Eclipse suddenly losing sight of the R file, the
solution for that is different: 'clean' project fixes it 9 out of 10
times. I can't remember what the workaround was for the remaining 1
out of 10 times I saws this failure.

But if you are having some other out of sync problem, then that is
probably peculiar to your installation. The rest of us do not find out
of sync problems to be that annoying -- probably because we don't see
it as often. But in that case, your best bet is to take this up in an
Eclipse group rather than here.

On Sep 5, 9:03 am, Droid rod...@gmail.com wrote:
 My eclipse goes out of sync very easily. I now make copy paste files
 into a project to make sure they go into the workspace and do not stay
 somewhere else. Its the worst thing about Eclipse IMO. Build/clean is
 automatic usually, but does not always fix problems.
 I have lost loads of stuff...

 On Sep 3, 5:31 pm, Steve Mathews happy...@gmail.com wrote: I usually have 
 to do Project - Clean, then build again and this goes away.

  On Fri, Sep 3, 2010 at 2:40 AM, SREEHARI
  sreehari.madhusooda...@wipro.comwrote:

   Do bulid project... It will be fine.

   Regards,
   SREEHARI

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



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


[android-developers] Re: android design pattern

2010-09-06 Thread Kumar Bibek
There can be many ways of doing this. What I regularly use, is to have
my own Activity class, say, MyActivity which extends the Activity
class.

All the other activities in my application extend MyActivity instead
of Activity. In Activities, I have a few methods, which I think would
be used by almost all my activities, like firing intents, showing
toasts, dialogs, etc.

So, in MyActivity, you can have a method, startIntent(Class class),
and write these three lines of code here.

Now whenever you need to trigger an intent, just call this method with
the target activity class.

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 6, 12:13 pm, xc s sxchao2...@gmail.com wrote:
 Actually I also do this.

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


[android-developers] Two buttons side by side to fill width of screen?

2010-09-06 Thread Droid
I have 2 buttons side by side in RelativeLayout (170dip each) but in
landscape view, they are too narrow - I want to increase their widths
automatically for landscape.

I need a 'fill_parent' for two buttons at once kinda thing.

Can anyone point me in the right direction.

Here is my layout:

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:background=#00
android:layout_height=fill_parent

Button android:text=@string/get_answer
android:id=@+id/Button02
android:layout_centerHorizontal=true
android:layout_width=170dip
android:layout_alignParentLeft=true
android:layout_height=wrap_content/Button

Button android:text=@string/speak_answer
android:id=@+id/Button03
android:layout_centerHorizontal=true
android:layout_width=170dip
android:layout_toRightOf=@id/Button02
android:layout_alignTop=@id/Button02
android:layout_height=wrap_content/Button


TextView android:text=  android:id=@+id/TextView01
android:layout_below=@+id/Button03android:textColor=#ff
android:textStyle=bold android:textSize=1dip
android:layout_width=wrap_content android:layout_height=1dip/
TextView
TextView android:text=  android:id=@+id/TextView02
android:layout_below=@+id/TextView01 android:textColor=#00
android:textStyle=bold android:textSize=20dip
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=  android:id=@+id/TextView03
android:layout_below=@+id/TextView02  android:textColor=#ff00ff
android:textStyle=bold android:textSize=20dip
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=  android:id=@+id/TextView04
android:layout_below=@+id/TextView03  android:textColor=#ff
android:textStyle=bold android:textSize=20dip
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=  android:id=@+id/TextView05
android:layout_below=@+id/TextView04
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=  android:id=@+id/TextView06
android:layout_below=@+id/TextView05
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=  android:id=@+id/TextView07
android:layout_below=@+id/TextView06
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView
TextView android:text=   android:id=@+id/TextView08
android:layout_below=@+id/TextView07
android:layout_width=wrap_content
android:layout_height=wrap_content/TextView

/RelativeLayout

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

2010-09-06 Thread GPU
Hi ,
passing two int values m =0  s = 11, to below function
String formatted = String.format(%1$02d:%2$02d, m, s);

returning the value like   .0:11 ,What could be the problem  ?

m=0, s=11   --   .0:11
m=0, s=1--.0:.1

The 0 added to format the string always coming as '.' (dot).

Can anyone know ,from where the number patterns are getting loaded in
Android ?

I gone thorough the code ,Its related the following file ,
android\dalvik\libcore\icu\src\main\java\com\ibm\icu4jni\util
\Resources.java -localeData.numberPattern

How the pattern for particular locale is loaded ,what could be the
problem for the above problem?

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


Re: [android-developers] Re: Activities I Don't Want the User to be able to go Back to

2010-09-06 Thread Kostya Vasilyev

 06.09.2010 2:59, JimBadger пишет:

What about part 2?  I want a visual refresh of Activity A when
returning to it from Activity B (or C, or even G), that reflects how
the game data that affects Acitivty A has changed since the user left
it...

Override onResume or onStart

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Http chunked response and Connection Reset by Peer error

2010-09-06 Thread Cydrike
Hi everyone,

I'm facing an annoying problem here.
My application is connected to a server that sends some data from time
to time. It's some kind of eventing server. In order to receive data,
I'm connecting to the server with an HttpURLConnection, retrieve the
response InputStream and loop on it with the read method. The
connection is always open.

The distant server is cutting the connection every 5 minutes (for test
purpose). When connection is closed, my application has to reconnect
again. We detect a Connection Reset by Peer exception when the server
closes the connection. The problem is that most of the time, I never
receive the Connection Reset by Peer exception. So my application
can't know that is has to reconnect and it's stucked on the read
instruction.

The InputStream.Read() method shouldn't always raise an exception if
the connection is closed?
What can I do to always detect Connection Reset by Peer exception?

Thanks for any help,

Android 2.1
HTC Desire

Cédric

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

2010-09-06 Thread Chris Stratton
Perhaps you should instrument the depth of the recursion.  And maybe
limit it - would not be good if feeding a trick file to your app can
crash or corrupt it.

I made a wrapper for the android log vprint function that looks like a
normal printf and sprinkle it liberally through my code, can simply
turn it on or off at compile time.


On Sep 6, 3:06 am, Nand nandithab...@gmail.com wrote:
 Hi,
 Thanks for replying.
 I cant post the code as it is large application calling multiple
 functions at runtime. I'm also using native functions for thread
 creation and socket connection.

 If you can tell me the reasons for this issue to occur, I can look and
 try to check if any such exist in my application.

 Thanks in advance.

  Regards,
  Nand

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

2010-09-06 Thread Eurig Jones
I've been suffering from the HttpClient hanging on me every now and
again and never returning the response. This is my HttpClient creation
code and the method which accesses it. It is accessed potentially via
the UI thread and other AsyncTasks.

Can anyone see anything here that looks suspicious which could cause
this kind of behaviour?


private static DefaultHttpClient httpClient;

private static void createHttpClient()
{
HttpParams params = new BasicHttpParams();
ConnManagerParams.setMaxTotalConnections(params, 4);
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

HttpConnectionParams.setConnectionTimeout(params, 8000);
HttpConnectionParams.setSoTimeout(params, 8000);

SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme(http,
PlainSocketFactory.getSocketFactory(), 80));

ClientConnectionManager cm = new ThreadSafeClientConnManager(params,
schemeRegistry);
httpClient = new DefaultHttpClient(cm, params);
}


public synchronized static HttpResponse fetch(HttpRequestBase type)
throws ClientProtocolException, IOException
{
return httpClient.execute(type);
}

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

2010-09-06 Thread Kumar Bibek
This is the default behaviour for Android apps. Checkout the launch
flags section in the android documentation to get hints on how to
handle special situations.

-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 6, 11:52 am, Rajesh Pelluru mail2pell...@gmail.com wrote:
 Hi,
           I have three screens in my sample application i.e. MainScreen,
 Screen1, and Screen2.

 If I click on Button in Main Screen then Screen1 appears in my device.

 If I click on Button in Screen1 then Screen2 appears in my device.

 Now if I click on home button and again if I tap on my app it displays
 Screen2.

 Actual requirement of mine is it should display every time MainScreen if we
 tap on my app in device.

 Could anyone help me on the same.

 --Rajesh

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

2010-09-06 Thread Vikram
I want to implement a custom ViewGroup which looks like 3 horizontal
train tracks, red, blue and green tracks, parallel to each other.
And each of the tracks can carry one or more compartments.

Each compartment can be a red, blue or a green compartment, has a
different size and can be positioned anywhere on the corresponding
tracks. Fling on the screen must move the the tracks together either
way. The user should also be able to pinch and zoom on the screen.

TrainTracks extends Vertical_LinearLayout
{
Horizontal_LinearLayout red;
Horizontal_LinearLayout red;
Horizontal_LinearLayout red;

public void addCompartment(int whichTrack, Comparment C);

public void addVoid(int whichTrack, int voidLength);
}

Compartment extends View
{
}

Does this sound like a good design? Should I checkout using a
SurfaceView especially given that flings and pinch-zoom should be
supported?

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] Parallel Horizontal ListView

2010-09-06 Thread Vikram
I want to implement a custom ViewGroup which looks like 3 horizontal
train tracks, red, blue and green tracks, parallel to each other.
And each of the tracks can carry one or more compartments.

Each compartment can be a red, blue or a green compartment, has a
different size and can be positioned anywhere on the corresponding
tracks. Fling on the screen must move the the tracks together either
way. The user should also be able to pinch and zoom on the screen.

TrainTracks extends FrameLayout
{
HorizontalScrollView holder;
Vertical_LinearLayout trackHolder;
Horizontal_LinearLayout red;
Horizontal_LinearLayout blue;
Horizontal_LinearLayout green;

//holder
//trackHolder
//red, blue and green

public void addCompartment(int whichTrack, Comparment C);
{
//Add C to red, blue or green
}
public void addVoid(int whichTrack, int voidLength)
{
//Add View object of size voidLength to red, blue or green
}
}

Compartment extends View
{
}

Does this sound like a good design? Should I checkout using a
SurfaceView especially given that flings and pinch-zoom should be
supported?

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: Capturing RAW data in Android 2.2(HTC Desire)

2010-09-06 Thread uday
So you have hard coded in manifest.xml file for the field
screenOrientation=landscape am i right??

Do u able to get the correct preview in Landscape mode???

On Sep 6, 11:48 am, blindfold seeingwithso...@gmail.com wrote:
 Yes, many have reported problems with camera preview in portrait mode,
 and one way out is to force your app in landscape mode and just not
 use portrait. Otherwise, consider the solutions suggested 
 inhttp://code.google.com/p/android/issues/detail?id=1193(I have not
 tested those because landscape suited me best).

 The vOICe for Androidhttp://www.seeingwithsound.com/android.htm

 On Sep 6, 4:57 am, uday uday.pic...@gmail.com wrote:

  Thanks Blindfold for ur information... Currently im working on Camera
  Capture in Android. I can able to display the image in portrait by
  forcing the preview as portrait in AndroidManifest.xml file.. But the
  image preview is not correct as i expected.. The image preview is like
  streched... I dont have an idea of how to maintain the Aspect ratio so
  that the image preview will be clear..

  Do u have any idea on this?? I saw some of the blogs on this but no
  luck..

  On Sep 5, 1:09 pm, blindfold seeingwithso...@gmail.com wrote:

   You can do image processing on camera preview images, which are
   smaller and almost raw even while not supporting the raw format
   either: the default YCbCr_420_SP format uses 1.5 bytes per pixel by
   subsampling U and V by a factor 2 in YUV color space; 1.5 times the
   number of pixels in a typical preview size is still manageable in
   terms of the amount of memory, but you need to do your own color
   conversion/decoding to maybe arrive at a byte count of 4 times the
   number of pixels for an RGBA integer-per-pixel (4 bytes per pixel)
   encoding for more convenient image processing. This is a hassle in
   Android for lack of conversion/decoding APIs, but doable and not very
   memory hungry as long as you do image processing on preview images
   from PreviewCallback.

   Regards

   The vOICe for Androidhttp://www.seeingwithsound.com/android.htm

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

2010-09-06 Thread Tez
This is not related to business in anyway. This is university
research.

On Sep 6, 12:05 pm, Chris Stratton cs07...@gmail.com wrote:
 You must not make assuming rooted devices are uncommon or even
 detectable part of your business statements, as that would be
 dangerously misleading to anyone who might rely on it.

 On Sep 6, 1:36 am, Tez earlencefe...@gmail.com wrote:

  Its just a research study we are carrying. Certain operations can be
  performed on a rooted phone and some of them are security threats.
  We would like to quantify certain statements we make.
  Also, now that rooting is legal, I expect a rise in the no. of users
  who would root their phones.

  Cheers,
  Earlence

  On Sep 6, 9:35 am, Kumar Bibek coomar@gmail.com wrote:

   Ummm, not that I know of. Even if it were there, it would be an
   enormous task to update it regularly. Users keep on switching. Even a
   small sample of users cannot actually give you the approx numbers.

   But, I am wondering how will this number help anyone. :)

   -Kumar Bibekhttp://techdroid.kbeanie.com

   On Sep 4, 7:14 pm, Tez earlencefe...@gmail.com wrote:

Hi,

Is there any statistic/research study on the no. of users who root
their phones?

Cheers,
Earlence

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

2010-09-06 Thread a1
 Does anyone has a simple example of to use LocalActivityManager or
 something else to meet my requirements.

void createInnerActivity(ViewGroup container, Class? activityClass)
{
if (container.getChildCount() != 0) {
container.removeViewAt(0);
}

final Intent intent = new Intent(this, activityClass);
final Window window =
getLocalActivityManager().startActivity(activityClass.toString(),
intent);
container.addView(window.getDecorView(), new
ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
}

Above should be a method of activity that extends ActivityGroup,
passed container will host newly created activity.

--
Bart Janusz

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Capturing RAW data in Android 2.2(HTC Desire)

2010-09-06 Thread blindfold
 So you have hard coded in manifest.xml file for the field
 screenOrientation=landscape am i right??

Yes.

 Do u able to get the correct preview in Landscape mode???

Yes, just check my app.

The vOICe for Android
http://www.seeingwithsound.com/android.htm

On Sep 6, 10:38 am, uday uday.pic...@gmail.com wrote:
 So you have hard coded in manifest.xml file for the field
 screenOrientation=landscape am i right??

 Do u able to get the correct preview in Landscape mode???

 On Sep 6, 11:48 am, blindfold seeingwithso...@gmail.com wrote:

  Yes, many have reported problems with camera preview in portrait mode,
  and one way out is to force your app in landscape mode and just not
  use portrait. Otherwise, consider the solutions suggested 
  inhttp://code.google.com/p/android/issues/detail?id=1193(Ihave not
  tested those because landscape suited me best).

  The vOICe for Android http://www.seeingwithsound.com/android.htm

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

2010-09-06 Thread ytbryan
I see. thank you Kumar.

On Sep 6, 3:25 pm, Kumar Bibek coomar@gmail.com wrote:
 There can be many ways of doing this. What I regularly use, is to have
 my own Activity class, say, MyActivity which extends the Activity
 class.

 All the other activities in my application extend MyActivity instead
 of Activity. In Activities, I have a few methods, which I think would
 be used by almost all my activities, like firing intents, showing
 toasts, dialogs, etc.

 So, in MyActivity, you can have a method, startIntent(Class class),
 and write these three lines of code here.

 Now whenever you need to trigger an intent, just call this method with
 the target activity class.

 -Kumar Bibekhttp://techdroid.kbeanie.com

 On Sep 6, 12:13 pm, xc s sxchao2...@gmail.com wrote:



  Actually I also do this.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] galaxy s (2.1) and google api 2.2

2010-09-06 Thread ytbryan
Hi all,

I want to run the map activity sample app on samsung galaxy s but
realised that i need it to be 2.2.

is there a workaround?

thanks!
bryan

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


Re: [android-developers] galaxy s (2.1) and google api 2.2

2010-09-06 Thread Kostya Vasilyev

 Galaxy S is supposed to get a Froyo update in September.

Until then, perhaps you could debug in the emulator.

06.09.2010 12:52, ytbryan пишет:

Hi all,

I want to run the map activity sample app on samsung galaxy s but
realised that i need it to be 2.2.

is there a workaround?

thanks!
bryan




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Key Events that occurred in the virtual keyboard can be passed to the hardware

2010-09-06 Thread brilliant winger
Hi all

Key Events that occurred in the virtual keyboard can be passed to the
hardware, andriod OS or high-level focus view?
As with a physical keyboard.

The dpad right event using Bluetooth devices, then it takes my
keyboard service would like to pass on Android system or highest focus
view(ex. system dialog, menu...etc).

but I don't know how.

help me.






Thank you.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Capturing RAW data in Android 2.2(HTC Desire)

2010-09-06 Thread uday
Thanks for the information... Where is ur application??

On Sep 6, 1:50 pm, blindfold seeingwithso...@gmail.com wrote:
  So you have hard coded in manifest.xml file for the field
  screenOrientation=landscape am i right??

 Yes.

  Do u able to get the correct preview in Landscape mode???

 Yes, just check my app.

 The vOICe for Androidhttp://www.seeingwithsound.com/android.htm

 On Sep 6, 10:38 am, uday uday.pic...@gmail.com wrote:

  So you have hard coded in manifest.xml file for the field
  screenOrientation=landscape am i right??

  Do u able to get the correct preview in Landscape mode???

  On Sep 6, 11:48 am, blindfold seeingwithso...@gmail.com wrote:

   Yes, many have reported problems with camera preview in portrait mode,
   and one way out is to force your app in landscape mode and just not
   use portrait. Otherwise, consider the solutions suggested 
   inhttp://code.google.com/p/android/issues/detail?id=1193(Ihavenot
   tested those because landscape suited me best).

   The vOICe for Androidhttp://www.seeingwithsound.com/android.htm

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


Re: [android-developers] Re: Simple Key Event Questions

2010-09-06 Thread Mark Murphy
On Mon, Sep 6, 2010 at 12:37 AM, Tez earlencefe...@gmail.com wrote:
 So the KeyEvent Listener is only for physical keyboards?
 I see many devices that have only soft keyboards. This leads me to
 think What is the value of the Key Listener API then?

It predated the IME system. Hence, if nothing else, it is still there
to maintain binary compatibility.

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

Android Consulting: http://commonsware.com/consulting

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


Re: [android-developers] Http chunked response and Connection Reset by Peer error

2010-09-06 Thread Kostya Vasilyev
 The server doing a graceful close can be detected on the client: 
read() will return -1.


A lost connection (not gracefully closed) generally can't be detected on 
the client. TCP/IP does not transmit data unless your application does, 
so a lost connection looks the same as a connection that simply doesn't 
have any data to receive.


There is a TCP/IP option to do keepalives at the protocol level, 
SO_KEEPALIVE, but I wouldn't count on it working reliably all the way 
from the phone to the server.


I recommend you look at Google C2DM (Cloud 2 Device Messaging).

-- Kostya

06.09.2010 11:37, Cydrike пишет:

Hi everyone,

I'm facing an annoying problem here.
My application is connected to a server that sends some data from time
to time. It's some kind of eventing server. In order to receive data,
I'm connecting to the server with an HttpURLConnection, retrieve the
response InputStream and loop on it with the read method. The
connection is always open.

The distant server is cutting the connection every 5 minutes (for test
purpose). When connection is closed, my application has to reconnect
again. We detect a Connection Reset by Peer exception when the server
closes the connection. The problem is that most of the time, I never
receive the Connection Reset by Peer exception. So my application
can't know that is has to reconnect and it's stucked on the read
instruction.

The InputStream.Read() method shouldn't always raise an exception if
the connection is closed?
What can I do to always detect Connection Reset by Peer exception?

Thanks for any help,

Android 2.1
HTC Desire

Cédric




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Re: Android with Flash cs5: I have a problem about permissions

2010-09-06 Thread Italian-android
Pls I need help about this but anyone is reading my message. Pls give
me an answare

On 5 Set, 12:34, Italian-android maxloveg...@gmail.com wrote:
 Anyone could help me on this my problem?

 On 3 Set, 08:32, Italian-android maxloveg...@gmail.com wrote:







  Hi to all.
  I'm usingflashcs5 to make anAndroidgame.
  The problem that I have is that in the moment of publish,flashgive
  me an error, that is about the permission. Into the property of 
  theflashprogram, there are 4 tabs. One of this is permissions. But
  into the list there isn't anything to select. So I don't know how to
  compile the apk file.

  It's happen with the last version of extention of AirAndroidforFlashcs5, 
  because in the prev version of this plugin, the permission
  tab there wasn't.

  Someone could help me?

  Thank you

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Key Events that occurred in the virtual keyboard can be passed to the hardware

2010-09-06 Thread parag
Could U please be clear on ur query or the problem that u r facing?
i am not able to understand the issue, or the proble that u want to
solve.



On Sep 6, 2:15 pm, brilliant winger stw...@gmail.com wrote:
 Hi all

 Key Events that occurred in the virtual keyboard can be passed to the
 hardware, andriod OS or high-level focus view?
 As with a physical keyboard.

 The dpad right event using Bluetooth devices, then it takes my
 keyboard service would like to pass on Android system or highest focus
 view(ex. system dialog, menu...etc).

 but I don't know how.

 help me.

 Thank you.

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

2010-09-06 Thread Ajmer Singh
Hi

I want to use Mapview in my android app,problem is that i am not getting any
map data(No Map tiles),it only shows grey lines. Plese let me know what i am
doing wrong here,

I am copying my Logcat Details here:

09-04 11:36:21.519: INFO/ActivityManager(60): Starting activity: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
flg=0x1020 cmp=HelloMapView.com/.HelloMapView }
09-04 11:36:21.989: ERROR/ActivityThread(254): Failed to find provider info
for com.google.settings
09-04 11:36:22.028: ERROR/ActivityThread(254): Failed to find provider info
for com.google.settings
09-04 11:36:22.469: WARN/MapActivity(254): Recycling dispatcher
com.google.googlenav.datarequest.datarequestdispatc...@43d0dce0
09-04 11:36:22.589: VERBOSE/MapActivity(254): Recycling map object.
09-04 11:36:23.818: INFO/MapActivity(254): Handling network change
notification:CONNECTED
09-04 11:36:23.879: ERROR/MapActivity(254): Couldn't get connection factory
client
09-04 11:36:24.729: INFO/ActivityManager(60): Displayed activity
HelloMapView.com/.HelloMapView: 3035 ms (total 3035 ms)

Please help!
-- 
Thanks and Regards
Ajmer Singh

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

2010-09-06 Thread Nand
Hi,
Did you solve this stack corruption detected issue? Even I'm facing
similar problem.

Regards,
Nand

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


Re: [android-developers] Re: Android with Flash cs5: I have a problem about permissions

2010-09-06 Thread Mark Murphy
On Mon, Sep 6, 2010 at 5:37 AM, Italian-android maxloveg...@gmail.com wrote:
 Pls I need help about this but anyone is reading my message. Pls give
 me an answare

The answer is: ask Adobe. CS5 is an Adobe product. Flash is an Adobe
product. This is not an Adobe discussion list.

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

Android Consulting: http://commonsware.com/consulting

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


Re: [android-developers] Re: native UDP implementation for android

2010-09-06 Thread Andrew Brampton
Is anyone willing to share their code? Perhaps that will help us
figure out what's wrong.

Andrew

On 6 September 2010 10:41, Nand nandithab...@gmail.com wrote:
 Hi,
 Did you solve this stack corruption detected issue? Even I'm facing
 similar problem.

 Regards,
 Nand

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

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


Re: [android-developers] Tiles not showing up in android MapView

2010-09-06 Thread Mark Murphy
Either:

-- you have the wrong API key, or
-- you do not have the INTERNET permission, or
-- you do not have Internet access

On Mon, Sep 6, 2010 at 5:40 AM, Ajmer Singh ajmersing...@gmail.com wrote:
 Hi

 I want to use Mapview in my android app,problem is that i am not getting any
 map data(No Map tiles),it only shows grey lines. Plese let me know what i am
 doing wrong here,

 I am copying my Logcat Details here:

 09-04 11:36:21.519: INFO/ActivityManager(60): Starting activity: Intent {
 act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
 flg=0x1020 cmp=HelloMapView.com/.HelloMapView }
 09-04 11:36:21.989: ERROR/ActivityThread(254): Failed to find provider info
 for com.google.settings
 09-04 11:36:22.028: ERROR/ActivityThread(254): Failed to find provider info
 for com.google.settings
 09-04 11:36:22.469: WARN/MapActivity(254): Recycling dispatcher
 com.google.googlenav.datarequest.datarequestdispatc...@43d0dce0
 09-04 11:36:22.589: VERBOSE/MapActivity(254): Recycling map object.
 09-04 11:36:23.818: INFO/MapActivity(254): Handling network change
 notification:CONNECTED
 09-04 11:36:23.879: ERROR/MapActivity(254): Couldn't get connection factory
 client
 09-04 11:36:24.729: INFO/ActivityManager(60): Displayed activity
 HelloMapView.com/.HelloMapView: 3035 ms (total 3035 ms)

 Please help!
 --
 Thanks and Regards
 Ajmer Singh


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



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

Android Consulting: http://commonsware.com/consulting

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

2010-09-06 Thread perumal316
Hi All,

I am using the function decodeResource(Resources res, int id,
BitmapFactory.Options opt).

I am using it in the following way:

BitmapFactory.decodeResource(getResources(), R.drawable.image,opt);

My question is instead of using R.drawable.image which is an image in
res\drawable folder, I want to use a image from sdcard.

Is it possible? How to get the resource id of an image in the sdcard?

Thanks In Advance,
Perumal

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Capturing RAW data in Android 2.2(HTC Desire)

2010-09-06 Thread blindfold
 Thanks for the information... Where is ur application??

It was in my signature, or you can search the Market for
seeingwithsound.

The vOICe for Android
http://www.seeingwithsound.com/android.htm


On Sep 6, 11:18 am, uday uday.pic...@gmail.com wrote:
 Thanks for the information... Where is ur application??

 On Sep 6, 1:50 pm, blindfold seeingwithso...@gmail.com wrote:

   So you have hard coded in manifest.xml file for the field
   screenOrientation=landscape am i right??

  Yes.

   Do u able to get the correct preview in Landscape mode???

  Yes, just check my app.

  The vOICe for Androidhttp://www.seeingwithsound.com/android.htm

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


Re: [android-developers] Resource ID

2010-09-06 Thread Mark Murphy
On Mon, Sep 6, 2010 at 5:47 AM, perumal316 perumal...@gmail.com wrote:
 I am using the function decodeResource(Resources res, int id,
 BitmapFactory.Options opt).

 I am using it in the following way:

 BitmapFactory.decodeResource(getResources(), R.drawable.image,opt);

 My question is instead of using R.drawable.image which is an image in
 res\drawable folder, I want to use a image from sdcard.

 Is it possible? How to get the resource id of an image in the sdcard?

Images on the SD card are not resources, and therefore do not have
resource IDs. Use decodeFile(), please.

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

Android Consulting: http://commonsware.com/consulting

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

2010-09-06 Thread ytbryan
hi all,

if i want to let all my views be location aware, but i am going to
have say like map view, camera view and normal list view.

how should i go about doing this? should i have a main_activity class
that holds a location manager and let every view extends?

Sorry i am new with these.

Thanks!
bryan

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

2010-09-06 Thread perumal316
Thanks for the info!

Regards,
Perumal

On Sep 6, 5:50 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Sep 6, 2010 at 5:47 AM, perumal316 perumal...@gmail.com wrote:
  I am using the function decodeResource(Resources res, int id,
  BitmapFactory.Options opt).

  I am using it in the following way:

  BitmapFactory.decodeResource(getResources(), R.drawable.image,opt);

  My question is instead of using R.drawable.image which is an image in
  res\drawable folder, I want to use a image from sdcard.

  Is it possible? How to get the resource id of an image in the sdcard?

 Images on the SD card are not resources, and therefore do not have
 resource IDs. Use decodeFile(), please.

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

 Android Consulting:http://commonsware.com/consulting

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

2010-09-06 Thread dhrumil
Hello 2all,

I have developed one simple game application.
In that, the box is moving in all four directions. Now I want to
upgrade my game. So for that I just add one ball image on this
application. This ball image is bouncing all over the android screen.
I tried a lot but not able to upgrade my game. The only box is visible
on the screen and the ball image is not visible.

I want to display both of them on the screen.
How to do this?
Any suggestions.
Please anyone knows give me a reply.

~Dhrumil

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

2010-09-06 Thread ThomasWrobel
Having a little trouble working out how to have a context menu working
in my GLSurfaceView view.

There doesn't seem to be a onCreateOptionsMenu or
onOptionsItemSelected to override.

I do notice a setOnCreateContextMenuListener but I don't know how to
use it.

Anyone know?

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


Re: [android-developers] How to have a ContextMenu on a GLSurfaceView :?

2010-09-06 Thread Miguel Morales
Override those on your Activity class.

On Mon, Sep 6, 2010 at 3:52 AM, ThomasWrobel darkfl...@gmail.com wrote:
 Having a little trouble working out how to have a context menu working
 in my GLSurfaceView view.

 There doesn't seem to be a onCreateOptionsMenu or
 onOptionsItemSelected to override.

 I do notice a setOnCreateContextMenuListener but I don't know how to
 use it.

 Anyone know?

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

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


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Miguel Morales
How are you upgrading your game?

On Mon, Sep 6, 2010 at 3:28 AM, dhrumil dhrumilsh...@gmail.com wrote:
 Hello 2all,

 I have developed one simple game application.
 In that, the box is moving in all four directions. Now I want to
 upgrade my game. So for that I just add one ball image on this
 application. This ball image is bouncing all over the android screen.
 I tried a lot but not able to upgrade my game. The only box is visible
 on the screen and the ball image is not visible.

 I want to display both of them on the screen.
 How to do this?
 Any suggestions.
 Please anyone knows give me a reply.

 ~Dhrumil

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



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

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


[android-developers] Re: How to have a ContextMenu on a GLSurfaceView :?

2010-09-06 Thread ThomasWrobel
Override what? setOnCreateContextMenuListener ? Its parameters are
different.

On Sep 6, 12:54 pm, Miguel Morales therevolti...@gmail.com wrote:
 Override those on your Activity class.



 On Mon, Sep 6, 2010 at 3:52 AM, ThomasWrobel darkfl...@gmail.com wrote:
  Having a little trouble working out how to have a context menu working
  in my GLSurfaceView view.

  There doesn't seem to be a onCreateOptionsMenu or
  onOptionsItemSelected to override.

  I do notice a setOnCreateContextMenuListener but I don't know how to
  use it.

  Anyone know?

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

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


[android-developers] Autocomplete TextView doubt

2010-09-06 Thread grace
Hi,

I am Implementing one auto text view.
it looks fine in potrait mode but in landscape the soft keyboard
contains DONE button,with no functionality.nothing happens even if i
click done button .

is there any way to avoid that done button from virtual keyboard or
add functionality to it.
Please help..


Thanks in advance,
Grace.

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

2010-09-06 Thread Tauno Talimaa

 Hi all,

I'm seeing some strange crash reports in Android Market and I can't 
really tell how this could be caused by our application. The reason is 
always ClassNotFoundException or NoClassDefFoundError.
The exact traces come in various flavors and they have happened for a 
total of ~100 times - here's one (reported 37 times):


java.lang.RuntimeException: Unable to instantiate application 
com.company.product.MyApplication: java.lang.ClassNotFoundException: 
com.company.product.MyApplication in loader 
dalvik.system.PathClassLoader[/data/app-private/com.company.product-1.apk]
at 
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)
at 
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)

at android.app.ActivityThread.access$3000(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: 
com.company.product.MyApplication in loader 
dalvik.system.PathClassLoader[/data/app-private/com.company.product-1.apk]

at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at 
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)

... 11 more

We've tested the same .apk on a number of devices and we've never 
encountered issues like this - what could cause such issues in the first 
place - custom ROMs / broken devices / something that we're doing wrong? :/


Tauno

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


Re: [android-developers] ClassNotFoundException crash reports from Market

2010-09-06 Thread { Devdroid }
On 6 September 2010 13:28, Tauno Talimaa tau...@gmail.com wrote:
  Hi all,

 I'm seeing some strange crash reports in Android Market and I can't really
 tell how this could be caused by our application. The reason is always
 ClassNotFoundException or NoClassDefFoundError.
 The exact traces come in various flavors and they have happened for a total
 of ~100 times - here's one (reported 37 times):

What your app do? Is it calling any other application for example? If so,
ensure you do try/catch around startActivity() - users' device may not
have it at all.

 java.lang.RuntimeException: Unable to instantiate application
 com.company.product.MyApplication: java.lang.ClassNotFoundException:
   ^

you shouldn't name your classes that way unless you really own company.com
domain

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


Re: [android-developers] Re: How to have a ContextMenu on a GLSurfaceView :?

2010-09-06 Thread Miguel Morales
Override  onCreateOptionsMenu() in your activity class like so:

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
menu.add(0, 1, 0, Item1);
menu.add(0, 2, 0, Item1);
return true;
}

Should work automatically with your canvas view.

On Mon, Sep 6, 2010 at 4:18 AM, ThomasWrobel darkfl...@gmail.com wrote:
 Override what? setOnCreateContextMenuListener ? Its parameters are
 different.

 On Sep 6, 12:54 pm, Miguel Morales therevolti...@gmail.com wrote:
 Override those on your Activity class.



 On Mon, Sep 6, 2010 at 3:52 AM, ThomasWrobel darkfl...@gmail.com wrote:
  Having a little trouble working out how to have a context menu working
  in my GLSurfaceView view.

  There doesn't seem to be a onCreateOptionsMenu or
  onOptionsItemSelected to override.

  I do notice a setOnCreateContextMenuListener but I don't know how to
  use it.

  Anyone know?

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

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



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

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


Re: [android-developers] about android Reversepengineering !!!!

2010-09-06 Thread { Devdroid }
On 6 September 2010 09:09, xc s sxchao2...@gmail.com wrote:
 So Actually this no answer really? no any method?

No. No bullet proof methods. No Santa Claus.

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

2010-09-06 Thread Tez
In all these key interactions, (physical or
IME), am I correct in assuming that all data must pass thru the
Framework classes like WindowManagerService, KeyInputQueue etc?

-E

On Sep 6, 2:18 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Sep 6, 2010 at 12:37 AM, Tez earlencefe...@gmail.com wrote:
  So the KeyEvent Listener is only for physical keyboards?
  I see many devices that have only soft keyboards. This leads me to
  think What is the value of the Key Listener API then?

 It predated the IME system. Hence, if nothing else, it is still there
 to maintain binary compatibility.

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

 Android Consulting:http://commonsware.com/consulting

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


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
I developed one game its code is here:

*Testing.java*
*

package* com.paad.testing;

*

import* android.app.Activity;
*

import* android.os.Bundle;
*

import* android.os.Handler;
*

import* android.os.Message;
*

import* android.view.*;
*

import* android.graphics.*;
*

import* android.content.*;

*

public* *class* Testing *extends* Activity {

RandomView randomView = *null*;

*public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* = 1,
*DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

*protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

*private* Panel main;

*private* Bitmap scratch;

*private* Canvas offscreen;

*public* *boolean* start = *true*;

*private* *volatile* *boolean* running = *false*;

*private* *int* direction = *DIRECTION_RIGHT*;

*private* *int* boxx = 10;

*private* *int* boxy = 10;

Thread myRefreshThread = *null*;

Handler GUIUpdateHandler = *new* Handler() {

// @Override

*public* *void* handleMessage(Message msg) {

*switch* (msg.what) {

*case* Testing.*GUIUPDATEIDENTIFIER*:

randomView.invalidate();

*break*;

}

*super*.handleMessage(msg);

}

};

@Override

*public* *void* onCreate(Bundle savedInstanceState)

{

*super*.onCreate(savedInstanceState);

*this*.randomView = *new* RandomView(*this*);

*this*.setContentView(*this*.randomView);

(*new* Thread(*new* Refresh())).start();

setOffscreenBitmap();

main = *new* Panel(*this*);

setContentView(main,*new* ViewGroup.LayoutParams(320,480));

(*new* Thread(*new* AnimationLoop())).start();

}

*private* *void* setOffscreenBitmap()

{

scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

offscreen = *new* Canvas();

offscreen.setBitmap(scratch);

offscreen.drawColor(Color.*RED*);

}

*private* *synchronized* *void* updatePhysics()

{

*if*(boxx  10){

direction = *DIRECTION_RIGHT*;

}

*else* *if*(boxx  250){

direction = *DIRECTION_LEFT*;

}

*if*(boxy  10){

direction = *DIRECTION_DOWN*;

}

*else* *if*(boxy  350){

direction = *DIRECTION_UP*;

}

*if*(direction == *DIRECTION_RIGHT*){

boxx = boxx + 10;

}

*else* *if* (direction == *DIRECTION_LEFT*)

{

boxx = boxx - 10;

}

*else* *if*(direction == *DIRECTION_UP*){

boxy = boxy - 10;

}

*else* *if*(direction == *DIRECTION_DOWN*){

boxy = boxy + 10;

}

*else*{

//Do nothing

}

}

*private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

{

*if*(start)

{

canvas.drawColor(Color.*GREEN*);

canvas.drawBitmap(scratch,10,10,paint);

start = *false*;

}

*else
*

{

canvas.save();

canvas.clipRect(boxx,boxy,boxx+30,boxy+30);

canvas.drawColor(Color.*RED*);

canvas.drawBitmap(scratch,boxx,boxy,paint);

canvas.restore();

}

}

//@Override

*public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

*if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

*if*(running!=*true*){

running = *true*;

}

*else*{

running = *false*;

}

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

direction = *DIRECTION_LEFT*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

direction = *DIRECTION_RIGHT*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

direction = *DIRECTION_DOWN*;

}

*else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

direction = *DIRECTION_UP*;

}

*else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

finish();

}

*return* *true*;

}

*class* Panel *extends* View

{

Paint paint;

*public* Panel(Context context)

{

*super*(context);

paint = *new* Paint();

}

@Override

*protected* *void* onDraw(Canvas canvas)

{

doDraw(canvas,paint);

}

}

*class* AnimationLoop *implements* Runnable

{

*public* *void* run()

{

*while*(*true*)

{

*while*(running)

{

*try
*

{

Thread.*sleep*(100);

}

*catch*(InterruptedException ex) {}

updatePhysics();

main.postInvalidate();

}

}

}

}

*class* Refresh *implements* Runnable{

*public* *void* run(){

*while*(!Thread.*currentThread*().isInterrupted()){

Message message = *new* Message();

message.what = Testing.*GUIUPDATEIDENTIFIER*;

Testing.*this*.GUIUpdateHandler.sendMessage(message);

*try*{

Thread.*sleep*(100);

}

*catch* (Exception e) {

Thread.*currentThread*().interrupt();

}

}

}

}

}
my another class file:
*RandomView.java*

**
*

package* com.paad.testing;

*

import* android.content.Context;
*

import* android.graphics.Canvas;
*

import* android.graphics.Color;
*

import* android.graphics.Point;
*

import* android.graphics.drawable.Drawable;
*

import* android.view.View;

*

public* *class* RandomView *extends* View{

*protected* Drawable myPosition;

*protected* Point myPoint = *new* Point(10,10);

*protected* *enum* HorizontalDirection{*LEFT*,*RIGHT*}

*protected* *enum* VerticalDirection{*UP*,*DOWN*}

*protected* HorizontalDirection myXDirection = HorizontalDirection.*RIGHT*;

*protected* VerticalDirection myYDirection = VerticalDirection.*UP*;

*public* RandomView(Testing testing) {

*super*((Context)testing);

*this*.setBackgroundColor(Color.*BLUE*);

*this*.myPosition = *this*.getResources().getDrawable(R.drawable.*greenball*
);

}

*public* 

[android-developers] how to get number type for a contacts number..

2010-09-06 Thread A N K ! T
in my application
  it is opening phone contacts and when i choose one contact i can get all
detail of the contact but not getting the number type of numbers;
more specific  if the user have four numbers,,, i can get all number but
not getting number type of these numbers i.e. (HOME,WORK,MOBILE)


please let me know how to do it...


-- 

 A N K ! T..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Http chunked response and Connection Reset by Peer error

2010-09-06 Thread Cydrike
Cloud 2 Device Messaging seems to be very interesting but I can't use
it for many reasons.

I've explicitly tested returned value of Read() method to detect -1.
But it doesn't change anything.
My application has been developed for Windows Mobile 6.5 too. Windows
Mobile always detect the Connection Reset by Peer exception. Test
protocol is exactly the same as the one used for Android.
How could this difference be explained ?

Here's the code I use to create my request with Android:

HttpURLConnection connection = (HttpURLConnection) new
URL(request).openConnection();
connection.setDefaultUseCaches(false);
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setInstanceFollowRedirects(true);
connection.setConnectTimeout(CONNECT_TIMEOUT);
connection.setRequestMethod(GET);

Cédric


On 6 sep, 11:20, Kostya Vasilyev kmans...@gmail.com wrote:
   The server doing a graceful close can be detected on the client:
 read() will return -1.

 A lost connection (not gracefully closed) generally can't be detected on
 the client. TCP/IP does not transmit data unless your application does,
 so a lost connection looks the same as a connection that simply doesn't
 have any data to receive.

 There is a TCP/IP option to do keepalives at the protocol level,
 SO_KEEPALIVE, but I wouldn't count on it working reliably all the way
 from the phone to the server.

 I recommend you look at Google C2DM (Cloud 2 Device Messaging).

 -- Kostya

 06.09.2010 11:37, Cydrike пишет:





  Hi everyone,

  I'm facing an annoying problem here.
  My application is connected to a server that sends some data from time
  to time. It's some kind of eventing server. In order to receive data,
  I'm connecting to the server with an HttpURLConnection, retrieve the
  response InputStream and loop on it with the read method. The
  connection is always open.

  The distant server is cutting the connection every 5 minutes (for test
  purpose). When connection is closed, my application has to reconnect
  again. We detect a Connection Reset by Peer exception when the server
  closes the connection. The problem is that most of the time, I never
  receive the Connection Reset by Peer exception. So my application
  can't know that is has to reconnect and it's stucked on the read
  instruction.

  The InputStream.Read() method shouldn't always raise an exception if
  the connection is closed?
  What can I do to always detect Connection Reset by Peer exception?

  Thanks for any help,

  Android 2.1
  HTC Desire

  Cédric

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com- Masquer le texte des messages précédents -

 - Afficher le texte des messages précédents -

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


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Sandeep Phansekar
Hi

Just Change the *android:versionCode=1.1*  present in the mainfest.xml
file

regards
sandeep


On Mon, Sep 6, 2010 at 5:39 PM, Dhrumil Shah dhrumilsh...@gmail.com wrote:

 I developed one game its code is here:

 *Testing.java*
 *

 package
 * com.paad.testing;

 *

 import
 * android.app.Activity;*

 import
 * android.os.Bundle;*

 import
 * android.os.Handler;*

 import
 * android.os.Message;*

 import
 * android.view.*;*

 import
 * android.graphics.*;*

 import
 * android.content.*;

 *

 public
 * *class* Testing *extends* Activity {

 RandomView
 randomView = *null*;

 *public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* =
 1, *DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

 *protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

 *private* Panel main;

 *private* Bitmap scratch;

 *private* Canvas offscreen;

 *public* *boolean* start = *true*;

 *private* *volatile* *boolean* running = *false*;

 *private* *int* direction = *DIRECTION_RIGHT*;

 *private* *int* boxx = 10;

 *private* *int* boxy = 10;

 Thread
 myRefreshThread = *null*;

 Handler
 GUIUpdateHandler = *new* Handler() {

 // @Override

 *public* *void* handleMessage(Message msg) {

 *switch* (msg.what) {

 *case* Testing.*GUIUPDATEIDENTIFIER*:

 randomView.invalidate();

 *break*;

 }

 *super*.handleMessage(msg);

 }

 };

 @Override

 *public* *void* onCreate(Bundle savedInstanceState)

 {

 *super*.onCreate(savedInstanceState);

 *this*.randomView = *new* RandomView(*this*);

 *this*.setContentView(*this*.randomView);

 (
 *new* Thread(*new* Refresh())).start();

 setOffscreenBitmap();

 main = *new* Panel(*this*);

 setContentView(
 main,*new* ViewGroup.LayoutParams(320,480));

 (
 *new* Thread(*new* AnimationLoop())).start();

 }

 *private* *void* setOffscreenBitmap()

 {

 scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

 offscreen = *new* Canvas();

 offscreen.setBitmap(scratch);

 offscreen.drawColor(Color.*RED*);

 }

 *private* *synchronized* *void* updatePhysics()

 {

 *if*(boxx  10){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(boxx  250){

 direction = *DIRECTION_LEFT*;

 }

 *if*(boxy  10){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if*(boxy  350){

 direction = *DIRECTION_UP*;

 }

 *if*(direction == *DIRECTION_RIGHT*){

 boxx = boxx + 10;

 }

 *else* *if* (direction == *DIRECTION_LEFT*)

 {

 boxx = boxx - 10;

 }

 *else* *if*(direction == *DIRECTION_UP*){

 boxy = boxy - 10;

 }

 *else* *if*(direction == *DIRECTION_DOWN*){

 boxy = boxy + 10;

 }

 *else*{

 //Do nothing

 }

 }

 *private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

 {

 *if*(start)

 {

 canvas.drawColor(Color.
 *GREEN*);

 canvas.drawBitmap(
 scratch,10,10,paint);

 start = *false*;

 }

 *else*

 {

 canvas.save();

 canvas.clipRect(
 boxx,boxy,boxx+30,boxy+30);

 canvas.drawColor(Color.
 *RED*);

 canvas.drawBitmap(
 scratch,boxx,boxy,paint);

 canvas.restore();

 }

 }

 //@Override

 *public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

 *if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

 *if*(running!=*true*){

 running = *true*;

 }

 *else*{

 running = *false*;

 }

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

 direction = *DIRECTION_LEFT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

 direction = *DIRECTION_UP*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

 finish();

 }

 *return* *true*;

 }

 *class* Panel *extends* View

 {

 Paint
 paint;

 *public* Panel(Context context)

 {

 *super*(context);

 paint = *new* Paint();

 }

 @Override

 *protected* *void* onDraw(Canvas canvas)

 {

 doDraw(canvas,
 paint);

 }

 }

 *class* AnimationLoop *implements* Runnable

 {

 *public* *void* run()

 {

 *while*(*true*)

 {

 *while*(running)

 {

 *try*

 {

 Thread.*sleep*(100);

 }

 *catch*(InterruptedException ex) {}

 updatePhysics();

 main.postInvalidate();

 }

 }

 }

 }

 *class* Refresh *implements* Runnable{

 *public* *void* run(){

 *while*(!Thread.*currentThread*().isInterrupted()){

 Message message =
 *new* Message();

 message.
 what = Testing.*GUIUPDATEIDENTIFIER*;

 Testing.
 *this*.GUIUpdateHandler.sendMessage(message);

 *try*{

 Thread.*sleep*(100);

 }

 *catch* (Exception e) {

 Thread.*currentThread*().interrupt();

 }

 }

 }

 }

 }
 my another class file:
 *RandomView.java*

 **
 *

 package
 * com.paad.testing;

 *

 import
 * android.content.Context;*

 import
 * android.graphics.Canvas;*

 import
 * android.graphics.Color;*

 import
 * android.graphics.Point;*

 import
 * android.graphics.drawable.Drawable;*

 import
 * android.view.View;

 *

 public
 * *class* RandomView *extends* View{

 *protected* Drawable myPosition;

 *protected* Point myPoint = *new* Point(10,10);

 *protected* *enum* 

Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread Dhrumil Shah
Hi Sandeep,

I try to change it, but it shows an error like this:

error: Error: Float types not allowed (at 'versionCode' with value '1.1').
~Dhrumil

On Mon, Sep 6, 2010 at 5:59 PM, Sandeep Phansekar 
sandeep.phanse...@gmail.com wrote:

 Hi

 Just Change the *android:versionCode=1.1*  present in the mainfest.xml
 file

 regards
 sandeep


   On Mon, Sep 6, 2010 at 5:39 PM, Dhrumil Shah dhrumilsh...@gmail.comwrote:

   I developed one game its code is here:

 *Testing.java*
 *

 package
 *com.paad.testing;

 *

 import
 *android.app.Activity;*

 import
 *android.os.Bundle;*

 import
 *android.os.Handler;*

 import
 *android.os.Message;*

 import
 *android.view.*;*

 import
 *android.graphics.*;*

 import
 *android.content.*;

 *

 public
 **class* Testing *extends* Activity {

 RandomView
 randomView = *null*;

 *public* *static* *final* *int* *DIRECTION_RIGHT* = 0, *DIRECTION_LEFT* =
 1, *DIRECTION_DOWN* = 2, *DIRECTION_UP* = 3;

 *protected* *static* *final* *int* *GUIUPDATEIDENTIFIER* = 0x101;

 *private* Panel main;

 *private* Bitmap scratch;

 *private* Canvas offscreen;

 *public* *boolean* start = *true*;

 *private* *volatile* *boolean* running = *false*;

 *private* *int* direction = *DIRECTION_RIGHT*;

 *private* *int* boxx = 10;

 *private* *int* boxy = 10;

 Thread
 myRefreshThread = *null*;

 Handler
 GUIUpdateHandler = *new* Handler() {

 // @Override

 *public* *void* handleMessage(Message msg) {

 *switch* (msg.what) {

 *case* Testing.*GUIUPDATEIDENTIFIER*:

 randomView.invalidate();

 *break*;

 }

 *super*.handleMessage(msg);

 }

 };

 @Override

 *public* *void* onCreate(Bundle savedInstanceState)

 {

 *super*.onCreate(savedInstanceState);

 *this*.randomView = *new* RandomView(*this*);

 *this*.setContentView(*this*.randomView);

 (
 *new* Thread(*new* Refresh())).start();

 setOffscreenBitmap();

 main = *new* Panel(*this*);

 setContentView(
 main,*new* ViewGroup.LayoutParams(320,480));

 (
 *new* Thread(*new* AnimationLoop())).start();

 }

 *private* *void* setOffscreenBitmap()

 {

 scratch = Bitmap.*createBitmap*(30,30,Bitmap.Config.*ARGB_*);

 offscreen = *new* Canvas();

 offscreen.setBitmap(scratch);

 offscreen.drawColor(Color.*RED*);

 }

 *private* *synchronized* *void* updatePhysics()

 {

 *if*(boxx  10){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(boxx  250){

 direction = *DIRECTION_LEFT*;

 }

 *if*(boxy  10){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if*(boxy  350){

 direction = *DIRECTION_UP*;

 }

 *if*(direction == *DIRECTION_RIGHT*){

 boxx = boxx + 10;

 }

 *else* *if* (direction == *DIRECTION_LEFT*)

 {

 boxx = boxx - 10;

 }

 *else* *if*(direction == *DIRECTION_UP*){

 boxy = boxy - 10;

 }

 *else* *if*(direction == *DIRECTION_DOWN*){

 boxy = boxy + 10;

 }

 *else*{

 //Do nothing

 }

 }

 *private* *synchronized* *void* doDraw(Canvas canvas, Paint paint)

 {

 *if*(start)

 {

 canvas.drawColor(Color.
 *GREEN*);

 canvas.drawBitmap(
 scratch,10,10,paint);

 start = *false*;

 }

 *else*

 {

 canvas.save();

 canvas.clipRect(
 boxx,boxy,boxx+30,boxy+30);

 canvas.drawColor(Color.
 *RED*);

 canvas.drawBitmap(
 scratch,boxx,boxy,paint);

 canvas.restore();

 }

 }

 //@Override

 *public* *boolean* onKeyDown(*int* keyCode, KeyEvent event){

 *if*(keyCode == KeyEvent.*KEYCODE_DPAD_CENTER*){

 *if*(running!=*true*){

 running = *true*;

 }

 *else*{

 running = *false*;

 }

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_LEFT*){

 direction = *DIRECTION_LEFT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_RIGHT*){

 direction = *DIRECTION_RIGHT*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_DPAD_DOWN*){

 direction = *DIRECTION_DOWN*;

 }

 *else* *if* (keyCode == KeyEvent.*KEYCODE_DPAD_UP*){

 direction = *DIRECTION_UP*;

 }

 *else* *if*(keyCode == KeyEvent.*KEYCODE_BACK*){

 finish();

 }

 *return* *true*;

 }

 *class* Panel *extends* View

 {

 Paint
 paint;

 *public* Panel(Context context)

 {

 *super*(context);

 paint = *new* Paint();

 }

 @Override

 *protected* *void* onDraw(Canvas canvas)

 {

 doDraw(canvas,
 paint);

 }

 }

 *class* AnimationLoop *implements* Runnable

 {

 *public* *void* run()

 {

 *while*(*true*)

 {

 *while*(running)

 {

 *try*

 {

 Thread.*sleep*(100);

 }

 *catch*(InterruptedException ex) {}

 updatePhysics();

 main.postInvalidate();

 }

 }

 }

 }

 *class* Refresh *implements* Runnable{

 *public* *void* run(){

 *while*(!Thread.*currentThread*().isInterrupted()){

 Message message =
 *new* Message();

 message.
 what = Testing.*GUIUPDATEIDENTIFIER*;

 Testing.
 *this*.GUIUpdateHandler.sendMessage(message);

 *try*{

 Thread.*sleep*(100);

 }

 *catch* (Exception e) {

 Thread.*currentThread*().interrupt();

 }

 }

 }

 }

 }
 my another class file:
 *RandomView.java*

 **
 *

 package
 *com.paad.testing;

 *

 import
 *android.content.Context;*

 import
 *android.graphics.Canvas;*

 import
 *android.graphics.Color;*

 import
 *android.graphics.Point;*

 import
 

[android-developers] Re: how to get number type for a contacts number..

2010-09-06 Thread Namrata
see if this helps..ContactsContract.PhoneLookupColumns or
ContactsContract.CommonDataKinds.PhoneI haven't used it as it is a
api level =5 but have used something like this for api level 4.


On Sep 6, 5:27 pm, A N K ! T ankit.awasth...@gmail.com wrote:
 in my application
   it is opening phone contacts and when i choose one contact i can get all
 detail of the contact but not getting the number type of numbers;
 more specific  if the user have four numbers,,, i can get all number but
 not getting number type of these numbers i.e. (HOME,WORK,MOBILE)

 please let me know how to do it...

 --

  A N K ! T..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 does Android determine whether to move the layout up when showing the softkeyboard?

2010-09-06 Thread Mathias Lin
How does Android determine whether to move the layout up when showing
the softkeyboard?

Note: I am aware that the activity property
android:windowSoftInputMode=adjustResize|adjustResize|
adjustUnspecified exists, as described here
http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
, but in my case it doesn't seem to have any effect. This is my
problem:

I have two activities, pretty much the same layout, but the first one
is using a ListView that holds a list of buttons. The second activity
holds a scrollview with buttons. The rest is the same, same number of
buttons, same height of elements, etc. (All elements fit on the
screen, so actually the user doesn't need to scroll in the scrollview
or listview.)
Please see my screenshot to get an idea: http://i.imgur.com/UNXPz.png

Now, when I press the search button to open the search input bar, in
my first activity, the entire layouts gets moved up. While on the
second activity, the layout is not being moved up but the softkeyboard
just displays on top of it. This is actually how I want it to behave.
How can I achieve the same with my activity that's using the ListView?

In my manifest, initially I didn't specify any
android:windowSoftInputMode attribute, but even if I do, it doesn't
make any difference; I tried all three values (adjustPan,
adjustResize, adjustUndefined, without any difference).

This is my layout:
http://i.imgur.com/UNXPz.png

(I'm not posting any code here for now, I'm more interested generally
how it's been exactly determined whether Android moves the layout up
or just displays they softkeyboard right on top of the existing layout
without moving it.)

I couldn't find a specific logic that's been followed. When I reduce
the number of buttons, when I even wrap the listView in a ScrollView
(just for the sake of trying to see what's happening), the layout just
won't stay fix.
On the other hand then, I have activities in my app that contain only
one large ListView, and on that one the layout also remains fixed.
First I thought it's related to ListViews, but it seems not to.

btw: nowhere in my manifest am I explicitly specifying the
windowSoftInputMode attribute.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Http chunked response and Connection Reset by Peer error

2010-09-06 Thread Cydrike
Cloud 2 Device Messaging seems to be very interesting but I can't use
it for many reasons.

I've explicitly tested returned value of Read() method to detect -1.
But it doesn't change anything.
My application has been developed for Windows Mobile 6.5 too. Windows
Mobile always detect the Connection Reset by Peer exception. Test
protocol is exactly the same as the one used for Android.
How could this difference be explained ?

Here's the code I use to create my request with Android:

HttpURLConnection connection = (HttpURLConnection) new
URL(request).openConnection();
connection.setDefaultUseCaches(false);
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setInstanceFollowRedirects(true);
connection.setConnectTimeout(CONNECT_TIMEOUT);
connection.setRequestMethod(GET);

Cédric

On 6 sep, 11:20, Kostya Vasilyev kmans...@gmail.com wrote:
   The server doing a graceful close can be detected on the client:
 read() will return -1.

 A lost connection (not gracefully closed) generally can't be detected on
 the client. TCP/IP does not transmit data unless your application does,
 so a lost connection looks the same as a connection that simply doesn't
 have any data to receive.

 There is a TCP/IP option to do keepalives at the protocol level,
 SO_KEEPALIVE, but I wouldn't count on it working reliably all the way
 from the phone to the server.

 I recommend you look at Google C2DM (Cloud 2 Device Messaging).

 -- Kostya

 06.09.2010 11:37, Cydrike пишет:





  Hi everyone,

  I'm facing an annoying problem here.
  My application is connected to a server that sends some data from time
  to time. It's some kind of eventing server. In order to receive data,
  I'm connecting to the server with an HttpURLConnection, retrieve the
  response InputStream and loop on it with the read method. The
  connection is always open.

  The distant server is cutting the connection every 5 minutes (for test
  purpose). When connection is closed, my application has to reconnect
  again. We detect a Connection Reset by Peer exception when the server
  closes the connection. The problem is that most of the time, I never
  receive the Connection Reset by Peer exception. So my application
  can't know that is has to reconnect and it's stucked on the read
  instruction.

  The InputStream.Read() method shouldn't always raise an exception if
  the connection is closed?
  What can I do to always detect Connection Reset by Peer exception?

  Thanks for any help,

  Android 2.1
  HTC Desire

  Cédric

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com- Masquer le texte des messages précédents -

 - Afficher le texte des messages précédents -

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


Re: [android-developers] Upgrade my Game Application

2010-09-06 Thread { Devdroid }
On 6 September 2010 14:42, Dhrumil Shah dhrumilsh...@gmail.com wrote:
 Hi Sandeep,

 I try to change it, but it shows an error like this:

 error: Error: Float types not allowed (at 'versionCode' with value '1.1').

You should not change things you do not understand in hope it will work
even you do not know why. There's clear error message quoted above
and there's manual you shall read to get what value is valid there:
http://developer.android.com/guide/publishing/versioning.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] onClickListener for on a listView

2010-09-06 Thread kingh32
Hello

I've got some code that pulls pulls in data from a database via a PHP
service layer using JSON etc and displays it as a listview.
It works and I'm very happy with it - but I wanted to add an
onClickListener to it.

I know how to do it for buttons but its proving more difficult for the
list view.

I basically want it to take the ID taken from the JSON and put it into
an intent to another activity.

This is my class...

public class OnlineScores extends Activity
{
/** ListView that holds item references */
ListView li;

/**
 *Array adapter that will hold an ArrayList of invoked items
 *and display these in the ListView
 */
EventAdapter arrayAdapter;
String eventURL;

/** Houses the invoked items */
ArrayListEvent a = new ArrayListEvent();
@Override

/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.lmain);
Intent intent = this.getIntent();
Bundle b = intent.getExtras();
eventURL = b.getString(URL);

//Initialise ListView
li=(ListView)findViewById(R.id.lstText);
arrayAdapter = new 
EventAdapter(OnlineScores.this,R.layout.list,a);

// Set above adapter for the ArrayList
li.setAdapter(arrayAdapter);

// Create an object of the GetData class
GetData g = new GetData();
String response = g.getIt(,,eventURL);

try
{
// Put JSON response into an object
Type collectionType = new TypeTokenArrayListEvent()
{}.getType();

List Event lst= new Gson().fromJson(response, 
collectionType);

for(Event l : lst)
{
a.add(l);
}
// Inform the ArrayAdapter of the change from ArrayList 
to List
arrayAdapter.notifyDataSetChanged();
}
catch(Exception e)
{

}
}
}

I'm trying to implement this...

lstText.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
 @Override
 public void onItemClick(AdapterView? a, View v, int 
position,
long id)
 {
 // Do stuff here
 }
 });

but I'm being told to remove the @Override statement AND to inherit
abstract methods.

Any 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] soap in android

2010-09-06 Thread vineeshkc
pls tell about using web service by using  ksoap in android

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

[android-developers] Market alternatives

2010-09-06 Thread mort
Hi,

it seems like the number of alternative markets is exploding recently.
Every other week I seem to get another invitation.
Even in Germany, which is one of the few countries where you can pay
and receive payments, (at least?) three big alternative markets were
opened within the last few months.
While I can understand why there are so many alternatives, I'm a bit
concerned about this trend. I'd prefer *not* having to upload my app
to about two dozens of alternative stores with different registration
requirements, payment options, and languages I only partially
understand thanks to Google Translate.

Sometimes I wonder why Google even bothered to start an own
centralized Market if at the end of the day
- developers need to upload their apps to more stores than ever
existed for Palm and Windows Mobile (combined)
- people in most countries can't pay for apps, and in even more
countries can't receive money for their apps (not to mention the
available payment possibilities aren't common in all of the supported
countries...)
- users have to know the exact name of the desired app to find it, or
need either forums or lots of luck to find one fitting their needs
(nitpicking search that wouldn't find markets if you searched for
market, no keywords, no filters, no sorting of search results, ...)
- lots of devices are excluded because they miss required hardware
- apps temporarily vanish for some users every now and again

The only advantage Google's Market seems to have is that it actually
regards other limitations than the Android version, like supports-
screens, uses-feature/-configuration, etc., unlike most alternatives.
But this advantage's spoiled as well if users prefer the alternatives.

How's your response to the Market fragmentation? Do you still upload
only to Google's Market to simplify updates, support a single place to
go, and hope it get's better one day? Do you support some selected
alternatives? (Which ones and why?) Or any alternative you get to know
and are able to support?

Regards,
Mort

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


Re: [android-developers] ClassNotFoundException crash reports from Market

2010-09-06 Thread Tauno Talimaa
 What your app do? Is it calling any other application for example? If so,
 ensure you do try/catch around startActivity() - users' device may not
 have it at all.

No, I don't start any external activities.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 does Android determine whether to move the layout up when showing the softkeyboard?

2010-09-06 Thread Mathias Lin
Interestingly though: when I set my ListView visibility to
View.INVISIBLE in my first activity, then the layout doesn not get
moved up anymore!

This is my layout/xml:

1) http://pastebin.com/5zzVxjbK
ListView where layouts is been moved up by the softkeyboard

2) http://pastebin.com/KFtPuHvP
ScrollView/LinearLayout, where layout remains fix by the softkeyboard



On Sep 6, 8:48 pm, Mathias Lin m...@mathiaslin.com wrote:
 How does Android determine whether to move the layout up when showing
 the softkeyboard?

 Note: I am aware that the activity property
 android:windowSoftInputMode=adjustResize|adjustResize|
 adjustUnspecified exists, as described 
 herehttp://developer.android.com/guide/topics/manifest/activity-element.h...
 , but in my case it doesn't seem to have any effect. This is my
 problem:

 I have two activities, pretty much the same layout, but the first one
 is using a ListView that holds a list of buttons. The second activity
 holds a scrollview with buttons. The rest is the same, same number of
 buttons, same height of elements, etc. (All elements fit on the
 screen, so actually the user doesn't need to scroll in the scrollview
 or listview.)
 Please see my screenshot to get an idea:http://i.imgur.com/UNXPz.png

 Now, when I press the search button to open the search input bar, in
 my first activity, the entire layouts gets moved up. While on the
 second activity, the layout is not being moved up but the softkeyboard
 just displays on top of it. This is actually how I want it to behave.
 How can I achieve the same with my activity that's using the ListView?

 In my manifest, initially I didn't specify any
 android:windowSoftInputMode attribute, but even if I do, it doesn't
 make any difference; I tried all three values (adjustPan,
 adjustResize, adjustUndefined, without any difference).

 This is my layout:http://i.imgur.com/UNXPz.png

 (I'm not posting any code here for now, I'm more interested generally
 how it's been exactly determined whether Android moves the layout up
 or just displays they softkeyboard right on top of the existing layout
 without moving it.)

 I couldn't find a specific logic that's been followed. When I reduce
 the number of buttons, when I even wrap the listView in a ScrollView
 (just for the sake of trying to see what's happening), the layout just
 won't stay fix.
 On the other hand then, I have activities in my app that contain only
 one large ListView, and on that one the layout also remains fixed.
 First I thought it's related to ListViews, but it seems not to.

 btw: nowhere in my manifest am I explicitly specifying the
 windowSoftInputMode attribute.

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

2010-09-06 Thread Yahel
My small experience on the matters tells me : It's not worth the
trouble :s

Posted my app on six or seven alternative stores last week, all
different forms, legals, terms, shapes : A good 10 downloads peek from
it(all combined) :D

This morning, posted an update on the Android Market : 600 downloads
in 4 hours ...

The only one I might find interesting to try to post to, and I'm going
to try it just now is the Archos one...Since just like on our devices,
they have the icon right there on the home screen and that there is a
lot less apps...Might do some good. I'll keep you posted.

Yahel

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

2010-09-06 Thread redehm
I am experiencing something similar, except on a sporadic basis.

For the most part, my application, on receipt of an ACTION_MEDIA_EJECT
event, is able to close files and return before the reaper arrives to
clean-up.  However, sometimes, when the application is writing data to
one of the files, the reaper appears and kills the application before
it has a chance to finish writing and close the file.  This results in
data corrupted on the SD card.

Any suggestions for a solution?  According to LogCat, it looks like
the reaper is unleashed around 1 second after ACTION_MEDIA_EJECT is
received.  Do I have to ensure that all clean-up happens within that
time period?  Yikes!

On Jul 11, 2:23 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 Register your broadcast receiver like this:

 IntentFilter intentFilter = new
 IntentFilter(Intent.ACTION_MEDIA_EJECT);
 intentFilter.addAction(Intent.ACTION_MEDIA_MOUNTED);
 intentFilter.addDataScheme(file);
 intentFilter.addDataAuthority(*, null);
 intentFilter.addDataPath((mIsExternal
                            ?CursorUtils.EXTERNAL_STORAGE_ROOT
                            :CursorUtils.PHONE_STORAGE_ROOT).getAbsolutePath(),
 PatternMatcher.PATTERN_LITERAL);
 context.registerReceiver(this, intentFilter);

 Then close all your files when you get an ACTION_MEDIA_EJECT
 and re-open them (if necessary) on ACTION_MEDIA_MOUNTED.
 (in the 'public void onReceive(Context context, Intent intent)' method
 of this broadcast receiver).

 (EXTERNAL_STORAGE_ROOT is the standard value for external-storage
 (usually /sdcard) and PHONE_STORAGE_ROOT is /emmc (for HTC
 Incredible and such phones)).

 I'm not sure if this is the 'official' way of doing it, but it works
 for me. :)

 On Jul 10, 3:50 pm, ls02 agal...@audible.com wrote:

  I register for this broadcast. However theprocessis killed before I
  receive any broadcast event.

  On Jul 10, 2:59 pm, Dianne Hackborn hack...@android.com wrote:

   There is a broadcast sent when theSDcardis being unmounted (sorry I don't
   remember the name off-hand).  You should close all your files at that 
   point.
    If you don't, the platform needs tokilltheprocessbecause Linux can't
   unmount the file system while any files remain open on it.

   On Sat, Jul 10, 2010 at 10:35 AM, ls02 agal...@audible.com wrote:
I found that Android kills my appprocessthat has files open onSD
   cardwhen thecardis mounted when the device connects to a computer.
It is done without any notification, I see in the log something like
KillProcessWithFilesOpenedOnCard message, my app receives no
notification, has no chance to gracefully shutdown. Moreover Android
restarts my app immediately after killing it with latest Activity not
the default activity launched in default standard mode. It does it
while thecardis still mounted and device is still connected to a
computer.

Can someone explain this all to me, how it I supposed to work, and if
there is any way to alter this weird rude behavior? Particularly, if
there is way to get any notification before theprocessis killed by
the OS and to prevent relaunching it while thecardis still mounted?

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

   --
   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, and so won't reply to such e-mails.  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] Recommendation for an Application with tons of media files

2010-09-06 Thread Sebastián Treu
Hi all,

What will be the best storage choice for an application with huge
amount of mb in media? The application will not be in android market.

First choice was to use assets/ folder. At least, 160MB of audio is
shipped with the application. When I moved all the media to the
assets/ folder, I end up with:

Conversion to Dalvik format failed: Unable to execute dex: null

And reading: http://code.google.com/p/android/issues/detail?id=2328
suggest me that maybe it's not such a good idea to ship all the media
in an .apk file. I think that the problem has nothing to do with large
.java files, as it arises when I copy the bunch of audio to assets/.

I was thinking in using the sd card storage. But, I don't want the
user to accidentally remove the media files. I want it to be private,
not accesible to possible deletions. So, another approach is to use
the private storage and download the media in the application first
run, or something like that.

What would you suggest in such case? I have little experience in
android development yet, and I'm trying to take the pros and cons
about it, for then make the best choice.

Best regards
-- 
If you want freedom, compile the source.

Sebastián Treu
http://labombiya.com.ar

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


Re: [android-developers] Re: Bug in minSdkVersion or what?

2010-09-06 Thread Adal
That's right.

On Mon, Sep 6, 2010 at 4:54 AM, Dianne Hackborn hack...@android.com wrote:

 the Tattoo (which I think doesn't have an auto-focus camera...  though of
 course I may be wrong).

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

Re: [android-developers] Re: How to have a ContextMenu on a GLSurfaceView :?

2010-09-06 Thread Thomas Wrobel
Thanks I got it sorted now :)
I knew how to create a menu, but I thought I could just create a menu
on another view in order to have it view-specific.
I didn't spot I could just get the parameter of the view that triggered it.
Cheers,


On 6 September 2010 14:02, Miguel Morales therevolti...@gmail.com wrote:
 Override  onCreateOptionsMenu() in your activity class like so:

 @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        menu.add(0, 1, 0, Item1);
        menu.add(0, 2, 0, Item1);
        return true;
    }

 Should work automatically with your canvas view.

 On Mon, Sep 6, 2010 at 4:18 AM, ThomasWrobel darkfl...@gmail.com wrote:
 Override what? setOnCreateContextMenuListener ? Its parameters are
 different.

 On Sep 6, 12:54 pm, Miguel Morales therevolti...@gmail.com wrote:
 Override those on your Activity class.



 On Mon, Sep 6, 2010 at 3:52 AM, ThomasWrobel darkfl...@gmail.com wrote:
  Having a little trouble working out how to have a context menu working
  in my GLSurfaceView view.

  There doesn't seem to be a onCreateOptionsMenu or
  onOptionsItemSelected to override.

  I do notice a setOnCreateContextMenuListener but I don't know how to
  use it.

  Anyone know?

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

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



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

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] My app gets killed because of android.process.media getting killed by OS

2010-09-06 Thread tony obrien
Hi,

I have seen one reference to this sort of problem where a MAIN app
dies because :::

because provider com.android.providers.media.MediaProvider is in
dying process android.process.media

In that reference the implication was that if you held a CURSOR too
long  this could happen.

I am not using any explicit cursor, but maybe there is an implied one
somehere?

Hopefully these code snips will provide someone enough incite to offer
a solution.

I use a RINGTONE PICKER ==

String uri = null;
Intent intent = new
Intent( RingtoneManager.ACTION_RINGTONE_PICKER);
 
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TYPE,
RingtoneManager.TYPE_NOTIFICATION);
 
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TITLE, Select Tone);
if( uri != null)
{
 
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
Uri.parse( uri));
}

else
{
 
intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
(Uri)null);
}
startActivityForResult( intent,
Set_Ringtone);


And catch the result

@Override
public void onActivityResult(int reqCode, int resultCode, Intent
data) {
super.onActivityResult(reqCode, resultCode, data);

if (resultCode == RESULT_OK) {
Uri uri =
data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
if (uri != null) {
MainActivity.ringTonePath = uri.toString();
}

}
}

At some time later, I call a sound class to play the selected
ringtone :::

Ringtone myr =  RingtoneManager.getRingtone(context,
Uri.parse( MainActivity.ringTonePath));
if (MainActivity.doDebug) Log.d(FPH, clsSound:Play
RINGTONE);
myr.play();
return;

This is called repeatedly while a flag is TRUE (until the user sets it
FALSE)

At this point the App is sitting essentially idle  --- and if the
android.process.media dies (say by force) then so do I. But I do not
understand why I should die.

Any ideas?
thanks,
tob



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

2010-09-06 Thread Andy
Hi everyone,

Does anyone know of a direct api that allows access to CPU usage
statistics for different applications/tasks running inside android?
All I can find is data available by accessing a file /proc/stat  but
this seems a little cumbersome. ActivityManager holds data about
processes/tasks etc but no CPU usage stats.

Many thanks for any help.

Andy

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

2010-09-06 Thread Maps.Huge.Info (Maps API Guru)
If you want to do it from the shell, just use top.

-John Coryat

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

2010-09-06 Thread greg
Did you want the 1$ and 2$ inside the field width specifications?

On Sep 6, 3:27 am, GPU gopuraj...@gmail.com wrote:
 Hi ,
 passing two int values m =0  s = 11, to below function
 String formatted = String.format(%1$02d:%2$02d, m, s);

 returning the value like   .0:11 ,What could be the problem  ?

 m=0, s=11   --   .0:11
 m=0, s=1    --    .0:.1

 The 0 added to format the string always coming as '.' (dot).

 Can anyone know ,from where the number patterns are getting loaded in
 Android ?

 I gone thorough the code ,Its related the following file ,
 android\dalvik\libcore\icu\src\main\java\com\ibm\icu4jni\util
 \Resources.java -localeData.numberPattern

 How the pattern for particular locale is loaded ,what could be the
 problem for the above problem?

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


[android-developers] Re: CPU usage stats

2010-09-06 Thread Andy
Thats great thanks but I want to access these stats from inside a
running Activity...just wondered if there was a direct api to use.

Regards,

Andy



On Sep 6, 5:02 pm, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
wrote:
 If you want to do it from the shell, just use top.

 -John Coryat

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


Re: [android-developers] Recommendation for an Application with tons of media files

2010-09-06 Thread Frank Weiss
 I was thinking in using the sd card storage.

That's a good idea.

 But, I don't want the
 user to accidentally remove the media files. I want it to be private,
 not accesible to possible deletions.

How might a user accidently remove them? Why is this a concern?

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

2010-09-06 Thread ThomasWrobel
I love the fact theres loads of markets. While yes, it is, more work
for the developer to submit too, its
far better in the long run for the consumers and the whole android
ecosystem.

Markets can experiment with different layouts, styles, ratings, and
specialties. This is only just starting really
but should become a big thing in the long run.
With the huge amount of rubbish submitted, how do you get results
relevant to what the consumer is searching for? To me that seems a
problem just as big as search ever was, and isn't going to be fully
solved by any one company.

Google's own market leaves a lot to be desired, but that only
highlights how great it is that people can come up with alternatives.
Of course, not many of the alternatives are any good, but it is early
days still really.

On Sep 6, 4:10 pm, Yahel kaye...@gmail.com wrote:
 My small experience on the matters tells me : It's not worth the
 trouble :s

 Posted my app on six or seven alternative stores last week, all
 different forms, legals, terms, shapes : A good 10 downloads peek from
 it(all combined) :D

 This morning, posted an update on the Android Market : 600 downloads
 in 4 hours ...

 The only one I might find interesting to try to post to, and I'm going
 to try it just now is the Archos one...Since just like on our devices,
 they have the icon right there on the home screen and that there is a
 lot less apps...Might do some good. I'll keep you posted.

 Yahel

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


Re: [android-developers] Re: CPU usage stats

2010-09-06 Thread Frank Weiss
Not in the SDK. I suppose because most uses of this is by developers
who can simply use adb or ddms.

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


Re: [android-developers] Re: Killi Process with files on SD card

2010-09-06 Thread Frank Weiss
Can this data be written sooner rather than later? Can you put it or
part of it in SQLite, where it's quicker to update just a part of a
large data model?

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


Re: [android-developers] Re: android design pattern

2010-09-06 Thread Frank Weiss
Three lines of boiler plate. Not sure if I'd bother refactoring that!
But anyways...

You might have issues using the Activity subclass pattern becasue you
can't do that with existing patterns. Here's another approach. In your
home activity, or in a Global class, add a static method:

public static void startHomeActivity(Activity fromActivity) {
   Intent i = new Intent();
   i.setClass(fromActivity, Main_Form.class);
   fromActivity.startActivity(i);
}

In the other activiities, you then simply call

Main_Form.startHomeActivity(this);

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


Re: [android-developers] Re: android design pattern

2010-09-06 Thread Frank Weiss
Correction: ...with exisiting *activities* such as MapActivity, TabActivity,
ListActivity.

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

2010-09-06 Thread Gabriel Simões
Hello guys
After a long time away, got back to coding on this brazilian
independency holiday.

What I´m trying to do is to create a list (using a listview) of items
(which are views inflated from the same layout) what must be
clickable.
At first I thought that all I had to do was to add an
onItemClickListener to the ListView so if the used clicked on any of
the views that composed this Item the listener would react. Well, I
was wrong.
I´ve tried a lot of things, including setting focus and
focusontouchmode off for each of the views that compose the item´s
view but it still doesn´t work.

Any tips here? Can I archive this result?
Oh, also ... this listview is in a dialog and the listener  is in the
activity that builds the dialog.

Hope to hear from you soon. Thanks,
Gabriel Simões

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 with Flash cs5: I have a problem about permissions

2010-09-06 Thread Italian-android
Sure, but with flash I can work for develop android applications. BUt
it's ok, I'll look to Adobe too. Thank you

On 6 Set, 11:44, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Sep 6, 2010 at 5:37 AM, Italian-android maxloveg...@gmail.com wrote:
  Pls I need help about this but anyone is reading my message. Pls give
  me an answare

 The answer is: ask Adobe. CS5 is an Adobe product. Flash is an Adobe
 product. This is not an Adobe discussion list.

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

 Android Consulting:http://commonsware.com/consulting

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

2010-09-06 Thread Thiago Lopes Rosa
Hi,

I have a cube on the center of the screen and the user can rotate it using
the touchscreen.

The problem:
For example, when I rotate the cube 180 degrees (vertical), the horizontal
rotation gets inverted (i mean, when moving right the cube rotates left
and vice-versa).

The issue is that I'm using 2D coordinates (touchscreen) to rotate the 3D
cube.
I'm always rotating around the cube's X and Y axis and never around the Z
axis.

The question is:
How do I calculate how much and which axis to rotate from a 2D coordinate
input?




Thanks,

Thiago

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Two buttons side by side to fill width of screen?

2010-09-06 Thread OldSkoolMark
Consider LinearLayout. You can use layout_weight to achieve
proportional sizing.

On Sep 6, 12:26 am, Droid rod...@gmail.com wrote:
 I have 2 buttons side by side in RelativeLayout (170dip each) but in
 landscape view, they are too narrow - I want to increase their widths
 automatically for landscape.

 I need a 'fill_parent' for two buttons at once kinda thing.

 Can anyone point me in the right direction.

 Here is my layout:

 ?xml version=1.0 encoding=utf-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:layout_width=fill_parent
     android:background=#00
     android:layout_height=fill_parent

 Button android:text=@string/get_answer
 android:id=@+id/Button02
 android:layout_centerHorizontal=true
 android:layout_width=170dip
 android:layout_alignParentLeft=true
 android:layout_height=wrap_content/Button

 Button android:text=@string/speak_answer
 android:id=@+id/Button03
 android:layout_centerHorizontal=true
 android:layout_width=170dip
 android:layout_toRightOf=@id/Button02
 android:layout_alignTop=@id/Button02
 android:layout_height=wrap_content/Button

 TextView android:text=  android:id=@+id/TextView01
 android:layout_below=@+id/Button03    android:textColor=#ff
 android:textStyle=bold android:textSize=1dip
 android:layout_width=wrap_content android:layout_height=1dip/
 TextView
 TextView android:text=  android:id=@+id/TextView02
 android:layout_below=@+id/TextView01 android:textColor=#00
 android:textStyle=bold android:textSize=20dip
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=  android:id=@+id/TextView03
 android:layout_below=@+id/TextView02  android:textColor=#ff00ff
 android:textStyle=bold android:textSize=20dip
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=  android:id=@+id/TextView04
 android:layout_below=@+id/TextView03  android:textColor=#ff
 android:textStyle=bold android:textSize=20dip
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=  android:id=@+id/TextView05
 android:layout_below=@+id/TextView04
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=  android:id=@+id/TextView06
 android:layout_below=@+id/TextView05
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=  android:id=@+id/TextView07
 android:layout_below=@+id/TextView06
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView
 TextView android:text=   android:id=@+id/TextView08
 android:layout_below=@+id/TextView07
 android:layout_width=wrap_content
 android:layout_height=wrap_content/TextView

 /RelativeLayout

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


Re: [android-developers] Recommendation for an Application with tons of media files

2010-09-06 Thread Filip Havlicek
Hi Sebastián,

160MB is a lot of data, I think it is a must to save that much to SD card
(I'm not sure how much is the common internal phone storage, but I wouldn't
be surprised if it would be around 256MB in common cases).

Although I have to disappoint you, I think there is no way to prevent user
from accessing the data on SD card (this link supports my thoughts
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal).
You cypher the data somehow to prevent other applications from reading
it
successfully, although you are going to have to check for the data
availability everytime you want to access it and throw an error message when
they are not found (they actually don't have to be deleted, mounting SD card
as mass storage to computer is enough to make them disappear to you).

Best regards,
Filip Havlicek

2010/9/6 Frank Weiss fewe...@gmail.com

  I was thinking in using the sd card storage.

 That's a good idea.

  But, I don't want the
  user to accidentally remove the media files. I want it to be private,
  not accesible to possible deletions.

 How might a user accidently remove them? Why is this a concern?

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


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

[android-developers] Re: Permission checked at install time, but what happens if the permission user is installed before the permission definer?

2010-09-06 Thread shomari
The signature permission is a VERY helpful bit of info.  I had
officially given up on using any inter-app security on Android as NOT
being a viable option for a quality user experience.  However, moving
forward it appears this issue will become less of an issue (at least
for apps signed with the same signature).  Thanks for the info :)


On Sep 5, 5:19 pm, Flying Coder av8r.st...@gmail.com wrote:
 OK.  BTW, thanks for the tip about the signature permission.  That
 not only helped with a workaround for this problem, but also with
 another related issue.

 Cheers,
 Steve

 On Sep 5, 2:58 pm, Dianne Hackborn hack...@android.com wrote:

  There isn't a way in the SDK.  You need to go through the permissions screen
  so the user can approve the permissions being granted.  (adb install doesn't
  go through permissions because the shell is running as the user.)

  On Sun, Sep 5, 2010 at 8:33 AM, Mark Murphy mmur...@commonsware.com wrote:
   On Sun, Sep 5, 2010 at 11:31 AM, Flying Coder av8r.st...@gmail.com
   wrote:
Call it what you want, is there a way to make it happen?

   Run adb install -r, or publish an update to your app on the Market. I
   don't know of any other mechanism to do this.

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

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

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

  --
  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, and so won't reply to such e-mails.  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: android design pattern

2010-09-06 Thread claesh
Actually, you only need one line of code. But for clarity(?) you could
add a helper method either as a static method or extend Activity as
Kumar suggested.

fromActivity.startActivity(new Intent().setClass(fromActivity,
Main_Form.class));

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