[android-developers] Re: Google Maps API hidden maps and opengl

2010-11-14 Thread Adam Hammer
I have a class I wrote that uses the maps and works in a activity, but
still returns the stub error when I attempt to instantiate it in a
live wallpaper.

It's supposed to be in a MapActivity, but I figured since Google uses
maps in a live wallpaper I could use it as well, although I know this
is not always the case.

I've learnt the hard way that just because Google does something with
android doesn't mean they expose those methods to the developers.

Adam

On Nov 13, 10:07 am, Chister Nordvik cnord...@gmail.com wrote:
 Did you ever figure this one out? I tried to create a very simple map
 application, but got the stub exception at startup both on device
 and in emulator:
 E/AndroidRuntime(  263): Caused by: java.lang.RuntimeException: stub
 E/AndroidRuntime(  263):        at
 com.google.android.maps.MapActivity.init(Unknown Source)

 Followed the tutorial from 
 here:http://developer.android.com/guide/tutorials/views/hello-mapview.html
 with no success. Must be something with the setup?

 -Christer

 On Nov 2, 1:48 pm, Adam Hammer adamhamm...@gmail.com wrote:

  That is the entire error. 2 Line stack trace, I called the function
  and I get the Stub

  I've managed to get MapView working in a activity with Opengl and
  using offscreen rendering. It's actually performing very well.

  I'll go back and try in a LWP once I iron out all the activity bugs.

  On Nov 1, 9:41 am, TreKing treking...@gmail.com wrote:

   On Fri, Oct 29, 2010 at 6:00 PM, Adam Hammer adamhamm...@gmail.com 
   wrote:
I get an error

   java.lang.RuntimeException:stub
  at com.google.android.maps.MapView.init (Unknown Source)

   Is that really the entire error?

   Regardless, read the MapView documentation. It explains where and how the
   MapView can be used.

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

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


Re: [android-developers] Re: Product images for marketing materials

2010-11-14 Thread dan raaka
Will get back to you soon Phil on this thread.

-Dan


On Sat, Nov 13, 2010 at 8:46 AM, Bret Foreman bret.fore...@gmail.comwrote:

 MOTODEV has fantastic developer support. Contact me directly if you
 want specific names of people who have helped me.

 On Nov 13, 4:42 am, Mark Murphy mmur...@commonsware.com wrote:
  For Motorola, use MOTODEV.
 
  I cannot comment on HTC's plans in this area, though I remain hopeful.
 
  I have nary a clue what Samsung intends to do, particularly since they
  also have bada to support.
 
  On Sat, Nov 13, 2010 at 7:28 AM, Phil Endecott
 
 
 
  spam_from_goo...@chezphil.org wrote:
   On Nov 13, 1:24 am, dan raaka danra...@gmail.com wrote:
  http://www.samsung.com/us/support/contact
 
   Thanks Dan.  Actually I had spent quite a long time on the phone
   trying to find the right person at Samsung before I posted here.  The
   closest I was able to find was their press relations team, but they
   didn't return my calls.
 
   The flyers are now done, but with only Apple product images.  Those of
   you who are also iPhone developers will know that they have an artwork
   license agreement that you print out and mail to them to get
   permission to use the product images.  At the time I thought this was
   a bit bureaucratic, but it's better than having nothing at all!
 
   This raises the more general question of who our contacts with the
   industry are supposed to be.  Do we talk to Google, or to the product
   vendors?  Google do seem to have some points of contact, but my
   (brief) research can't find any significant developer support
   contacts or resources from Samsung, HTC or Motorola.  Am I looking in
   the wrong places?
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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
 
  --
  Mark Murphy (a Commons Guy)http://commonsware.com|
 http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguyhttp://github.com/commonsguyhttp://commonsware.com/blog%7Chttp://twitter.com/commonsguy
 
  Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: Activity display over incoming call screen

2010-11-14 Thread Anders
I solved that issue using an delay before starting the activity thus
getting it displayed ontop of the call screen. But then I had problems
with my activity taking focus from the call screen. I ended up
displaying a custom toast notification instead.

On Nov 14, 4:35 am, Dianne Hackborn hack...@android.com wrote:
 What you are trying to do is simply not going to work reliably.  The
 incoming call broadcast is a broadcast, and at the same time you are
 handling it and doing something the system is in the process of showing the
 in-call screen.  There is a race going on between you starting your activity
 and the in-call screen activity being started, and which gets there *second*
 (which is the the user will see barring some flicker) is effectively random.

 On Sat, Nov 13, 2010 at 7:46 AM, mohammad Rukab 
 mohammad.ru...@gmail.comwrote:









  Hello ,

  i have problem when i start activity from incoming call
  broadcastReciever, the problem is :

  when call is coming i start activity X with FLAG_ACTIVITY_NEW_TASK
  flag, and it is work fine when my application is not on the screen.

  but if my application on the screen (activity Y) and call come, when
  activity X called from braodcastReciver Activity Y cover screen over
  incoming call screen then Actvity X display, so 2 activity become over
  incoming call, although i just want activity X just display.

  Please an body have idea??

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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] Explicit intents

2010-11-14 Thread Peter Webb
I have worked my way through the Notepad example and sort-of
understand how the intents are passed back and forth.

Basically, in Notepad the intents are read (mostly) in
onPrepareOptionsMenu(). The system is polling the intent status
within the code. That strikes me as a somewhat arbitrary decision;
menu items are not directly connected to intents, and intents
themselves are asynchronous activities. Other apps appear to work
similarly.

What I was expecting was a method called something like
onReceivedNewIntent() which I could override, and centralise my intent
handling logic. That would mean that intents were using the same
pattern as UI events, and explicit polling logic is unneccesary.

Is this it? Do I have to include my intent checking logic into some
other handler that I know will be called, like onPrepareOptionsMenu,
or is there some way of explicitly wiring an event handler to a
received intent?

Sorry about the noob question; I still don't get it, and feel like I
am missing something important.



.



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


[android-developers] Re: Is anyone's active install % dropping like a rock lately?

2010-11-14 Thread Albert

This is still showing up, has been happening to me for the last 5-6
days with a 0.50% decrease after an steady 2 months!

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

2010-11-14 Thread Android Humanoid
Thanks a lot everyone, We have found the solution for this... the url
fomats that the browser supports are not supported by the android
emulator, so we changed the url formats a bit.

Thanks again! :)

On Nov 11, 12:03 pm, kernelpanic j.m.roya...@gmail.com wrote:
 I went through this a couple of months back with our server where we
 had the same script sometimes provide a content-length, other times
 the length was -1

 AFAIK, -1 is a valid response when the server can't determine the
 length.

 In researching the issue, we found our solution was in the server
 output headers - much like Bob suggested

 We changed the output headers on those problematic scripts

 from Header('Content-Type: text/html');

 to Header('Content-Type: text/html charset=UTF-8');

 adding the charset encoding made all the difference - who'd've thunk
 it

 YMMV of course since you are doing ZIP files, but it's something to
 check.

 On Nov 10, 11:16 pm, Android Humanoid droid.hu...@gmail.com wrote:

  The length of the content that am getting is -1, The server is ours
  only, so I asked the server persons to look into the logs what exactly
  logged, They informed that
  there is nothing logged, Is there any chance for android to change
  url, because, the same url is working on desktop.

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

2010-11-14 Thread Android Humanoid
Hi All,

While I was reading the xml file there a copyright symbol, while
parsing that symbol i'm getting the not well-formed invalid token
error, Can anyone suggest me the solution for this problem.

Thanks  Regards.

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


Re: [android-developers] not well-formed invalid token parser.pm

2010-11-14 Thread Kumar Bibek
It might be a bit tricky. Your XML should be proper, else you would get
these errors.

On Sun, Nov 14, 2010 at 4:53 PM, Android Humanoid droid.hu...@gmail.comwrote:

 Hi All,

 While I was reading the xml file there a copyright symbol, while
 parsing that symbol i'm getting the not well-formed invalid token
 error, Can anyone suggest me the solution for this problem.

 Thanks  Regards.

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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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

Re: [android-developers] Activity display over incoming call screen

2010-11-14 Thread mohammad Rukab
Thanks Dianne,

This issue can resolve through put a delay before fire new activity, but the
issue is why previous  activity (activity before a call come) rearranged to
be over call screen and before new activity

On Sun, Nov 14, 2010 at 5:35 AM, Dianne Hackborn hack...@android.comwrote:

 What you are trying to do is simply not going to work reliably.  The
 incoming call broadcast is a broadcast, and at the same time you are
 handling it and doing something the system is in the process of showing the
 in-call screen.  There is a race going on between you starting your activity
 and the in-call screen activity being started, and which gets there *second*
 (which is the the user will see barring some flicker) is effectively random.

 On Sat, Nov 13, 2010 at 7:46 AM, mohammad Rukab 
 mohammad.ru...@gmail.comwrote:

 Hello ,

 i have problem when i start activity from incoming call
 broadcastReciever, the problem is :

 when call is coming i start activity X with FLAG_ACTIVITY_NEW_TASK
 flag, and it is work fine when my application is not on the screen.

 but if my application on the screen (activity Y) and call come, when
 activity X called from braodcastReciver Activity Y cover screen over
 incoming call screen then Actvity X display, so 2 activity become over
 incoming call, although i just want activity X just display.

 Please an body have idea??

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




 --
 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.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: Android Market Licensing Problem

2010-11-14 Thread bagelboy
Perhaps the responses aren't correct because your app is not
published.

this thread may provide some insight:
http://groups.google.com/group/android-developers/browse_thread/thread/bb18fc91dd02989f/39211249d57c6d42#39211249d57c6d42


On Nov 14, 3:31 am, John Gaby jg...@gabysoft.com wrote:
 I have added some logging code and found that the raw response from
 the License Service (i.e. the call back to verifyLicense in
 LicenseChecker.java) has a responseCode of '0', which means
 'licensed'.  This is simply not correct.  This phone does NOT have a
 valid account which would generate such a response.  Can someone
 please explain why this is happening.  Does this License Service
 simply not work correctly on a large number of phones?  Does using the
 service have any value at all?

 Thanks.

 On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

  I recently did my own LVL implementation and I can tell you that
  tracing these issues down is a real pain. First you need to put loads
  of logging into the LVL code to find out what the actual response is,
  otherwise you have no visibility, then you have to put logging into
  all the code between the response and the allow/dontallow callbacks.

  Basically what I found was the stock code was unworkable in many ways.
  I quickly came to the conclusion that I needed to modify it into
  something that worked for me. There's a few reasons behind why you
  should abandon the stock code:
  - if you use the stock implementation then crackers will find it very
  easy to circumvent
  - as you have found it is very hard to debug. You have to spend so
  much time figuring out how it works you may as well roll your own
  instead.
  - who's to say whether the google responses are what you want? How
  many retries do you want before it sends a dontAllow back? Maybe you
  want to treat the error responses as a retry. Do you want google to
  specify that or yourself? Do you want them to specify the time between
  checks? It's better to take control of this process so you know
  exactly what is going on and you can manage the user experience.

  In the system I came up with in the end all I use is the response and
  none of the extras. What I do with the response is all custom, that
  way I can use the market test responses in development without
  issues.

  -BB

  On Nov 13, 4:40 am, John Gaby jg...@gabysoft.com wrote:

   I am using pretty much the default Android Market Licensing in my
   application, but find that it is not working correctly on most of the
   devices that I have tested.  I have uploaded my app to the Market but
   not published it.  If install it on the emulator which does not have
   any Google accounts, then I receive a 'dontAllow' from the check,
   which is correct.

   If I install it on a Motorola Droid phone (which I have in my
   possession) that has my Market Google account associated with it, then
   it will return 'allow' or 'don't allow' depending on how I set the
   test market. I have also installed it on an HTC Incredible phone, and
   it seems to work there as well.

   However, I have tested 4 other phones (HTC Hero, HTC Brovo Desire, HTC
   Droid Eris and HTC Nexus One), and on each of these phones, I get an
   'allow' call from the license check, even though there is no
   authorizing account on the phone.  Can someone tell me what is going
   on here?

   Thanks.



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


Re: [android-developers] Re: Activity display over incoming call screen

2010-11-14 Thread mohammad Rukab
yes i also  a delay, but not this the problem, and i can't build custom
toast because i need buttons on it

On Sun, Nov 14, 2010 at 11:21 AM, Anders anders.bromha...@gmail.com wrote:

 I solved that issue using an delay before starting the activity thus
 getting it displayed ontop of the call screen. But then I had problems
 with my activity taking focus from the call screen. I ended up
 displaying a custom toast notification instead.

 On Nov 14, 4:35 am, Dianne Hackborn hack...@android.com wrote:
  What you are trying to do is simply not going to work reliably.  The
  incoming call broadcast is a broadcast, and at the same time you are
  handling it and doing something the system is in the process of showing
 the
  in-call screen.  There is a race going on between you starting your
 activity
  and the in-call screen activity being started, and which gets there
 *second*
  (which is the the user will see barring some flicker) is effectively
 random.
 
  On Sat, Nov 13, 2010 at 7:46 AM, mohammad Rukab 
 mohammad.ru...@gmail.comwrote:
 
 
 
 
 
 
 
 
 
   Hello ,
 
   i have problem when i start activity from incoming call
   broadcastReciever, the problem is :
 
   when call is coming i start activity X with FLAG_ACTIVITY_NEW_TASK
   flag, and it is work fine when my application is not on the screen.
 
   but if my application on the screen (activity Y) and call come, when
   activity X called from braodcastReciver Activity Y cover screen over
   incoming call screen then Actvity X display, so 2 activity become over
   incoming call, although i just want activity X just display.
 
   Please an body have idea??
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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.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.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

Re: [android-developers] TCP problem - hangs when reading server's response

2010-11-14 Thread Daniel Drozdzewski
On Sun, Nov 14, 2010 at 2:11 AM, bobetko bobe...@gmail.com wrote:
 I am trying to write client for Android which is supposed to
 communicate with PC server application on local network.
 Server app is written by my friend in C#. Currently there is an iPhone
 app that is using this server application with no problems.

 I have very simple code for TCP client:

 1. Socket s = new Socket(server, port);
 2. OutputStream out = s.getOutputStream();
 3. PrintWriter output = new PrintWriter(out);
 4. output.println(ACTION=NextVALUE=0);
 5. BufferedReader input = new BufferedReader(new
 InputStreamReader(s.getInputStream()));
 6. String st = input.readLine();

 I went through many TCP implementation examples, and they are all
 similar. Pretty much like my code above.
 My app freezes on line 6 when I try to read response from the server.
 It doesn't cause any errors (no exceptions), nothing shows in
 debugger, just timeout error after awhile. Server is supposed to
 return string OK after executing my action in line 4.
 I don't understand why this code hangs. Input is not NULL (I've
 checked it). I would expect some exception to be thrown or simply
 empty string to be returned.


How did you check, whether the input is not NULL?
Can you verify that the server actually receives your ACTION=Next... string ?

Could you also verify, what does
Socket.isConnected() returns?

If FALSE, try the folowing:

s= new Socket();
s.connect(new InetSocketAddress(host_as_string, port_as_int));


-- 
Daniel Drozdzewski

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

2010-11-14 Thread Mark Murphy
On Sun, Nov 14, 2010 at 5:29 AM, Peter Webb r.peter.w...@gmail.com wrote:
 Basically, in Notepad the intents are read (mostly) in
 onPrepareOptionsMenu(). The system is polling the intent status
 within the code. That strikes me as a somewhat arbitrary decision;
 menu items are not directly connected to intents, and intents
 themselves are asynchronous activities. Other apps appear to work
 similarly.

Let's dissect this one sentence at a time, skipping the last one
because I don't know what you are referring to.

 Basically, in Notepad the intents are read (mostly) in onPrepareOptionsMenu().

Intents are not read, any more than snowplows or sand dunes are.

I am assuming what you are referring to is the call to
addIntentOptions(). This technique has been generally abandoned by
Google, particularly for their own apps, as they are concerned about
menu spam. I wish they would update this example to remove it.

 The system is polling the intent status within the code.

No. NotesList is saying, yo, Android, what activities out there know
how to deal with these...ummm...note thingies? and is automatically
adding menu items for each match, if any.

 That strikes me as a somewhat arbitrary decision;
 menu items are not directly connected to intents, and intents
 themselves are asynchronous activities.

Menu items can be directly connected to Intents, though that's not
required. A menu item with an attached Intent will call
startActivity() on that Intent. Otherwise, it is handled by your code
in onOptionsItemSelected(). addMenuOptions() attaches Intents to each
of the menu items it puts in the menu, so you do not have to otherwise
deal with them.

Intents are not asynchronous activities, any more than are baseballs
or broomsticks. The *use* of Intents for startActivity(),
startService(), and sendBroadcast() are all asynchronous.

 What I was expecting was a method called something like
 onReceivedNewIntent() which I could override, and centralise my intent
 handling logic.

???

 That would mean that intents were using the same
 pattern as UI events, and explicit polling logic is unneccesary.

Again, there is no polling.

 Is this it? Do I have to include my intent checking logic into some
 other handler that I know will be called, like onPrepareOptionsMenu,
 or is there some way of explicitly wiring an event handler to a
 received intent?

I would attempt to forget everything you attempted to interpret out of
this section of Notepad. Sufficient quantities of alcohol may do the
trick. :-)

 Sorry about the noob question; I still don't get it, and feel like I
 am missing something important.

Well, maybe. IMHO, addIntentOptions() was a silly thing to put in
Notepad in the first place, even back when we thought it was relevant,
simply because it's a fairly advanced technique and Notepad is
specifically supposed to be for noobs.

If you call startActivity() with an Intent, that will be received via
onCreate() (normally) or onNewIntent() (occasionally) in the activity
that you asked for.

If you call startService() on an Intent, that will be received by
onStart() of the service.

If you call sendBroadcast() on an Intent, that will be received by
onReceive() of any BroadcastReceiver registered to respond to Intents
like the one you broadcast.

I'm not sure how much this reply helped clear up your confusion, but
if nothing else, perhaps it may help you form more targeted questions.

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

Android 2.2 Programming Books: http://commonsware.com/books

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


[android-developers] how to EGLimage?

2010-11-14 Thread 袁堂夫
I use the glTexImage2D to draw YUV frame date,but it is too slowly.
so I want to use EGLimage to draw YUV frame,but it is not display.
Do I make any mistake?  Thank you!
---


glActiveTexture ( GL_TEXTURE1 );
glBindTexture ( GL_TEXTURE_2D, userData.textureId[1] );
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glUniform1i ( userData.samplerLocU, 1);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 
GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 
GL_CLAMP_TO_EDGE);

eglImage = pFnEGLCreateImageKHR(g_Display, 0,
EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict-data[1], 0);
pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage);
pFnEGLDestroyImageKHR(g_Display,eglImage);


// Bind the texture
glActiveTexture ( GL_TEXTURE2 );
glBindTexture ( GL_TEXTURE_2D, userData.textureId[2] );
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glUniform1i ( userData.samplerLocV, 2);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 
GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 
GL_CLAMP_TO_EDGE);

eglImage = pFnEGLCreateImageKHR(g_Display, 0,
EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict-data[2], 0);
pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage);
pFnEGLDestroyImageKHR(g_Display,eglImage);


glActiveTexture ( GL_TEXTURE0 );
glBindTexture ( GL_TEXTURE_2D, userData.textureId[0] );
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glUniform1i ( userData.samplerLocY, 0);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 
GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 
GL_CLAMP_TO_EDGE);

eglImage = pFnEGLCreateImageKHR(g_Display, 0,
EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict-data[0], 0);
pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage);
pFnEGLDestroyImageKHR(g_Display,eglImage);

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: TCP problem - hangs when reading server's response

2010-11-14 Thread Kristian
Hi,

I have only worked with doing sockets more manually, using
bytebuffer(http://onjava.com/pub/a/onjava/2002/09/04/nio.html and
ignore non-blocking for now) and then parsing what I need (I guess I
still like the C-way of using sockets), so I am not an expert in this
field. Anyway, have you checked that the server actually receives your
message (from line#4) and generates the correct response? Can you see
the response arriving on your client device/machine? Based on my
understanding of readLine, it will block until \n, \r og \r\n is read
and then return the complete string. Can you modify the server
application to include for example \n at the end of the packet (just
for testing)?

-Kristian

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: adb can't find my Verizon Samsung Galaxy Tab ...

2010-11-14 Thread OldSkoolMark
OK. Problem solved. Works like a champ on my Win Pro 64 machine.
Thanks all.

For the record:

1) disconnect device from computer prior to trying to set 'usb
debugging' on.
2) download Galaxy S driver according to 
http://forum.xda-developers.com/showthread.php?t=728929



On Nov 13, 11:17 am, Gergely Juhász jg.sv...@gmail.com wrote:
 as is remember i use 
 these:http://forum.xda-developers.com/showthread.php?t=728929

 2010/11/13 Kostya Vasilyev kmans...@gmail.com:

  Probably need to either download Samsung's drivers for the Tab (is there
  Kies for it?) or hack upnp device id's in the standard driver's inf file.

  --
  Kostya Vasilyev --http://kmansoft.wordpress.com

  13.11.2010 22:09 пользователь OldSkoolMark m...@sublimeslime.com
  написал:

  Thanks everyone. That did the trick to set the usb debugging option.
  Bad news is that on both my Win 7 Pro 64 system and my
  XP system, I still can't get 'adb devices' to see it. Nobody needed
  drivers from Samsung? Or elsewhere?

  On Nov 13, 6:50 am, Kostya Vasilyev kmans...@gmail.com wrote:
  Galaxy S is the same way - you ca...

  13.11.2010 17:49 пользователь jsdf jasons...@gmail.com написал:

  I had to unplug it from the computer. Then I could check the check
  box.
  This was on a  T-Mob...

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers g...

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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] Run instructions at the end of six animations played together

2010-11-14 Thread gontran
Hello,

I need to run six animations simultaneously (each animation simulates
a roll of dice, each dice is a custom text view) and at the end of
those animations,  I need to get back the number of each roll. As each
animation changes the number of each dice five times (to simulate the
roll), I want to wait that each animation has ended to calculate the
sum of each roll.

I tried to regroup in one the six animations  (so that with an
animation listener, I would have been able to wait the end of the
animation) but I didn't manage it.

Any solution is welcome.

Thank you in advance.

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


Re: [android-developers] Run instructions at the end of six animations played together

2010-11-14 Thread Mark Murphy
On Sun, Nov 14, 2010 at 9:52 AM, gontran geoffroydecorb...@gmail.com wrote:
 I need to run six animations simultaneously (each animation simulates
 a roll of dice, each dice is a custom text view) and at the end of
 those animations,  I need to get back the number of each roll. As each
 animation changes the number of each dice five times (to simulate the
 roll), I want to wait that each animation has ended to calculate the
 sum of each roll.

Why not pre-compute the intended states of each die before starting
the animation? There is nothing magical about waiting to do your
random number generation. Figure it all out in advance.

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

Android 2.2 Programming Books: http://commonsware.com/books

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


[android-developers] Code for capturing screenshot of lock screen without DDMS

2010-11-14 Thread Vic
I used mView.getRootView().getDrawingCache() to get the screenshot of
lock screen. mView is the root layout of lock screen. I found the
background of lock screen is black. It looks like the screenshot
doesn’t include the current wallpaper. Does anyone know the reason? Is
there a method to get the screenshot of lock screen which includes the
current wallpaper?

Thanks.

Vic

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Run instructions at the end of six animations played together

2010-11-14 Thread gontran
Thank you Mark for your answer, but could-you be more specific please?
What do you mean by pre-compute?

For more explanation, my dices are custom text views (my dices are
drawn, I don't have drawables for the background) that have a method
setNumDice(int i). When i==0, the method generate a random number
(between 1 and 6) and then call the invalidate() method. Then, the
dice is redrawn with the number of points corresponding to its
property numDice.

On 14 nov, 16:06, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Nov 14, 2010 at 9:52 AM, gontran geoffroydecorb...@gmail.com wrote:
  I need to run six animations simultaneously (each animation simulates
  a roll of dice, each dice is a custom text view) and at the end of
  those animations,  I need to get back the number of each roll. As each
  animation changes the number of each dice five times (to simulate the
  roll), I want to wait that each animation has ended to calculate the
  sum of each roll.

 Why not pre-compute the intended states of each die before starting
 the animation? There is nothing magical about waiting to do your
 random number generation. Figure it all out in advance.

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

 Android 2.2 Programming Books:http://commonsware.com/books

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


Re: [android-developers] Re: Run instructions at the end of six animations played together

2010-11-14 Thread Mark Murphy
On Sun, Nov 14, 2010 at 10:25 AM, gontran geoffroydecorb...@gmail.com wrote:
 Thank you Mark for your answer, but could-you be more specific please?
 What do you mean by pre-compute?

Pre-compute = compute in advance.

If I understand correctly, you have 30 random numbers (six dice, five
state changes). You want the sum of the last six random numbers.

Right now, you appear to be generating those random numbers on the
fly. Rather than do that, compute them in advance. Then, you do not
have to worry about wait that each animation has ended to calculate
the sum of each roll, because you already know the values.

Or, just pre-compute the last six random numbers (the ones you need to
sum), so on your last state change, you go to the pre-computed value
rather than generating another random number on the fly.

If your problem is more about displaying the sum at the right time,
more so than calculating it, just use a single AnimationListener on
one of your dice. If they are all animating simultaneously, they will
all end simultaneously, so just pick one and use that to time the
display of your sum.

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

Android 2.2 Programming Books: http://commonsware.com/books

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


[android-developers] Re: ADT painstakingly remove my exclusion setting for android library

2010-11-14 Thread mianwo
Thanks for paying attention on this, Xavler.

I copy the error message below:

Description ResourcePathLocationType
The project was not built due to Resource '/SensorList/bin/com/
ideamats/common/.svn/entries' already exists.. Fix the problem, then
try refreshing this project and building it since it may be
inconsistentSensorList  Unknown Java Problem

The 'type' column says 'Java Problem'
In this error message, com.ideamats.common package is the package of
my common library. This package does not exist in the app project. So
I am sure that the file mentioned in the message is copied from the
library project.
I think Eclipse must think the svn files are resources, so it was
trying to copy them into the bin folder. But somehow these files are
already there, so the error message is generated.

I triple checked svn properties, 'bin' is indeed inside the svn:ignore
property.

BTW I'm using Subversive, not Subclipse... Will that make a
difference?


On Nov 12, 4:04 am, Xavier Ducrohet x...@android.com wrote:
 The problem is that the source folder for the Eclipse library project
 is created dynamically, and is recreated when you re-open your
 project.

 Eclipse likely remove the exclusion when the source folder is re-created.

 Can you tell me which marker type is showing for this error? Look in
 the problem view and look at the type column. That'll help me know
 which builder is showing this error.

 thanks
 Xav





 On Wed, Nov 10, 2010 at 4:38 AM,mianwomia...@gmail.com wrote:
  I can confirm that this problem exists.
  How to reproduce this:
  1 Create an android project and set it as an Android library.
  2 Create another android project that uses the previous library.
  3 Commit these source code into a svn repository.
  4 Change something in your library project, then commit it.
  5 An error will occur in the project that uses the library. The
  message says the project can't compile because bin/[path to your
  source code]/.svn/entries file already exists.

  This is obvious because when importing library source code, the .svn
  folder is also included and copied to bin folder when project
  compiles.
  That is not a big problem because you can set to exclude .svn folder
  and its contents in Eclipse.
  But my real problem is that the current ADT always tries to remove the
  exclusion setting for my projects.

  My ADT version is 0.9.9.v201009221407-60953

  On Nov 3, 10:45 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
  On 3 November 2010 14:11,mianwomia...@gmail.com wrote:

   I have a common library android project being used by several other
   projects. And I use svn to manage my source code.
   So I have to exclude svn files from compiling process otherwise
   eclipse will generate errors saying something already exists bla
   bla...

  I never had to exclude any SVN folders here nor seen Eclipse
  complaining about these folders. That would be silly as Eclipse
  got nothing to say here. I also got lot of other folders in
  project tree and it's not a problem at all.

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

 --
 Xavier Ducrohet
 Android SDK Tech Lead
 Google Inc.

 Please do not send me questions directly. 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] Android Project association with an emulator(s)

2010-11-14 Thread adithya
Hi,

I have developed two projects.
In the first one i send messages and in the second one i receive them.

I have also created two emulator instances.

What i was trying to do was associate a single project with a single
emulator by going to :
sendProject - run config - selecting the AVD (AVD1)

For the second project i did the same
receiveProject - run config - selecting the AVD (AVD2)

..then after sending the message when i checked the AVD2 screen it
threw an error !!

I went back and checked the run config for both the projects and found
that both were pointing to the second AVD2 !!

What could be the reason behind this ?

Thanks,
Adithya

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

2010-11-14 Thread John Gaby
Actually, that thought has occurred to me (I have already read that
thread), but really, how am I supposed to be able to test my app
before I publish it if that is the case?


On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:
 Perhaps the responses aren't correct because your app is not
 published.

 this thread may provide some 
 insight:http://groups.google.com/group/android-developers/browse_thread/threa...

 On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

  I have added some logging code and found that the raw response from
  theLicenseService (i.e. the call back to verifyLicense in
  LicenseChecker.java) has a responseCode of '0', which means
  'licensed'.  This is simply not correct.  This phone does NOT have a
  valid account which would generate such a response.  Can someone
  please explain why this is happening.  Does thisLicenseService
  simply not work correctly on a large number of phones?  Does using the
  service have any value at all?

  Thanks.

  On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

   I recently did my own LVL implementation and I can tell you that
   tracing these issues down is a real pain. First you need to put loads
   of logging into the LVL code to find out what the actual response is,
   otherwise you have no visibility, then you have to put logging into
   all the code between the response and the allow/dontallow callbacks.

   Basically what I found was the stock code was unworkable in many ways.
   I quickly came to the conclusion that I needed to modify it into
   something that worked for me. There's a few reasons behind why you
   should abandon the stock code:
   - if you use the stock implementation then crackers will find it very
   easy to circumvent
   - as you have found it is very hard to debug. You have to spend so
   much time figuring out how it works you may as well roll your own
   instead.
   - who's to say whether the google responses are what you want? How
   many retries do you want before it sends a dontAllow back? Maybe you
   want to treat the error responses as a retry. Do you want google to
   specify that or yourself? Do you want them to specify the time between
   checks? It's better to take control of this process so you know
   exactly what is going on and you can manage the user experience.

   In the system I came up with in the end all I use is the response and
   none of the extras. What I do with the response is all custom, that
   way I can use the market test responses in development without
   issues.

   -BB

   On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

I am using pretty much the default Android Market Licensing in my
application, but find that it is not working correctly on most of the
devices that I have tested.  I have uploaded my app to the Market but
not published it.  If install it on the emulator which does not have
any Google accounts, then I receive a 'dontAllow' from the check,
which is correct.

If I install it on a Motorola Droid phone (which I have in my
possession) that has my Market Google account associated with it, then
it will return 'allow' or 'don't allow' depending on how I set the
test market. I have also installed it on an HTC Incredible phone, and
it seems to work there as well.

However, I have tested 4 other phones (HTC Hero, HTC Brovo Desire, HTC
Droid Eris and HTC Nexus One), and on each of these phones, I get an
'allow' call from thelicensecheck, even though there is no
authorizing account on the phone.  Can someone tell me what is going
on here?

Thanks.

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


[android-developers] Re: How to handle major revisions to OpenGL game in Android Market

2010-11-14 Thread Jeff Boody
What version of Android guarantees a hardware accelerated OpenGL ES 2.0 
context?

If your app specifies that it uses OpenGL ES 2.0 in the Android
manifest then it will only show up on the Market for devices which
support it.

For example:

uses-feature android:glEsVersion=0x0002/

I would like to limit limit these devices to the 1.x branch version of the app.

The early Android devices don't support OpenGL ES 2.0 so your new app
wouldn't show up in the Market for old devices.

How can I have 2 apps in the Android Market that have the same
name?  I'd rather not have to append some word like 'Pro', 'Extreme',
etc. on a new application since my current users that have sufficient
hardware to run the 2.x branch would not be automatically updated.

I think it would be difficult for users to differentiate between the
two apps with the same name so I would recommend having a different
name.

Is the solution to add code to the 1.x branch that checks the hardware on
startup and posts some message that they should download the new 2.x
branch app instead?

I think this is a good idea.

You can figure out if a device supports OpenGL ES 2.0 when it is
started by looking at the EGL configs to see if any support the
EGL_OPENGL_ES2_BIT.

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

2010-11-14 Thread Neilz
Hi all. I have a custom dialog, which contains a WebView. If the
content of the webview is too much, the dialog size is too high for
the screen, and the 'ok' button drops off the bottom of the screen. I
can't seem to find a way to limit the size of the dialog. I can
achieve it with layoutHeight but that's no good, as I want it to
wrap when there is less text. The element maxHeight seems to have no
effect.

Also, the button gets pushed out of the view, even though I have
specified a layout weight.

Any ideas please?


?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:id=@+id/dialog_root
android:orientation=vertical
android:layout_height=wrap_content
android:layout_width=wrap_content
android:gravity=center
android:layout_gravity=center
android:paddingLeft=10dip
android:paddingRight=10dip



LinearLayout
android:orientation=horizontal
android:layout_width=240dip
android:layout_height=wrap_content
android:paddingBottom=10dip
android:gravity=center


WebView android:id=@+id/help_text
android:layout_width=fill_parent
android:layout_height=wrap_content
android:scrollbars=
  /

 /LinearLayout

LinearLayout
android:orientation=horizontal
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_weight=1
android:paddingTop=10dip
android:paddingBottom=10dip
android:gravity=center


ImageButton
android:id=@+id/help_button
android:layout_width=wrap_content
android:layout_height=wrap_content
android:src=@drawable/bt_selector_ok
android:background=@null
android:gravity=center
/

/LinearLayout

/LinearLayout

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


[android-developers] Re: OpenGL glScissor not working on HTC phones

2010-11-14 Thread Jeff Boody
I do not do a gl.glClear(GL10.GL_COLOR_BUFFER_BIT); so the bits that were 
drawn previously should remain.

Actually this isn't the default behavior.

I think you need to request EGL_BUFFER_PRESERVED for the
EGL_SWAP_BEHAVIOR.

Unfortunately this currently (froyo) isn't possible because Android
only supports EGL 1.0 + some extensions.

The eglSurfaceAttrib() API entry point was added at a later version of
EGL.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Run instructions at the end of six animations played together

2010-11-14 Thread gontran
Ok, I get your point, but my problem is both displaying and
calculating the result at the right time because in my game, you roll
dices to get an asset of points, to attack another player... So
depending on the state of the game, the instructions run after each
rolls are not always the same. so after each roll, I have to display
the sum and other informations depending on the state of the game and
maybe changing the state (I use the state design pattern).

For me, the best solution would be to make a single animation to
animate the six dices, but correct me if I'm wrong, it's impossible to
make each dice rotate on itself with a single animation.

Anyway, thank you for your time.


On 14 nov, 16:36, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Nov 14, 2010 at 10:25 AM, gontran geoffroydecorb...@gmail.com wrote:
  Thank you Mark for your answer, but could-you be more specific please?
  What do you mean by pre-compute?

 Pre-compute = compute in advance.

 If I understand correctly, you have 30 random numbers (six dice, five
 state changes). You want the sum of the last six random numbers.

 Right now, you appear to be generating those random numbers on the
 fly. Rather than do that, compute them in advance. Then, you do not
 have to worry about wait that each animation has ended to calculate
 the sum of each roll, because you already know the values.

 Or, just pre-compute the last six random numbers (the ones you need to
 sum), so on your last state change, you go to the pre-computed value
 rather than generating another random number on the fly.

 If your problem is more about displaying the sum at the right time,
 more so than calculating it, just use a single AnimationListener on
 one of your dice. If they are all animating simultaneously, they will
 all end simultaneously, so just pick one and use that to time the
 display of your sum.

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

 Android 2.2 Programming Books:http://commonsware.com/books

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


[android-developers] Re: TCP problem - hangs when reading server's response

2010-11-14 Thread Hal

The following should work (taken from Jt.InputStream component)
It uses read and a buffer. It also checks for maxLenght (which you
probably
don't need). Keep in mind that read may return less bytes than
requested.

At least something like this should give you an idea of what is
happening (exceptions,
log messages, etc)


   try {

handleTrace (readStream:available: +
istream.available ());

while ((len = istream.read (buf, 0, bufferSize))  0)
{

handleTrace (readStream: + len);
buffer1 = new byte [len];

i = 0;
while (i  len) {
buffer1[i] = buf[i];
i++;
}


buff.setBuffer (buffer1);


if (readStream) {

count += len;

if (count  maxLength) {
handleError (maxLenth exceeded: +
maxLength);
return (null);
}

if (sbuffer == null)
sbuffer = new StringBuffer ();

sbuffer.append(new String (buffer1));
}
}


} catch (Exception e) {
handleException (e);
return (null);
}

return (sbuffer!=null?sbuffer.toString():null);

On Nov 13, 9:11 pm, bobetko bobe...@gmail.com wrote:
 I am trying to write client for Android which is supposed to
 communicate with PC server application on local network.
 Server app is written by my friend in C#. Currently there is an iPhone
 app that is using this server application with no problems.

 I have very simple code for TCP client:

 1. Socket s = new Socket(server, port);
 2. OutputStream out = s.getOutputStream();
 3. PrintWriter output = new PrintWriter(out);
 4. output.println(ACTION=NextVALUE=0);
 5. BufferedReader input = new BufferedReader(new
 InputStreamReader(s.getInputStream()));
 6. String st = input.readLine();

 I went through many TCP implementation examples, and they are all
 similar. Pretty much like my code above.
 My app freezes on line 6 when I try to read response from the server.
 It doesn't cause any errors (no exceptions), nothing shows in
 debugger, just timeout error after awhile. Server is supposed to
 return string OK after executing my action in line 4.
 I don't understand why this code hangs. Input is not NULL (I've
 checked it). I would expect some exception to be thrown or simply
 empty string to be returned.

 So? What am I missing? Could it be problem with some special
 characters that server app is sending and android can't handle that?
 Do I need any special permission in my manifest?

 I am positive that I have correct IP address and correct port number.
 I can see that on server application running on my PC.

 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: Image loading from remote problem

2010-11-14 Thread umakantpatil
Thanks Kumar,
I said it previous that i know i can load it async or in new thread.
But after getting the image I don't know how to replace that image
back in textview.

Can you help me with small piece of code that how can i do it ?

On Oct 27, 4:05 pm, Kumar Bibek coomar@gmail.com wrote:
 Do the fetching image part in a thread. That will solve your problem.

 On Wed, Oct 27, 2010 at 4:25 PM, umakantpatil umakantpat...@gmail.comwrote:











  I have HTML text, I need to show it in textview. I did it. There are
  some images in it. I also made ImageGetter
  which loads image from remote server and displays it. But the issue is
  now its very slow.
  I know i can load it async. But i haven't got a single example or help
  for this.

  Below is the code to get the image

  �...@override
                 public Drawable getDrawable(String source) {
                         Drawable drawable = null;
                         Bitmap bitmap = null;
                     InputStream in = null;
                     BufferedOutputStream out = null;
                     try {
                             in = new BufferedInputStream(new
  URL(source).openStream(),4096);
                         final ByteArrayOutputStream dataStream = new
  ByteArrayOutputStream();
                         out = new BufferedOutputStream(dataStream, 4096);
                         copy(in, out);
                         out.flush();
                         final byte[] data = dataStream.toByteArray();
                         bitmap = BitmapFactory.decodeByteArray(data, 0,
  data.length);
                         drawable = new BitmapDrawable(bitmap);

                             int width = getScreen();
                             int fin = width - 120;

                         drawable.setBounds(0, 0, fin, 200);
                         return drawable;
                     }catch (Throwable e) {
                         return null;
                 }
  }

  Can any one tell my how can get it async without stopping UI?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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


Re: [android-developers] not well-formed invalid token parser.pm

2010-11-14 Thread Frank Weiss
Without more detailed debugging info, I would guess that there is a
character coding issue.

If the input stream reader is expecting UTF-8, the copyright symbol,
U+00AA, would be three bytes: 0xE2, 0x84, 0xA2. In Latin-1/ISO-8859-1, it
would be 0xAA. However, 0xAA is an invalid UTF-8 code.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: TCP problem - hangs when reading server's response

2010-11-14 Thread Frank Weiss
I suppose I'm a bit rusty on socket networking, since I've been using mostly
HTTP, but let's give it a try.

It would be very helpful to determine if the server is actually sending a
response. But some possible problems:

After the output.println, perhaps it's necessary to flush the output buffer.

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

2010-11-14 Thread Marcin Orlowski
On 14 November 2010 17:26, Neilz neilhorn...@gmail.com wrote:
 Hi all. I have a custom dialog, which contains a WebView. If the
 content of the webview is too much, the dialog size is too high for
 the screen, and the 'ok' button drops off the bottom of the screen. I
 can't seem to find a way to limit the size of the dialog. I can
 achieve it with layoutHeight but that's no good, as I want it to
 wrap when there is less text. The element maxHeight seems to have no
 effect.

Why not use ScrollView container?

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

2010-11-14 Thread Neilz
WebView has its own Scrolling. I tried it already, and it made no
difference to the overall layout problem!

On Nov 14, 6:43 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 14 November 2010 17:26, Neilz neilhorn...@gmail.com wrote:

  Hi all. I have a custom dialog, which contains a WebView. If the
  content of the webview is too much, the dialog size is too high for
  the screen, and the 'ok' button drops off the bottom of the screen. I
  can't seem to find a way to limit the size of the dialog. I can
  achieve it with layoutHeight but that's no good, as I want it to
  wrap when there is less text. The element maxHeight seems to have no
  effect.

 Why not use ScrollView container?

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

2010-11-14 Thread kk
Hi all,

I've written a game and I've noticed that after playing for about
20-30 minutes the performance starts degrading.
By performance degradation I mean my average frames-per-second seem to
slowly drop.
I've no idea what could be causing this so any help would be greatly
appreciated.

I'm doing all my allocs at the beginning and the only things that
alloc in game according to DDMS are
Integer.toString operations (for integer values I need to draw with
drawtext) and setBounds on some drawables.
(I've no idea how to stop these from happening, so again, if you know
a way around this please do tell).

I'm calling System.gc() periodically, when I know not much is going on
in-game (e.g. between waves of enemies).
I'm doing this in order to avoid GC from happening during critical
gameplay periods.

If you know the answer to any of the following, please do tell (even a
guess would do :)):

+ Why is performance degrading with time? What could be causing this?
+ Is there a way to avoid allocs due to Integer.toString and
Drawable.setBounds calls?

Thank you in advance,
kk.

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


[android-developers] Camera saving corrupted photos

2010-11-14 Thread Stephen Lebed
I can't figure out why I'm getting corrupted images when I save them
in my app.  In fact the thumbnail seems to be fine, but the actual
image is corrupted, as if the stride value is not being set
correctly.  The following is the code I'm using the save the image,
which is taken from other version of camera apps almost directly.  In
other apps it seems to be saving images without problem.  This is
called from a Camera.PictureCallback.onPictureTaken(byte[] data,
Camera camera)


File filename = new File(Test_SnapShotK.jpg);
File exportDir = new File(Environment.getExternalStorageDirectory(),
TestDir);

if (!exportDir.exists()) {
exportDir.mkdirs();
Log.i(TAG, making directory  + exportDir.toString());
}

File file = new File(exportDir, filename.getName());

try {
FileOutputStream fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(data);
fileOutputStream.flush();
fileOutputStream.close();

} catch (IOException e) {
Log.e(TAG, e.getMessage(), e);
}

Since I can't attach the image I'm getting directly in this post, here
is a link to it.

http://www.mechnology.com/Test_SnapShotK.jpg

Has anyone else gotten this problem and have been able to resolve it.
I'm testing this on a G2 phone.  Any help is greatly appreciated.


Stephen

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

2010-11-14 Thread blindfold
2.592 x 1.952 looks like an unusual (unsupported) image size to me.
Maybe try 2.592 x 1.944?

Regards

On Nov 14, 7:58 pm, Stephen Lebed srle...@gmail.com wrote:
 I can't figure out why I'm getting corrupted images when I save them
 in my app.  In fact the thumbnail seems to be fine, but the actual
 image is corrupted, as if the stride value is not being set
 correctly.  The following is the code I'm using the save the image,
 which is taken from other version of camera apps almost directly.  In
 other apps it seems to be saving images without problem.  This is
 called from a Camera.PictureCallback.onPictureTaken(byte[] data,
 Camera camera)

 File filename = new File(Test_SnapShotK.jpg);
 File exportDir = new File(Environment.getExternalStorageDirectory(),
 TestDir);

 if (!exportDir.exists()) {
         exportDir.mkdirs();
         Log.i(TAG, making directory  + exportDir.toString());

 }

 File file = new File(exportDir, filename.getName());

 try {
         FileOutputStream fileOutputStream = new FileOutputStream(file);
         fileOutputStream.write(data);
         fileOutputStream.flush();
         fileOutputStream.close();

 } catch (IOException e) {

         Log.e(TAG, e.getMessage(), e);

 }

 Since I can't attach the image I'm getting directly in this post, here
 is a link to it.

 http://www.mechnology.com/Test_SnapShotK.jpg

 Has anyone else gotten this problem and have been able to resolve it.
 I'm testing this on a G2 phone.  Any help is greatly appreciated.

 Stephen

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

2010-11-14 Thread coy
Hello,
I have map in my android app.
On emulator is everything OK.
But on device (Motorola Droid) the map shows marker but doesn't show
real map in background!!
The conection is OK and I held the INTERNET permission in my manifest.
What is causing this problem? Any idea?

thnks!

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

2010-11-14 Thread Bret Foreman
How many different integer values do you need? You could generate a
few hundred strings in advance and use a look-up table for speed.

Also, are you using SQLite or the Preferences editor? Those can slow
down as the amount of data they use gets larger.

On Nov 14, 10:54 am, kk kkostia...@gmail.com wrote:
 Hi all,

 I've written a game and I've noticed that after playing for about
 20-30 minutes the performance starts degrading.
 By performance degradation I mean my average frames-per-second seem to
 slowly drop.
 I've no idea what could be causing this so any help would be greatly
 appreciated.

 I'm doing all my allocs at the beginning and the only things that
 alloc in game according to DDMS are
 Integer.toString operations (for integer values I need to draw with
 drawtext) and setBounds on some drawables.
 (I've no idea how to stop these from happening, so again, if you know
 a way around this please do tell).

 I'm calling System.gc() periodically, when I know not much is going on
 in-game (e.g. between waves of enemies).
 I'm doing this in order to avoid GC from happening during critical
 gameplay periods.

 If you know the answer to any of the following, please do tell (even a
 guess would do :)):

 + Why is performance degrading with time? What could be causing this?
 + Is there a way to avoid allocs due to Integer.toString and
 Drawable.setBounds calls?

 Thank you in advance,
 kk.

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


Re: [android-developers] Game performance degrading over time - any ideas?

2010-11-14 Thread Dianne Hackborn
Have you tried running the profiling at the beginning and then later when it
is noticeable slower, and comparing the two results?

On Sun, Nov 14, 2010 at 10:54 AM, kk kkostia...@gmail.com wrote:

 Hi all,

 I've written a game and I've noticed that after playing for about
 20-30 minutes the performance starts degrading.
 By performance degradation I mean my average frames-per-second seem to
 slowly drop.
 I've no idea what could be causing this so any help would be greatly
 appreciated.

 I'm doing all my allocs at the beginning and the only things that
 alloc in game according to DDMS are
 Integer.toString operations (for integer values I need to draw with
 drawtext) and setBounds on some drawables.
 (I've no idea how to stop these from happening, so again, if you know
 a way around this please do tell).

 I'm calling System.gc() periodically, when I know not much is going on
 in-game (e.g. between waves of enemies).
 I'm doing this in order to avoid GC from happening during critical
 gameplay periods.

 If you know the answer to any of the following, please do tell (even a
 guess would do :)):

 + Why is performance degrading with time? What could be causing this?
 + Is there a way to avoid allocs due to Integer.toString and
 Drawable.setBounds calls?

 Thank you in advance,
 kk.

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

Re: [android-developers] Re: TCP problem - hangs when reading server's response

2010-11-14 Thread Kostya Vasilyev
Another way to debug this is:

Run your code in the emulator, and run a tcp/ip protocol sniffer on the host
computer at the same time (WireShark, etc.)

See if any traffic is getting to the server at all, and what it sends to the
client.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

14.11.2010 21:13 пользователь Frank Weiss fewe...@gmail.com написал:

I suppose I'm a bit rusty on socket networking, since I've been using mostly
HTTP, but let's give it a try.

It would be very helpful to determine if the server is actually sending a
response. But some possible problems:

After the output.println, perhaps it's necessary to flush the output buffer.





-- 
You received this message because you are subscribed to the Google
Groups Android Develop...

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

2010-11-14 Thread Mat
First of all, thank you for your answers and sorry for the delay. I've
run a lot of tests.

The best solution I found for now is to put each list view inside a
LinearLayout and specified width on it. This works to display list
views side by side. Unfortunately I've noticed that if I ask the list
to fill its parent, the layout don't display as I expect. It seems
that ListView bypass the width parameter of the parent.

As I can't ask the list to fill its parent, items I put inside the
list don't fill the list horizontally. I also tried to change width on
the layout used by each item inside the list but it doesn't work too.
So I'm now stuck on this. Here is my current layout :

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=horizontal
android:layout_width=fill_parent
android:layout_height=fill_parent

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_height=fill_parent
android:layout_width=wrap_content
android:layout_weight=0.3

TextView
android:text=List1
android:layout_height=wrap_content
android:layout_width=wrap_content /

ListView
android:id=@+id/list_1
android:layout_height=wrap_content
android:layout_width=wrap_content / !-- I would 
like to use
this : android:layout_width=fill_parent --

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=horizontal
android:layout_height=fill_parent
android:layout_width=wrap_content
Button
android:text=Add
android:id=@+id/add_list_1
android:layout_height=wrap_content
android:layout_width=wrap_content /

Button
android:text=Delete
android:id=@+id/delete_list_1
android:layout_height=wrap_content
android:layout_width=wrap_content /
/LinearLayout

/LinearLayout

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_height=fill_parent
android:layout_width=wrap_content
android:layout_weight=0.3

TextView
android:text=List2
android:layout_height=wrap_content
android:layout_width=wrap_content /

ListView
android:id=@+id/list_2
android:layout_height=wrap_content
android:layout_width=wrap_content / !-- same here 
--
/LinearLayout

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_height=fill_parent
android:layout_width=wrap_content
android:layout_weight=0.3

TextView
android:text=List3
android:layout_height=wrap_content
android:layout_width=wrap_content /

ListView
android:id=@+id/list_3
android:layout_height=wrap_content
android:layout_width=wrap_content / !-- here also 
--
/LinearLayout

/LinearLayout


On the other hand, I've tried to use a TableLayout. It works but it's
not easy to manage other components around the list.

In fact, I struggle with Android layouts. I don't understand how it
can be so difficult to do a so simple design. The fact is whatever
parameter I use, it never displays as I like it to be. Perhaps my
mistake is I tend to use too deep layout as you often do in HTML.

Anyway, I'll keep this topic updated for those who are interested.

Mat.

On Nov 4, 1:48 am, intbt in...@tacberry.com wrote:
 You can set the layout_width in the xml file to x pixels to control
 the width, use a TableLayout to add adjacent listviews, but it is a
 small screen so it gets crowded in  a hurry.

                 ListView
                         android:id=@+id/listvw01
                         android:layout_width=45px
                         android:layout_height=250px
                         android:typeface=serif
                         android:textSize=32px
                         android:paddingLeft=10px
                         android:paddingRight=20px
                         android:layout_marginTop=38px
                

[android-developers] Re: Android Market Licensing Problem

2010-11-14 Thread John Gaby
I have been able to reproduce this problem on my development phone.
If I reset my phone so that there are no accounts at all, then I
receive a 'deny' response.  If I log into my phone with my developer
id, then I can control the response via the Google Developer Console.
However, if I reset my phone and then log in with any random, non-
developer account, then I seem to always get an 'allow' response.
Someone please tell me that this is NOT going to happen once I publish
my app.

Thanks.

On Nov 14, 8:00 am, John Gaby jg...@gabysoft.com wrote:
 Actually, that thought has occurred to me (I have already read that
 thread), but really, how am I supposed to be able to test my app
 before I publish it if that is the case?

 On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:

  Perhaps the responses aren't correct because your app is not
  published.

  this thread may provide some 
  insight:http://groups.google.com/group/android-developers/browse_thread/threa...

  On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

   I have added some logging code and found that the raw response from
   theLicenseService (i.e. the call back to verifyLicense in
   LicenseChecker.java) has a responseCode of '0', which means
   'licensed'.  This is simply not correct.  This phone does NOT have a
   valid account which would generate such a response.  Can someone
   please explain why this is happening.  Does thisLicenseService
   simply not work correctly on a large number of phones?  Does using the
   service have any value at all?

   Thanks.

   On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

I recently did my own LVL implementation and I can tell you that
tracing these issues down is a real pain. First you need to put loads
of logging into the LVL code to find out what the actual response is,
otherwise you have no visibility, then you have to put logging into
all the code between the response and the allow/dontallow callbacks.

Basically what I found was the stock code was unworkable in many ways.
I quickly came to the conclusion that I needed to modify it into
something that worked for me. There's a few reasons behind why you
should abandon the stock code:
- if you use the stock implementation then crackers will find it very
easy to circumvent
- as you have found it is very hard to debug. You have to spend so
much time figuring out how it works you may as well roll your own
instead.
- who's to say whether the google responses are what you want? How
many retries do you want before it sends a dontAllow back? Maybe you
want to treat the error responses as a retry. Do you want google to
specify that or yourself? Do you want them to specify the time between
checks? It's better to take control of this process so you know
exactly what is going on and you can manage the user experience.

In the system I came up with in the end all I use is the response and
none of the extras. What I do with the response is all custom, that
way I can use the market test responses in development without
issues.

-BB

On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

 I am using pretty much the default Android Market Licensing in my
 application, but find that it is not working correctly on most of the
 devices that I have tested.  I have uploaded my app to the Market but
 not published it.  If install it on the emulator which does not have
 any Google accounts, then I receive a 'dontAllow' from the check,
 which is correct.

 If I install it on a Motorola Droid phone (which I have in my
 possession) that has my Market Google account associated with it, then
 it will return 'allow' or 'don't allow' depending on how I set the
 test market. I have also installed it on an HTC Incredible phone, and
 it seems to work there as well.

 However, I have tested 4 other phones (HTC Hero, HTC Brovo Desire, HTC
 Droid Eris and HTC Nexus One), and on each of these phones, I get an
 'allow' call from thelicensecheck, even though there is no
 authorizing account on the phone.  Can someone tell me what is going
 on here?

 Thanks.

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


[android-developers] Calling an external application problem.

2010-11-14 Thread Diego Queiroz
Hi there!

I'm having some trouble linking my app to another.
What i want to do is call the battery use app from android settings.
So i have to know the action and the component called to start this app, ok?
Here's my code:

ComponentName cn = new ComponentName(com.android.settings,
.fuelgauge.PowerUsageSummary);

Intent i = new Intent(android.intent.action.MAIN);

i.setComponent(cn);

startActivity(i);


and the error:


11-14 19:06:50.136: ERROR/AndroidRuntime(361): Uncaught handler: thread main
exiting due to uncaught exception

11-14 19:06:50.166: ERROR/AndroidRuntime(361):
android.content.ActivityNotFoundException: Unable to find explicit activity
class {com.android.settings/.fuelgauge.PowerUsageSummary}; have you declared
this activity in your AndroidManifest.xml?

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.startActivityForResult(Activity.java:2749)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.startActivity(Activity.java:2855)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.noapparatus.ramuh.Play$5.onClick(Play.java:192)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.performClick(View.java:2364)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.onTouchEvent(View.java:4179)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.widget.TextView.onTouchEvent(TextView.java:6540)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.dispatchTouchEvent(View.java:3709)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.os.Handler.dispatchMessage(Handler.java:99)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.os.Looper.loop(Looper.java:123)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.ActivityThread.main(ActivityThread.java:4363)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
java.lang.reflect.Method.invokeNative(Native Method)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
java.lang.reflect.Method.invoke(Method.java:521)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
dalvik.system.NativeStart.main(Native Method)


Do i need to do some declaration on the manifest file?

Ty in advance =)


-- 
*Diego Queiroz*

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

2010-11-14 Thread bagelboy
You can't, basically. All you can do is publish and hope their system
works. My answer to this problem was to not use the response extras
and to create a system that can deal with an incorrect response here
and there.

On Nov 14, 4:00 pm, John Gaby jg...@gabysoft.com wrote:
 Actually, that thought has occurred to me (I have already read that
 thread), but really, how am I supposed to be able to test my app
 before I publish it if that is the case?

 On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:

  Perhaps the responses aren't correct because your app is not
  published.

  this thread may provide some 
  insight:http://groups.google.com/group/android-developers/browse_thread/threa...

  On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

   I have added some logging code and found that the raw response from
   theLicenseService (i.e. the call back to verifyLicense in
   LicenseChecker.java) has a responseCode of '0', which means
   'licensed'.  This is simply not correct.  This phone does NOT have a
   valid account which would generate such a response.  Can someone
   please explain why this is happening.  Does thisLicenseService
   simply not work correctly on a large number of phones?  Does using the
   service have any value at all?

   Thanks.

   On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

I recently did my own LVL implementation and I can tell you that
tracing these issues down is a real pain. First you need to put loads
of logging into the LVL code to find out what the actual response is,
otherwise you have no visibility, then you have to put logging into
all the code between the response and the allow/dontallow callbacks.

Basically what I found was the stock code was unworkable in many ways.
I quickly came to the conclusion that I needed to modify it into
something that worked for me. There's a few reasons behind why you
should abandon the stock code:
- if you use the stock implementation then crackers will find it very
easy to circumvent
- as you have found it is very hard to debug. You have to spend so
much time figuring out how it works you may as well roll your own
instead.
- who's to say whether the google responses are what you want? How
many retries do you want before it sends a dontAllow back? Maybe you
want to treat the error responses as a retry. Do you want google to
specify that or yourself? Do you want them to specify the time between
checks? It's better to take control of this process so you know
exactly what is going on and you can manage the user experience.

In the system I came up with in the end all I use is the response and
none of the extras. What I do with the response is all custom, that
way I can use the market test responses in development without
issues.

-BB

On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

 I am using pretty much the default Android Market Licensing in my
 application, but find that it is not working correctly on most of the
 devices that I have tested.  I have uploaded my app to the Market but
 not published it.  If install it on the emulator which does not have
 any Google accounts, then I receive a 'dontAllow' from the check,
 which is correct.

 If I install it on a Motorola Droid phone (which I have in my
 possession) that has my Market Google account associated with it, then
 it will return 'allow' or 'don't allow' depending on how I set the
 test market. I have also installed it on an HTC Incredible phone, and
 it seems to work there as well.

 However, I have tested 4 other phones (HTC Hero, HTC Brovo Desire, HTC
 Droid Eris and HTC Nexus One), and on each of these phones, I get an
 'allow' call from thelicensecheck, even though there is no
 authorizing account on the phone.  Can someone tell me what is going
 on here?

 Thanks.



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


Re: [android-developers] Calling an external application problem.

2010-11-14 Thread Kostya Vasilyev
You need to use fully qualified class name, not the leading dot shorthand
notation.

Also, this may not be part of the SDK (check), and as such may not work on
all phones.

Wrap your code in a try catch block, and handle ActivityNotFoundException.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

15.11.2010 1:17 пользователь Diego Queiroz dibo...@gmail.com написал:

Hi there!

I'm having some trouble linking my app to another.
What i want to do is call the battery use app from android settings.
So i have to know the action and the component called to start this app, ok?
Here's my code:

ComponentName cn = new ComponentName(com.android.settings,
.fuelgauge.PowerUsageSummary);

Intent i = new Intent(android.intent.action.MAIN);

i.setComponent(cn);

startActivity(i);


and the error:


11-14 19:06:50.136: ERROR/AndroidRuntime(361): Uncaught handler: thread main
exiting due to uncaught exception

11-14 19:06:50.166: ERROR/AndroidRuntime(361):
android.content.ActivityNotFoundException: Unable to find explicit activity
class {com.android.settings/.fuelgauge.PowerUsageSummary}; have you declared
this activity in your AndroidManifest.xml?

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.startActivityForResult(Activity.java:2749)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.startActivity(Activity.java:2855)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.noapparatus.ramuh.Play$5.onClick(Play.java:192)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.performClick(View.java:2364)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.onTouchEvent(View.java:4179)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.widget.TextView.onTouchEvent(TextView.java:6540)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.View.dispatchTouchEvent(View.java:3709)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.os.Handler.dispatchMessage(Handler.java:99)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.os.Looper.loop(Looper.java:123)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
android.app.ActivityThread.main(ActivityThread.java:4363)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
java.lang.reflect.Method.invokeNative(Native Method)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
java.lang.reflect.Method.invoke(Method.java:521)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

11-14 19:06:50.166: ERROR/AndroidRuntime(361): at
dalvik.system.NativeStart.main(Native Method)


Do i need to do some declaration on the manifest file?

Ty in advance =)


-- 
*Diego Queiroz*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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 

[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-14 Thread kk
Hey all,

Thank you for your replies. I don't use SQLite or the Preference
editor.
The string lookup is definitely something worth considering.

In terms of profiling, I do:

Debug.startMethodTracing(g1);

in OnCreate and then stop tracing in OnDestroy.
Are you saying that I should create 2 trace files,
say one for the first half and one for the second half
of the game and compare the results?

Sounds like a good plan - I just have no clue as to what
could be causing this degredation :(

cheers,
kk.


On Nov 14, 9:14 pm, Dianne Hackborn hack...@android.com wrote:
 Have you tried running the profiling at the beginning and then later when it
 is noticeable slower, and comparing the two results?









 On Sun, Nov 14, 2010 at 10:54 AM, kk kkostia...@gmail.com wrote:
  Hi all,

  I've written a game and I've noticed that after playing for about
  20-30 minutes the performance starts degrading.
  By performance degradation I mean my average frames-per-second seem to
  slowly drop.
  I've no idea what could be causing this so any help would be greatly
  appreciated.

  I'm doing all my allocs at the beginning and the only things that
  alloc in game according to DDMS are
  Integer.toString operations (for integer values I need to draw with
  drawtext) and setBounds on some drawables.
  (I've no idea how to stop these from happening, so again, if you know
  a way around this please do tell).

  I'm calling System.gc() periodically, when I know not much is going on
  in-game (e.g. between waves of enemies).
  I'm doing this in order to avoid GC from happening during critical
  gameplay periods.

  If you know the answer to any of the following, please do tell (even a
  guess would do :)):

  + Why is performance degrading with time? What could be causing this?
  + Is there a way to avoid allocs due to Integer.toString and
  Drawable.setBounds calls?

  Thank you in advance,
  kk.

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


RE: [android-developers] Maps doesn't show

2010-11-14 Thread Tommy
Sounds like you don't have the right API key in. You need one for
Developement and one for Production. So one for when you push it to the
phone from Eclipse or whatever and one You use when you publish the
application. That sounds like your issue right there. I had it happen to me
where it shows the markers but it won't actually load the map tiles. Check
that API key, if you don't have one you need one :) 

Hope that helps.

Tommy

Android Mobile Phone Application Developer
Database Administrator
.net Web Specialist

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of coy
Sent: Sunday, November 14, 2010 4:08 PM
To: Android Developers
Subject: [android-developers] Maps doesn't show

Hello,
I have map in my android app.
On emulator is everything OK.
But on device (Motorola Droid) the map shows marker but doesn't show
real map in background!!
The conection is OK and I held the INTERNET permission in my manifest.
What is causing this problem? Any idea?

thnks!

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

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


[android-developers] Re: Fetch Spinner value outside setOnItemSelectedListener

2010-11-14 Thread A. Elk
Which tutorial is flawed? As far as I can tell, the Spinner sample app
and the testing tutorial are correct. Perhaps you assumed something
about the Android system that isn't true?

On Nov 12, 7:11 pm, sisko adeod...@gmail.com wrote:
 Tried your suggestion and it's worked.

 Sorry for wasting your time. I'm a newbie following what has turned
 out to be a flawed tutorial.

 Thanks for your patience and help.

 On Nov 12, 3:29 pm, TreKing treking...@gmail.com wrote:







  On Fri, Nov 12, 2010 at 5:05 AM, sisko adeod...@gmail.com wrote:
   So the input is set in a sharedpreference and writing that value back into
   the EditView whenever the activity is restarted.

  Then just do the same thing with the index of the spinner.

  --- 
  --
  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] Re: Camera saving corrupted photos

2010-11-14 Thread Stephen Lebed
It is a supported size on the g2.  I'm not specifying the size, its
the default res for the camera.

It looks like part of the problem is with

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

I use this in the onCreate method.  Again, I use this all the time,
but when I comment out this line, I can save uncorrupted images. I'm
still hunting for an answer.  It is related to my layout xml.



On Nov 14, 12:53 pm, blindfold seeingwithso...@gmail.com wrote:
 2.592 x 1.952 looks like an unusual (unsupported) image size to me.
 Maybe try 2.592 x 1.944?

 Regards

 On Nov 14, 7:58 pm, Stephen Lebed srle...@gmail.com wrote:







  I can't figure out why I'm getting corrupted images when I save them
  in my app.  In fact the thumbnail seems to be fine, but the actual
  image is corrupted, as if the stride value is not being set
  correctly.  The following is the code I'm using the save the image,
  which is taken from other version of camera apps almost directly.  In
  other apps it seems to be saving images without problem.  This is
  called from a Camera.PictureCallback.onPictureTaken(byte[] data,
  Camera camera)

  File filename = new File(Test_SnapShotK.jpg);
  File exportDir = new File(Environment.getExternalStorageDirectory(),
  TestDir);

  if (!exportDir.exists()) {
          exportDir.mkdirs();
          Log.i(TAG, making directory  + exportDir.toString());

  }

  File file = new File(exportDir, filename.getName());

  try {
          FileOutputStream fileOutputStream = new FileOutputStream(file);
          fileOutputStream.write(data);
          fileOutputStream.flush();
          fileOutputStream.close();

  } catch (IOException e) {

          Log.e(TAG, e.getMessage(), e);

  }

  Since I can't attach the image I'm getting directly in this post, here
  is a link to it.

 http://www.mechnology.com/Test_SnapShotK.jpg

  Has anyone else gotten this problem and have been able to resolve it.
  I'm testing this on a G2 phone.  Any help is greatly appreciated.

  Stephen

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

2010-11-14 Thread Zsolt Vasvari
I also think there is a problem.

I released my app with LVL.  I haven't gotten any reports of false
negatives, but, contrary to my expectation, I still haven't had a
pirate later repurchase my app.  I define a pirate as somebody who
requests a refund within 20 minutes of purchase.  That's about 10% of
my purchases, which, in a week amounts to about 15 people.

Now, I know the majority people pirating wouldn't pay for it in the
first place, but certainly some percentage would.  But I had not one
person do that.  While there is no emperical evidence, the most likely
explantion I could come up wuth is that LVL returns allowed even if
not licensed.  I use the extras fields returned by Google, so it's
also possible that the liicense is still valid after a week, no idea.



On Nov 15, 6:21 am, bagelboy greg.do...@gmail.com wrote:
 You can't, basically. All you can do is publish and hope their system
 works. My answer to this problem was to not use the response extras
 and to create a system that can deal with an incorrect response here
 and there.

 On Nov 14, 4:00 pm, John Gaby jg...@gabysoft.com wrote:



  Actually, that thought has occurred to me (I have already read that
  thread), but really, how am I supposed to be able to test my app
  before I publish it if that is the case?

  On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:

   Perhaps the responses aren't correct because your app is not
   published.

   this thread may provide some 
   insight:http://groups.google.com/group/android-developers/browse_thread/threa...

   On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

I have added some logging code and found that the raw response from
theLicenseService (i.e. the call back to verifyLicense in
LicenseChecker.java) has a responseCode of '0', which means
'licensed'.  This is simply not correct.  This phone does NOT have a
valid account which would generate such a response.  Can someone
please explain why this is happening.  Does thisLicenseService
simply not work correctly on a large number of phones?  Does using the
service have any value at all?

Thanks.

On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

 I recently did my ownLVLimplementation and I can tell you that
 tracing these issues down is a real pain. First you need to put loads
 of logging into theLVLcode to find out what the actual response is,
 otherwise you have no visibility, then you have to put logging into
 all the code between the response and the allow/dontallow callbacks.

 Basically what I found was the stock code was unworkable in many ways.
 I quickly came to the conclusion that I needed to modify it into
 something that worked for me. There's a few reasons behind why you
 should abandon the stock code:
 - if you use the stock implementation then crackers will find it very
 easy to circumvent
 - as you have found it is very hard to debug. You have to spend so
 much time figuring out how it works you may as well roll your own
 instead.
 - who's to say whether the google responses are what you want? How
 many retries do you want before it sends a dontAllow back? Maybe you
 want to treat the error responses as a retry. Do you want google to
 specify that or yourself? Do you want them to specify the time between
 checks? It's better to take control of this process so you know
 exactly what is going on and you can manage the user experience.

 In the system I came up with in the end all I use is the response and
 none of the extras. What I do with the response is all custom, that
 way I can use the market test responses in development without
 issues.

 -BB

 On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

  I am using pretty much the default Android Market Licensing in my
  application, but find that it is not working correctly on most of 
  the
  devices that I have tested.  I have uploaded my app to the Market 
  but
  not published it.  If install it on the emulator which does not have
  any Google accounts, then I receive a 'dontAllow' from the check,
  which is correct.

  If I install it on a Motorola Droid phone (which I have in my
  possession) that has my Market Google account associated with it, 
  then
  it will return 'allow' or 'don't allow' depending on how I set the
  test market. I have also installed it on an HTC Incredible phone, 
  and
  it seems to work there as well.

  However, I have tested 4 other phones (HTC Hero, HTC Brovo Desire, 
  HTC
  Droid Eris and HTC Nexus One), and on each of these phones, I get an
  'allow' call from thelicensecheck, even though there is no
  authorizing account on the phone.  Can someone tell me what is going
  on here?

  Thanks.- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are 

[android-developers] Re: Android Market Licensing Service

2010-11-14 Thread Zsolt Vasvari
That's a very useful blog, thanks.

On Nov 14, 12:41 am, MarcoAndroid marco...@gmail.com wrote:
 Here's some experiences/lessons learned, maybe 
 useful:http://ttlnews.blogspot.com/2010/11/my-experience-with-android-market...

 On 21 sep, 13:24, gcstang gcst...@gmail.com wrote:



  I figured, not a problem I just had to ask.

  Thank you anyways

  On Sep 20, 2:38 am, String sterling.ud...@googlemail.com wrote:

   On Sep 18, 6:46 pm, gcstang gcst...@gmail.com wrote:

Are there any examples of how you implemented it that you're willing
to share?

   Probably not, I'm afraid. Sorry.

   The LVL blog post may seem overwhelming to a beginner, but
   unfortunately, it's the level of detail you need.  And it does have
   code samples, including instructions on where in your own code to put
   the interface points.

   As for the modifications I made, I'm ABSOLUTELY not going to post more
   details about them. Not only would that give pirates a leg up on
   cracking my own apps, the whole point is that every dev needs to make
   their OWN modifications, so that every app will need to be cracked
   individually.

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


Re: [android-developers] Re: Camera saving corrupted photos

2010-11-14 Thread Mark Murphy
Try setting fullscreen in your manifest instead:

android:theme=@android:style/Theme.NoTitleBar.Fullscreen

On Sun, Nov 14, 2010 at 7:26 PM, Stephen Lebed srle...@gmail.com wrote:
 It is a supported size on the g2.  I'm not specifying the size, its
 the default res for the camera.

 It looks like part of the problem is with

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

 I use this in the onCreate method.  Again, I use this all the time,
 but when I comment out this line, I can save uncorrupted images. I'm
 still hunting for an answer.  It is related to my layout xml.



 On Nov 14, 12:53 pm, blindfold seeingwithso...@gmail.com wrote:
 2.592 x 1.952 looks like an unusual (unsupported) image size to me.
 Maybe try 2.592 x 1.944?

 Regards

 On Nov 14, 7:58 pm, Stephen Lebed srle...@gmail.com wrote:







  I can't figure out why I'm getting corrupted images when I save them
  in my app.  In fact the thumbnail seems to be fine, but the actual
  image is corrupted, as if the stride value is not being set
  correctly.  The following is the code I'm using the save the image,
  which is taken from other version of camera apps almost directly.  In
  other apps it seems to be saving images without problem.  This is
  called from a Camera.PictureCallback.onPictureTaken(byte[] data,
  Camera camera)

  File filename = new File(Test_SnapShotK.jpg);
  File exportDir = new File(Environment.getExternalStorageDirectory(),
  TestDir);

  if (!exportDir.exists()) {
          exportDir.mkdirs();
          Log.i(TAG, making directory  + exportDir.toString());

  }

  File file = new File(exportDir, filename.getName());

  try {
          FileOutputStream fileOutputStream = new FileOutputStream(file);
          fileOutputStream.write(data);
          fileOutputStream.flush();
          fileOutputStream.close();

  } catch (IOException e) {

          Log.e(TAG, e.getMessage(), e);

  }

  Since I can't attach the image I'm getting directly in this post, here
  is a link to it.

 http://www.mechnology.com/Test_SnapShotK.jpg

  Has anyone else gotten this problem and have been able to resolve it.
  I'm testing this on a G2 phone.  Any help is greatly appreciated.

  Stephen

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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

2010-11-14 Thread Zsolt Vasvari
 As for the modifications I made, I'm ABSOLUTELY not going to post more
 details about them. Not only would that give pirates a leg up on
 cracking my own apps, the whole point is that every dev needs to make
 their OWN modifications, so that every app will need to be cracked
 individually.

I don't think any amount of modification will make it hard to crack
LVL.  I've done my share of cracking back in the C64 days and the LVL
stuff is, frankly, a joke.  I cannot imagine modifing it enough not to
be a joke.

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

2010-11-14 Thread Dianne Hackborn
Yes use the am profiling command (adb shell am profile ...) to start and
stop profiling early on, and then later when it is slow, and see what is
different.

On Sun, Nov 14, 2010 at 2:35 PM, kk kkostia...@gmail.com wrote:

 Hey all,

 Thank you for your replies. I don't use SQLite or the Preference
 editor.
 The string lookup is definitely something worth considering.

 In terms of profiling, I do:

 Debug.startMethodTracing(g1);

 in OnCreate and then stop tracing in OnDestroy.
 Are you saying that I should create 2 trace files,
 say one for the first half and one for the second half
 of the game and compare the results?

 Sounds like a good plan - I just have no clue as to what
 could be causing this degredation :(

 cheers,
 kk.


 On Nov 14, 9:14 pm, Dianne Hackborn hack...@android.com wrote:
  Have you tried running the profiling at the beginning and then later when
 it
  is noticeable slower, and comparing the two results?
 
 
 
 
 
 
 
 
 
  On Sun, Nov 14, 2010 at 10:54 AM, kk kkostia...@gmail.com wrote:
   Hi all,
 
   I've written a game and I've noticed that after playing for about
   20-30 minutes the performance starts degrading.
   By performance degradation I mean my average frames-per-second seem to
   slowly drop.
   I've no idea what could be causing this so any help would be greatly
   appreciated.
 
   I'm doing all my allocs at the beginning and the only things that
   alloc in game according to DDMS are
   Integer.toString operations (for integer values I need to draw with
   drawtext) and setBounds on some drawables.
   (I've no idea how to stop these from happening, so again, if you know
   a way around this please do tell).
 
   I'm calling System.gc() periodically, when I know not much is going on
   in-game (e.g. between waves of enemies).
   I'm doing this in order to avoid GC from happening during critical
   gameplay periods.
 
   If you know the answer to any of the following, please do tell (even a
   guess would do :)):
 
   + Why is performance degrading with time? What could be causing this?
   + Is there a way to avoid allocs due to Integer.toString and
   Drawable.setBounds calls?
 
   Thank you in advance,
   kk.
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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

Re: [android-developers] Activity display over incoming call screen

2010-11-14 Thread Dianne Hackborn
On Sun, Nov 14, 2010 at 3:27 AM, mohammad Rukab mohammad.ru...@gmail.comwrote:

 This issue can resolve through put a delay before fire new activity, but
 the issue is why previous  activity (activity before a call come) rearranged
 to be over call screen and before new activity


Well why do you think it would work correctly?  As I said, this is just a
matter of you trying to do something at the same time the platform is trying
to do something.  You are both running in two different processes, extremely
divorced from each other.  Which gets there first (what the user will
initially) and last (what the user will see at the end) is pretty much
arbitrary.

-- 
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: Game performance degrading over time - any ideas?

2010-11-14 Thread DanH
My guess is that you have a slow memory leak, and GC is taking more
and more time (and happening more frequently) as the garbage builds
up.  You need some traces and profiling to figure out what's going on.

On Nov 14, 12:54 pm, kk kkostia...@gmail.com wrote:
 Hi all,

 I've written a game and I've noticed that after playing for about
 20-30 minutes the performance starts degrading.
 By performance degradation I mean my average frames-per-second seem to
 slowly drop.
 I've no idea what could be causing this so any help would be greatly
 appreciated.

 I'm doing all my allocs at the beginning and the only things that
 alloc in game according to DDMS are
 Integer.toString operations (for integer values I need to draw with
 drawtext) and setBounds on some drawables.
 (I've no idea how to stop these from happening, so again, if you know
 a way around this please do tell).

 I'm calling System.gc() periodically, when I know not much is going on
 in-game (e.g. between waves of enemies).
 I'm doing this in order to avoid GC from happening during critical
 gameplay periods.

 If you know the answer to any of the following, please do tell (even a
 guess would do :)):

 + Why is performance degrading with time? What could be causing this?
 + Is there a way to avoid allocs due to Integer.toString and
 Drawable.setBounds calls?

 Thank you in advance,
 kk.

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


[android-developers] Getting Keyboard To Appear With Ought Having To Click on EditText

2010-11-14 Thread Prasanna Perera
Hello,

I am using a custom layout on an AlertDialog.  The custom layout has
an EditText filed which I am using to get a phone.  When I display the
AlertDialog, in order to get the keyboard to type in the phone number
you have to click on the EditText filed.  Is there a way to get the
keyboard to automatically pop up when I bring up the AlertDialog so
that the user does not have to click on the EditText filed to get the
Keyboard.

Thanks,
Prasanna

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

2010-11-14 Thread kevindroid
Hi,
  I have seen there is a voice input setting introduced for android
2.2, it has a language setting for voice input recognitions.
  Is there a way to read this settings from my app?

I read through the doc, didn't find anything.

But I found out I can add extra language to the RecognizerIntent,

ie. intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH );

But still I cant get my voice recognized when I have the language set
to chinese in voice input.

How do I detected if they have set to other languages rather than
English and prompt them to set it to English?

Thanks for help!

Kevin

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


[android-developers] Re: Camera saving corrupted photos

2010-11-14 Thread Stephen Lebed
Hi Mark,

Love your book BTW!

I've tried setting it in the manifest and still have the same issue.
Its frustrating because this seems to be the reason for the error.
I'd really love to use the app in full screen mode because I need as
much screen space as possible.



On Nov 14, 4:29 pm, Mark Murphy mmur...@commonsware.com wrote:
 Try setting fullscreen in your manifest instead:

 android:theme=@android:style/Theme.NoTitleBar.Fullscreen









 On Sun, Nov 14, 2010 at 7:26 PM, Stephen Lebed srle...@gmail.com wrote:
  It is a supported size on the g2.  I'm not specifying the size, its
  the default res for the camera.

  It looks like part of the problem is with

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

  I use this in the onCreate method.  Again, I use this all the time,
  but when I comment out this line, I can save uncorrupted images. I'm
  still hunting for an answer.  It is related to my layout xml.

  On Nov 14, 12:53 pm, blindfold seeingwithso...@gmail.com wrote:
  2.592 x 1.952 looks like an unusual (unsupported) image size to me.
  Maybe try 2.592 x 1.944?

  Regards

  On Nov 14, 7:58 pm, Stephen Lebed srle...@gmail.com wrote:

   I can't figure out why I'm getting corrupted images when I save them
   in my app.  In fact the thumbnail seems to be fine, but the actual
   image is corrupted, as if the stride value is not being set
   correctly.  The following is the code I'm using the save the image,
   which is taken from other version of camera apps almost directly.  In
   other apps it seems to be saving images without problem.  This is
   called from a Camera.PictureCallback.onPictureTaken(byte[] data,
   Camera camera)

   File filename = new File(Test_SnapShotK.jpg);
   File exportDir = new File(Environment.getExternalStorageDirectory(),
   TestDir);

   if (!exportDir.exists()) {
           exportDir.mkdirs();
           Log.i(TAG, making directory  + exportDir.toString());

   }

   File file = new File(exportDir, filename.getName());

   try {
           FileOutputStream fileOutputStream = new FileOutputStream(file);
           fileOutputStream.write(data);
           fileOutputStream.flush();
           fileOutputStream.close();

   } catch (IOException e) {

           Log.e(TAG, e.getMessage(), e);

   }

   Since I can't attach the image I'm getting directly in this post, here
   is a link to it.

  http://www.mechnology.com/Test_SnapShotK.jpg

   Has anyone else gotten this problem and have been able to resolve it.
   I'm testing this on a G2 phone.  Any help is greatly appreciated.

   Stephen

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

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

 Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Run instructions at the end of six animations played together

2010-11-14 Thread metal mikey
Nothing much is impossible.

You seem to be overcomplicating your problems:

Problem 1: Calculating the result at the right time.
Solution 1: Define the random numbers for each state of each TextView
BEFORE you even start animating...benefit of that is you can calculate
the result BEFORE you even start animating. In doing so you have
affectively put Problem 1 out of existence. This is what Mark
suggested.

Problem 2: Knowing when the dies have finished animating.
Solution 2: If you're having trouble using an AnimationListener, why
not try a simpler approach whereby you use a state pattern for each
die and manually control the visual state of each die? Then you not
only know when the animation has finished, you also know when the
animation is at step 1, step 2, step 3, etc.

On Nov 15, 4:00 am, gontran geoffroydecorb...@gmail.com wrote:
 Ok, I get your point, but my problem is both displaying and
 calculating the result at the right time because in my game, you roll
 dices to get an asset of points, to attack another player... So
 depending on the state of the game, the instructions run after each
 rolls are not always the same. so after each roll, I have to display
 the sum and other informations depending on the state of the game and
 maybe changing the state (I use the state design pattern).

 For me, the best solution would be to make a single animation to
 animate the six dices, but correct me if I'm wrong, it's impossible to
 make each dice rotate on itself with a single animation.

 Anyway, thank you for your time.

 On 14 nov, 16:36, Mark Murphy mmur...@commonsware.com wrote:

  On Sun, Nov 14, 2010 at 10:25 AM, gontran geoffroydecorb...@gmail.com 
  wrote:
   Thank you Mark for your answer, but could-you be more specific please?
   What do you mean by pre-compute?

  Pre-compute = compute in advance.

  If I understand correctly, you have 30 random numbers (six dice, five
  state changes). You want the sum of the last six random numbers.

  Right now, you appear to be generating those random numbers on the
  fly. Rather than do that, compute them in advance. Then, you do not
  have to worry about wait that each animation has ended to calculate
  the sum of each roll, because you already know the values.

  Or, just pre-compute the last six random numbers (the ones you need to
  sum), so on your last state change, you go to the pre-computed value
  rather than generating another random number on the fly.

  If your problem is more about displaying the sum at the right time,
  more so than calculating it, just use a single AnimationListener on
  one of your dice. If they are all animating simultaneously, they will
  all end simultaneously, so just pick one and use that to time the
  display of your sum.

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

  Android 2.2 Programming Books:http://commonsware.com/books

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


[android-developers] detection twist using orientation sensor

2010-11-14 Thread rukiman
At the moment I can detect rotation along the x-axis and also y-axis.
However imagine the user holding their phone looking at the screen, I
want to detect and measure how much the user has rotated their phone
to the left or right such that the screen is always vertical. I
thought this would correspond to the z-axis rotation but from my
logging it seems like there is also dramatic rotation on the other
axis. So my question is how can I detect the user rotating their
phone  in a twisting motion such that the screen is always facing the
user? I want to be able to detect this motion and also measure the
amount of twist the user has applied.

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

2010-11-14 Thread TreKing
On Sun, Nov 14, 2010 at 6:28 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 I define a pirate as somebody who requests a refund within 20 minutes of
 purchase.


Just curious - is this really a fair definition of a pirate?
Do you have stats or other evidence to indicate these people have pirated
your app?

I wouldn't be surprised if there is a small number of people that allot some
time to download, play with and evaluate an app. 20 minutes sounds like
plenty of time for someone to navigate and test run most apps to determine
if it's something that does what they need / is worth keeping.

I guess it depends on how complex your app is and whether you have a free
version (if not I'm not surprised you have a large number of people trying
it for a short periods of time and quickly refunding).

-
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] addProximityAlert lifecycle

2010-11-14 Thread Hendrik Greving
Hi I understand the documentation about activity and service lifecycle. 
Generally speaking, what's the approach if you want to have an application 
which gets unlimited proximity alerts, basically a service that doesn't die? 
I've tried startService with requestLocationUpdate etc. but after a while the 
service seems to get killed by the OS. That's basically question 1) :-) 

Now to problem 2) I've tried to do addProximityAlert but it doesn't really seem 
to work. I am basically doing something like

Intent updateIntent = new Intent(this, LocManIntentReceiver.class);
updateIntent.addCategory(Intent.CATEGORY_INFO);
updateIntent.setAction(Intent.ACTION_LOCALE_CHANGED);
// Put the information into the Intent


updateIntent.putExtra[..]
// Create a pending broadcast intent for the proximity alertPendingIntent 
pendingIntent = PendingIntent.getBroadcast(this, -1, updateIntent, 
PendingIntent.FLAG_UPDATE_CURRENT);
// Add a new proximity alert, update the old one
locationManager.addProximityAlert((double)latitude/1E6, (double)longitude/1E6, 
(float)1, 100, pendingIntent);

But if I set a breakpoint or do a Toast.makeText in the onReceive function of 
the BroadcastReceiver, I never get anything.

Now to problem 3) :-) I've tried to set up a mock location provider by starting 
a Timer which periodically spits out a new location, and I set up a 
LocationListener. The timer does something like this

LocationManager locationManager = 
(LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE);
locationManager.setTestProviderLocation(LocManager.MOCK_LOCMAN_PROVIDER, 
fakedLocation);

I am passing the context in the constructor of the Timer object when 
instantiating it. The location listener in the main activity never received an 
update but the very first one. Any take on that?

- Thanks!

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

[android-developers] Re: Android Market Licensing Problem

2010-11-14 Thread John Gaby
Well, as I said, with my uploaded, but unpublished app, if I use a
phone that has ANY valid gmail connected to it, it always returns that
it is Licensed (I have tried this on about 10 or so different phones,
with version 1.6 through 2.2).  I am hoping that once I publish it
that this will change, but I have no way of knowing for sure.  This
whole LVL thing may have been an exercise in futility.

On Nov 14, 4:28 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 I also think there is a problem.

 I released my app with LVL.  I haven't gotten any reports of false
 negatives, but, contrary to my expectation, I still haven't had a
 pirate later repurchase my app.  I define a pirate as somebody who
 requests a refund within 20 minutes of purchase.  That's about 10% of
 my purchases, which, in a week amounts to about 15 people.

 Now, I know the majority people pirating wouldn't pay for it in the
 first place, but certainly some percentage would.  But I had not one
 person do that.  While there is no emperical evidence, the most likely
 explantion I could come up wuth is that LVL returns allowed even if
 not licensed.  I use the extras fields returned by Google, so it's
 also possible that the liicense is still valid after a week, no idea.

 On Nov 15, 6:21 am, bagelboy greg.do...@gmail.com wrote:

  You can't, basically. All you can do is publish and hope their system
  works. My answer to this problem was to not use the response extras
  and to create a system that can deal with an incorrect response here
  and there.

  On Nov 14, 4:00 pm,JohnGabyjg...@gabysoft.com wrote:

   Actually, that thought has occurred to me (I have already read that
   thread), but really, how am I supposed to be able to test my app
   before I publish it if that is the case?

   On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:

Perhaps the responses aren't correct because your app is not
published.

this thread may provide some 
insight:http://groups.google.com/group/android-developers/browse_thread/threa...

On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

 I have added some logging code and found that the raw response from
 theLicenseService (i.e. the call back to verifyLicense in
 LicenseChecker.java) has a responseCode of '0', which means
 'licensed'.  This is simply not correct.  This phone does NOT have a
 valid account which would generate such a response.  Can someone
 please explain why this is happening.  Does thisLicenseService
 simply not work correctly on a large number of phones?  Does using the
 service have any value at all?

 Thanks.

 On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

  I recently did my ownLVLimplementation and I can tell you that
  tracing these issues down is a real pain. First you need to put 
  loads
  of logging into theLVLcode to find out what the actual response is,
  otherwise you have no visibility, then you have to put logging into
  all the code between the response and the allow/dontallow callbacks.

  Basically what I found was the stock code was unworkable in many 
  ways.
  I quickly came to the conclusion that I needed to modify it into
  something that worked for me. There's a few reasons behind why you
  should abandon the stock code:
  - if you use the stock implementation then crackers will find it 
  very
  easy to circumvent
  - as you have found it is very hard to debug. You have to spend so
  much time figuring out how it works you may as well roll your own
  instead.
  - who's to say whether the google responses are what you want? How
  many retries do you want before it sends a dontAllow back? Maybe you
  want to treat the error responses as a retry. Do you want google to
  specify that or yourself? Do you want them to specify the time 
  between
  checks? It's better to take control of this process so you know
  exactly what is going on and you can manage the user experience.

  In the system I came up with in the end all I use is the response 
  and
  none of the extras. What I do with the response is all custom, that
  way I can use the market test responses in development without
  issues.

  -BB

  On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

   I am using pretty much the default Android Market Licensing in my
   application, but find that it is not working correctly on most of 
   the
   devices that I have tested.  I have uploaded my app to the Market 
   but
   not published it.  If install it on the emulator which does not 
   have
   any Google accounts, then I receive a 'dontAllow' from the check,
   which is correct.

   If I install it on a Motorola Droid phone (which I have in my
   possession) that has my Market Google account associated with it, 
   then
   it will return 'allow' or 'don't allow' 

[android-developers] Re: Google Maps API hidden maps and opengl

2010-11-14 Thread Nicholas Albion
There's an opensource port of Android on GitHub which includes a
(slightly dated) implementation of the Google maps API.  It supports
OpenStreetMap and a couple of other map sources.  I managed to adapt
it to support Bing maps.

On Nov 14, 7:14 pm, Adam Hammer adamhamm...@gmail.com wrote:
 I have a class I wrote that uses the maps and works in a activity, but
 still returns the stub error when I attempt to instantiate it in a
 live wallpaper.

 It's supposed to be in a MapActivity, but I figured since Google uses
 maps in a live wallpaper I could use it as well, although I know this
 is not always the case.

 I've learnt the hard way that just because Google does something with
 android doesn't mean they expose those methods to the developers.

 Adam


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

2010-11-14 Thread Peter Webb
Thankyou for your reply. Thankyou also for answering the last question
I posted to this forum, and thankyou for writing the best book I have
on on Android programming.

I have an app in the Market which is going very well indeed, but I am
having lots of trouble taking it to the next level.

Lets say I have an Activity on top of the stack. It passes an intent
to another of my apps but doesn't finalise, and the new app is now on
top of the stack. It sends an intent back to the original application.
This must cause some method to be be run in the original application.
I was expecting an explicit handler to be invoked; this is how the
system notifies apps that UI events have occurred, which seems the
same sort of thing. An onIntentReceived method, like an
onButtonClick method. I note that there is an onNewIntent method,
but it has limitted applicability, and doesn't seem that commonly
used.

If the original app was not finalised, OnCreate will not be run again,
so I can't depend on that. I note there is an onResume method, I
assume this is always run when an existing app is moved to the top of
the stack. So I could put getIntent() statements in both OnCreate and
OnResume methods. This seems wrong, and isn't how the demos generally
work.

An intent is passed to a Class, and not to a method. What method is
actually run when a new intent is received? Where can I reliably put
my getIntent() logic to work out what my app really has to do? In
onResume and OnCreate, or in onRestart or in onNewIntent? Or in some
other manner? I want to centralise my intent handling logic, but don't
know the simplest/most reliable method to put it in. Can you make any
suggestions?

Do these questions at least make sense to 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: Ajax cross domain requests

2010-11-14 Thread metal mikey
Use it for dDOS? That'a s little far-fetched...moonwhile, its CSRF
abuse that becomes the real problem here.

On Nov 14, 10:41 am, ff fabio.fo...@gmail.com wrote:
 On Nov 8, 8:32 pm, Frank Weiss fewe...@gmail.com wrote:

  Not sure if you're just complainig about the error handling. I suppose you
  know that JSONP does cross-domain and is supported by jQuery.ajax.

 Yep, the error handling is wrong and dangerous since the browser
 actually sends the request while it shouldn't (it becomes possible to
 use it for distributed dos attacks).

 And while jsonp is just an hack, CORS is the standard solutions
 implemented by all modern browsers...

 Bye,
 ff

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

2010-11-14 Thread metal mikey
Just put a thick, black, round-cornered border around the image of
your App...will look like pretty much any Tablet/Pad then.
Or take a photo of a Galaxy Tab (from a demo model instore, perhaps).
I think you'll find that Android hardware manufacturers don't have an
'artwork license agreement' preinstated because they aren't as
tightarse as Apple.

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

2010-11-14 Thread jotobjects
We are still seeing this - several clicks are ignored and then
suddenly they all fire so we wind up doing several startActivity()
calls in a row in the onclick() method.

What is the cause of this and how to fix it?  Anybody?

On Nov 12, 8:29 am, jotobjects jotobje...@gmail.com wrote:
 The app I am working on is having this strange behavior - It works
 correctly for a while, but after some series of actions (that I'm not
 sure how to replicate) it does this -

 - seems to stop responding to clicks on some ImageViews that have
 OnClickListener() set.  These methods call
 context.startActivity(intent)

 - later after clicking on some other button (or going to Home screen)
 all the startActivity intents fire off (this can be seen in the log).
 Then the last of the Activities comes to the front and the Activity
 stack has all the Activities which you can go back to with the Back
 key.

 Does anybody recognize this scenario?  Any ideas what might 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


[android-developers] How to make phone call from home screen widget?

2010-11-14 Thread Rohith Nandakumar
Hello everyone,
I have a widget, and I want it to make a phone call to a preset number
when the user clicks on it. How do I do this? I havn't yet understood
how widgets work, so it would be really helpful if you could provide a
sample code. 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: Spinner/drum roller control like native Clock app has for choosing hours/minutes

2010-11-14 Thread Hatch
Thank you Mark, Brad.

I will look into the http://code.google.com/p/android-wheel/
The javascript solution looks too tedious :)


Cheers,

Hatch

On Nov 13, 1:25 am, Brad Gies rbg...@gmail.com wrote:
 I needed the same thing awhile ago and couldn't find a good
 implementation of it anywhere.

 What I came up with was I embedded a WebView control in my AlertDialog,
 and used Javascript to control the spinner. What I did was create a web
 page with the information I wanted to scroll in the background and
 moved it up and down with the Javascript. It works well.. and looks
 good, but it was a pain to program. Hope you find an easier way.

 There was a fairly long thread on it on (I think) osdir.com.. and I took
 the basic idea from there.

 Sincerely,

 Brad Gies
 ---
 Bistro Bot - Bistro Blurbhttp://bgies.com           
 http://nocrappyapps.comhttp://bistroblurb.com     
 http://forcethetruth.comhttp://ihottonight.com
 ---
 Everything in moderation, including abstinence (paraphrased)

 Every person is born with a brain... Those who use it well are the successful 
 happy ones - Brad Gies

 Adversity can make or break you... It's your choice... Choose wisely - Brad 
 Gies

 Never doubt that a small group of thoughtful, committed people can
 change the world. Indeed. It is the only thing that ever has - Margaret Mead

 On 12/11/2010 3:17 AM,Hatchwrote:







  Hi all.

  I cannot find a corresponding control anywhere.
  The control I am interested in is iPhone's spinner.

  It's much simpler to use than Android's TimePicker.

  Since I see that native Clock app has it, does anyone know how is that
  control called and how can one use it in his app ?

  Thanks,

 Hatch

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: TCP problem - hangs when reading server's response

2010-11-14 Thread bobetko
The server app was written for iPhone witch maybe handle some things
differently. As a message terminator server app author used OK
sequence (I will ask him why), so I definitely couldn't use
readLine(). It turned out there was more then one problem. In line 4,
I had to replace all  characters with amp; but that alone was not
the solution. It seems that PrintWriter adds something to
OutputStream, probably \n character or something similar. Server
didn't like that and my actions were ignored. I tried PrintStream
instead of PrintWriter and that worked perfectly. So, now I am good.
Thanks all.

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


[android-developers] Best tool to visualize an Android Project ?

2010-11-14 Thread Saurabh
Hello All;
Can anyone suggest me a good tool to quickly understand a reasonably
big Android project: the class hierarchies, relations and methods via
some visual means? Is some kind of plugin available that we can point
it to the android project and it would create a package diagram?
I know a bit about yDoc  ObjectAid

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

2010-11-14 Thread Ashok Jeevan
Hi,
I have a screen which lists some views on the top part of the activity. I
also have a listview which is at the bottom of those views.

The issue which I am facing is that I am not getting the screen to scroll as
a whole. Instead, the listview at the bottom, which displays contents
dynamically, gets scrolled.

I initially used ScrollView as the parent view, but later removed it since I
found out that there were some issues when using listview inside scrollview.

Can anybody help me out with the full screen scroll issue? I don't want the
list view to be scrolled. I need the full screen to be scrolled.

I am attaching the layout xml file below.

?xml version=1.0 encoding=utf-8?


LinearLayout android:id=@+id/LinearLayout01
android:layout_width=wrap_content android:layout_height=wrap_content
xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=vertical
RelativeLayout android:id=@+id/RelativeLayout01
android:layout_width=fill_parent android:layout_height=fill_parent
android:orientation=horizontal


ImageView android:id=@+id/ImageView01
android:layout_width=85dip android:src=@drawable/q
android:layout_height=wrap_content android:paddingLeft=5px
/ImageView
 !-- categoryLabel textview --
 TextView android:layout_height=wrap_content
android:layout_width=wrap_content android:layout_below=@+id/ImageView01
android:id=@+id/categorytextview android:paddingLeft=5px/TextView
 !-- tagLabel textview --
 !-- CategoryPopulate textview --
TextView android:layout_toRightOf=@+id/categorytextview
android:layout_height=wrap_content android:layout_width=wrap_content
android:layout_below=@+id/ImageView01 android:id=@+id/TextView04
android:paddingLeft=5px/TextView
 TextView android:id=@+id/dateField android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_below=@+id/channelBtn
android:layout_toRightOf=@+id/ImageView01
android:paddingLeft=5px/TextView

RatingBar android:layout_toRightOf=@+id/ImageView01
android:id=@+id/Rating01 android:layout_width=wrap_content
android:paddingLeft=5px style=?android:attr/ratingBarStyleSmall
android:visibility=visible android:clickable=false
android:drawingCacheQuality=low android:paddingTop=5px
android:layout_height=15dip android:numStars=5 android:stepSize=1
/RatingBar


TextView android:layout_width=wrap_content
android:layout_below=@+id/Rating01 android:layout_height=wrap_content
android:id=@+id/infoViewCount android:paddingLeft=5px
android:layout_toRightOf=@+id/ImageView01/TextView
Button android:layout_toRightOf=@+id/ImageView01
android:layout_width=wrap_content android:id=@+id/channelBtn
android:layout_below=@+id/infoViewCount android:layout_height=20px
android:paddingTop=5px android:paddingLeft=5px android:text=Channel
android:height=5px
android:gravity=top|fill_horizontal|center|clip_vertical
android:lines=1/Button
 TextView android:layout_toRightOf=@+id/Rating01
android:layout_width=wrap_content
android:layout_height=wrap_content android:id=@+id/RatingCount
android:layout_marginLeft=25px
/TextView

/RelativeLayout
View android:id=@+id/View01
android:layout_width=fill_parent android:layout_height=1px
android:background=# android:paddingTop=15px
android:layout_marginTop=5px
android:layout_above=@+id/LinearLayout03 /


!--  favorite image --
Button android:id=@+id/btnfavoriteimage
android:layout_width=wrap_content android:layout_height=wrap_content
android:adjustViewBounds=true
android:paddingLeft=5px android:paddingTop=5px
android:clickable=true android:background=@drawable/untitled2
/Button
!--  share image --
Button android:id=@+id/btnshareimage
android:layout_width=wrap_content android:layout_height=wrap_content
android:adjustViewBounds=true
android:paddingLeft=5px android:paddingTop=5px
android:clickable=true android:background=@drawable/untitled3
/Button
!--  flag image --
Button android:id=@+id/btnflagimage
android:layout_width=wrap_content android:layout_height=wrap_content
android:adjustViewBounds=true
android:paddingTop=5px android:paddingRight=5px
android:clickable=true android:background=@drawable/untitled4
/Button
/LinearLayout

!-- checking out the button with background --
!-- LinearLayout android:id=@+id/LinearLayout03
android:layout_width=fill_parent android:layout_height=fill_parent
android:orientation=horizontal android:paddingTop=5px
Button android:id=@+id/ButtonWithImage01
android:layout_width=wrap_content android:layout_height=wrap_content
android:src=@drawable/untitled android:adjustViewBounds=true
android:paddingLeft=5px android:paddingTop=5px
android:clickable=true android:background=@drawable/untitled
/Button
/LinearLayout --
!--  --
View android:id=@+id/View02 android:layout_width=fill_parent
android:layout_height=1px android:background=#
android:paddingTop=15px android:layout_marginTop=5px /

LinearLayout android:id=@+id/LinearLayout03
android:layout_height=fill_parent android:background=@drawable/untitled5
android:layout_width=fill_parent android:gravity=center_vertical
android:paddingTop=5px

[android-developers] Re: OpenGL glScissor not working on HTC phones

2010-11-14 Thread Nightwolf
Try to render static part of the screen twice so both back and front
buffers have the same content.
However I think it's better to render static scene, store it as
texture and draw simple quad at the beginning of each frame.

On Nov 14, 7:42 pm, Jeff Boody jeffbo...@gmail.com wrote:
 I do not do a gl.glClear(GL10.GL_COLOR_BUFFER_BIT); so the bits that were 
 drawn previously should remain.

 Actually this isn't the default behavior.

 I think you need to request EGL_BUFFER_PRESERVED for the
 EGL_SWAP_BEHAVIOR.

 Unfortunately this currently (froyo) isn't possible because Android
 only supports EGL 1.0 + some extensions.

 The eglSurfaceAttrib() API entry point was added at a later version of
 EGL.

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

2010-11-14 Thread David Toledo
Hi All

Exist some way from read the  barcode using the android sdk ?

Thanks
David

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

2010-11-14 Thread Zsolt Vasvari
There is a free version of my app available and it's also complicated
to the point that it couldn't be throughly evaluated in 20 mins.  I
picked 20 mins because, while it's somewhat arbitrary, I only have a
handful returns more than 20 mins and less than a few hours after
purchase.  My app should take at least a few hours to thoroughly
evaluate.  Therefore, it's fairly safe to say that the 20 min crowd
are likely pirates.


On Nov 15, 12:01 pm, TreKing treking...@gmail.com wrote:
 On Sun, Nov 14, 2010 at 6:28 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
  I define a pirate as somebody who requests a refund within 20 minutes of
  purchase.

 Just curious - is this really a fair definition of a pirate?
 Do you have stats or other evidence to indicate these people have pirated
 your app?

 I wouldn't be surprised if there is a small number of people that allot some
 time to download, play with and evaluate an app. 20 minutes sounds like
 plenty of time for someone to navigate and test run most apps to determine
 if it's something that does what they need / is worth keeping.

 I guess it depends on how complex your app is and whether you have a free
 version (if not I'm not surprised you have a large number of people trying
 it for a short periods of time and quickly refunding).

 ---­--
 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] Re: Android Market Licensing Problem

2010-11-14 Thread Zsolt Vasvari
Well, for me, if I test the app on my dev phone where my primary
account (or even the secondary account) are NOT purchasers, I do get
NOT_LICENSED when setting the market response to Normal.  So at least
that's working, but my app is published, while yours isn't.

Of course, I am using a non-standard client implementation of LVL
where practically nothing from the original code is recognizable.


On Nov 15, 12:08 pm, John Gaby jg...@gabysoft.com wrote:
 Well, as I said, with my uploaded, but unpublished app, if I use a
 phone that has ANY valid gmail connected to it, it always returns that
 it is Licensed (I have tried this on about 10 or so different phones,
 with version 1.6 through 2.2).  I am hoping that once I publish it
 that this will change, but I have no way of knowing for sure.  This
 whole LVL thing may have been an exercise in futility.

 On Nov 14, 4:28 pm, Zsolt Vasvari zvasv...@gmail.com wrote:



  I also think there is a problem.

  I released my app with LVL.  I haven't gotten any reports of false
  negatives, but, contrary to my expectation, I still haven't had a
  pirate later repurchase my app.  I define a pirate as somebody who
  requests a refund within 20 minutes of purchase.  That's about 10% of
  my purchases, which, in a week amounts to about 15 people.

  Now, I know the majority people pirating wouldn't pay for it in the
  first place, but certainly some percentage would.  But I had not one
  person do that.  While there is no emperical evidence, the most likely
  explantion I could come up wuth is that LVL returns allowed even if
  not licensed.  I use the extras fields returned by Google, so it's
  also possible that the liicense is still valid after a week, no idea.

  On Nov 15, 6:21 am, bagelboy greg.do...@gmail.com wrote:

   You can't, basically. All you can do is publish and hope their system
   works. My answer to this problem was to not use the response extras
   and to create a system that can deal with an incorrect response here
   and there.

   On Nov 14, 4:00 pm,JohnGabyjg...@gabysoft.com wrote:

Actually, that thought has occurred to me (I have already read that
thread), but really, how am I supposed to be able to test my app
before I publish it if that is the case?

On Nov 14, 3:29 am, bagelboy greg.do...@gmail.com wrote:

 Perhaps the responses aren't correct because your app is not
 published.

 this thread may provide some 
 insight:http://groups.google.com/group/android-developers/browse_thread/threa...

 On Nov 14, 3:31 am,JohnGabyjg...@gabysoft.com wrote:

  I have added some logging code and found that the raw response from
  theLicenseService (i.e. the call back to verifyLicense in
  LicenseChecker.java) has a responseCode of '0', which means
  'licensed'.  This is simply not correct.  This phone does NOT have a
  valid account which would generate such a response.  Can someone
  please explain why this is happening.  Does thisLicenseService
  simply not work correctly on a large number of phones?  Does using 
  the
  service have any value at all?

  Thanks.

  On Nov 13, 3:31 am, bagelboy greg.do...@gmail.com wrote:

   I recently did my ownLVLimplementation and I can tell you that
   tracing these issues down is a real pain. First you need to put 
   loads
   of logging into theLVLcode to find out what the actual response 
   is,
   otherwise you have no visibility, then you have to put logging 
   into
   all the code between the response and the allow/dontallow 
   callbacks.

   Basically what I found was the stock code was unworkable in many 
   ways.
   I quickly came to the conclusion that I needed to modify it into
   something that worked for me. There's a few reasons behind why you
   should abandon the stock code:
   - if you use the stock implementation then crackers will find it 
   very
   easy to circumvent
   - as you have found it is very hard to debug. You have to spend so
   much time figuring out how it works you may as well roll your own
   instead.
   - who's to say whether the google responses are what you want? How
   many retries do you want before it sends a dontAllow back? Maybe 
   you
   want to treat the error responses as a retry. Do you want google 
   to
   specify that or yourself? Do you want them to specify the time 
   between
   checks? It's better to take control of this process so you know
   exactly what is going on and you can manage the user experience.

   In the system I came up with in the end all I use is the response 
   and
   none of the extras. What I do with the response is all custom, 
   that
   way I can use the market test responses in development without
   issues.

   -BB

   On Nov 13, 4:40 am,JohnGabyjg...@gabysoft.com wrote:

I am using pretty much the default 

[android-developers] Re: alignment issue in top left and top right

2010-11-14 Thread Alok Upadhyay

hi thank for the reply!!i done it and using relativelay.
i am facing a new problem ie, i want to fill whole screen with the
background image.code i am trying is:

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FILL_PARENT,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);

xml code is:
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
android:background=@drawable/homepage_image
android:gravity=center

ImageButton
  android:id=@+id/btnSequence
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:src=@drawable/btn_sequence
  android:gravity=center_vertical
  /
ImageButton
  android:id=@+id/btnVideo
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:src=@drawable/btn_video
  android:gravity=center_vertical
  /
ImageButton
  android:id=@+id/btnInfo
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:src=@drawable/btn_info
  android:gravity=center_vertical
  /
/LinearLayout
On Nov 2, 4:02 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Alok,

 FrameLayout is not what you want to use in this case.

 http://developer.android.com/reference/android/widget/FrameLayout.html

  FrameLayout is designed to block out an area on the screen to display
  a single item. You can add multiple children to a FrameLayout, but all
  children are pegged to the top left of the screen. Children are drawn
  in a stack, with the most recently added child on top.

 I suggest you use RelativeLayout, it's really powerful, although takes
 some time to get used to.

 http://developer.android.com/reference/android/widget/RelativeLayout

 For back button, specify android:layout_alignParentLeft=true, for
 next, android:layout_alignParentRight=true.

 -- Kostya

 02.11.2010 13:06, Alok Upadhyay пишет:



  i am trying to align my two image buttons (back and next) at the top
  of an image background and trying like below xml code.But both the
  images are overlapping on top left corner.

  FrameLayout xmlns:android=http://schemas.android.com/apk/res/
  android
       android:orientation=vertical
       android:layout_width=fill_parent
       android:layout_height=fill_parent
     android:gravity=center_horizontal
     android:background=@drawable/image_wo_lbl_0

      ImageView
      android:id=@+id/back
      android:src=@drawable/btn_back
      android:layout_width=wrap_content
      android:layout_height=wrap_content
      android:layout_alignParentLeft=true
      /
      ImageView
      android:id=@+id/next
      android:src=@drawable/btn_next
      android:layout_width=wrap_content
      android:layout_height=wrap_content
      android:layout_alignParentRight=true
      /

  /FrameLayout

  Thanks!!

 --
 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] Home button LongPress issue.

2010-11-14 Thread Muhammad
Hi
I need Immediate help!!


When i launch app after splash screen Activity  A is launched .In
activity A there is a button on clicking that button Another Activity
B is being launched which is being updated by a service . And if i
click back button of device, home screen of device is displayed,
Background service keeps updating the Activity B even when  Device's
home screen is displayed. On Long pressing Home button Recent
applications are being displayed when i chose my app activity B is
being displayed ( which is normal behavior). But what happens
sometimes instead of Activity B Activity A is being displayed Also in
this case Background service does not update The Activity B. And when
i Click Back Button on Activity A then Activity B is being
displayed .

Both Activities have launch mode single task And have no intent Filter
defined.

Thanks

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


Re: [android-developers] Read Barcode

2010-11-14 Thread Frank Weiss
Zxing open source. Perhaps the barcode scanner app also public intent.
On Nov 14, 2010 10:56 PM, David Toledo dtole...@gmail.com wrote:
 Hi All

 Exist some way from read the barcode using the android sdk ?

 Thanks
 David

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: Camera saving corrupted photos

2010-11-14 Thread blindfold
Sounds like a G2/Android bug then, because still image results should
always be totally unrelated to any (screen) layout settings. Only
camera preview results can be linked to layout.

On Nov 15, 1:26 am, Stephen Lebed srle...@gmail.com wrote:
 It is a supported size on the g2.  I'm not specifying the size, its
 the default res for the camera.

 It looks like part of the problem is with

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

 I use this in the onCreate method.  Again, I use this all the time,
 but when I comment out this line, I can save uncorrupted images. I'm
 still hunting for an answer.  It is related to my layout xml.

 On Nov 14, 12:53 pm, blindfold seeingwithso...@gmail.com wrote:

  2.592 x 1.952 looks like an unusual (unsupported) image size to me.
  Maybe try 2.592 x 1.944?

  Regards

  On Nov 14, 7:58 pm, Stephen Lebed srle...@gmail.com wrote:

   I can't figure out why I'm getting corrupted images when I save them
   in my app.  In fact the thumbnail seems to be fine, but the actual
   image is corrupted, as if the stride value is not being set
   correctly.  The following is the code I'm using the save the image,
   which is taken from other version of camera apps almost directly.  In
   other apps it seems to be saving images without problem.  This is
   called from a Camera.PictureCallback.onPictureTaken(byte[] data,
   Camera camera)

   File filename = new File(Test_SnapShotK.jpg);
   File exportDir = new File(Environment.getExternalStorageDirectory(),
   TestDir);

   if (!exportDir.exists()) {
           exportDir.mkdirs();
           Log.i(TAG, making directory  + exportDir.toString());

   }

   File file = new File(exportDir, filename.getName());

   try {
           FileOutputStream fileOutputStream = new FileOutputStream(file);
           fileOutputStream.write(data);
           fileOutputStream.flush();
           fileOutputStream.close();

   } catch (IOException e) {

           Log.e(TAG, e.getMessage(), e);

   }

   Since I can't attach the image I'm getting directly in this post, here
   is a link to it.

  http://www.mechnology.com/Test_SnapShotK.jpg

   Has anyone else gotten this problem and have been able to resolve it.
   I'm testing this on a G2 phone.  Any help is greatly appreciated.

   Stephen



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

2010-11-14 Thread Honest
hello,

i want to transfer doc or any text file to my SD CARD and then i wan
to access it. so i put the folloiwng command line argument in
eclipse.

-sdcard C:\sdcard.iso
then i used the following command from command prompt to push
certificate file to sdcard.

adb push licenseFile /sdcard

but when i went to DDMS perspective into eclipse and then when i went
to file manager and i tried to transfer files but it gave me following
error in console.

Failed to push the item(s).
[2010-11-15 16:52:02] (null)


hope to see your reply soon.

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