[android-developers] Has anyone written a 2D scene graph yet?

2010-01-01 Thread scastria
I am struggling with drawing on my custom View. I can make it all work
but just not very efficiently. I am using invalidate causing the
entire screen to be redrawn. I only need to redraw a small portion of
the screen. I tried calling invalidate with a rectangle but that left
everything else black. I don't know what is causing everything else to
go black if I only invalidated a small rectangle.

I see many posts on these similar issues and think that everybody
would have a much better experience if there was a 2D scene graph API
for android. Then I can just worry about my scene primitive attributes
and let the scene graph engine handle all the drawing in the most
efficient way possible.

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


[android-developers] Android and VOIP

2010-01-01 Thread soft buzz
Hi,
do u have idea on Android/VOIP working? share here

thanks
buzz

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

Re: [android-developers] Android and VOIP

2010-01-01 Thread datoudatou
hi, guys:

i have done some test. it really worked in a very first step...
android can support playing and recording the speach at the same time
(the attachment is my test code, head phone is necessary or it will 
become noisy soon).

i believe the next step is to use amr_nb/gsm/g.729 (jni modules is 
prefered) to compress the pcm16 data
into smaller RTP packages, then, send them through wifi or 3g network...

but i think the diffculties are not focused on these things,
how to keep the android handsets always on-line with lower power consume 
is the major or we can't
let the answer peer response immediately.

i have an idea which to use the common tel-line to activate the 
answer-call peer
(just ring 1-2 times then hung up), then the app will catch this event,
start the activity and connect to the remote voip server, but how can i 
control the tel-line signal and
identify which call is from voip app or from the regular missed call ...

if keeping the caller and answer peer on-line at the same time is the 
pre-condition,
(no matter sip or some other heartbeat like mechanism)
the current fact is the phone will use up the battery very soon...

any ideas ?

great thanks.


于 2010年01月01日 16:55, soft buzz 写道:
 Hi,
 do u have idea on Android/VOIP working? share here
 thanks
 buzz
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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

AudioTest.tar.gz
Description: application/gzip


Re: [android-developers] Android and VOIP

2010-01-01 Thread soft buzz
Hi datoudatou,

Thanks for your response...i have very less information on VOIP and dats why
i am trying to get some good notes from our experts here. Guys please give
your inputsafter getting appropriate information i want to provide a one
stop information and solution to those who are looking for such informatino.


However, currently i m among them :)

thanks,
buzz

2010/1/1 datoudatou datouda...@gmail.com,



 hi, guys:

 i have done some test. it really worked in a very first step...
 android can support playing and recording the speach at the same time
 (the attachment is my test code, head phone is necessary or it will
 become noisy soon).

 i believe the next step is to use amr_nb/gsm/g.729 (jni modules is
 prefered) to compress the pcm16 data
 into smaller RTP packages, then, send them through wifi or 3g network...

 but i think the diffculties are not focused on these things,
 how to keep the android handsets always on-line with lower power consume
 is the major or we can't
 let the answer peer response immediately.

 i have an idea which to use the common tel-line to activate the
 answer-call peer
 (just ring 1-2 times then hung up), then the app will catch this event,
 start the activity and connect to the remote voip server, but how can i
 control the tel-line signal and
 identify which call is from voip app or from the regular missed call ...

 if keeping the caller and answer peer on-line at the same time is the
 pre-condition,
 (no matter sip or some other heartbeat like mechanism)
 the current fact is the phone will use up the battery very soon...

 any ideas ?

 great thanks.


 于 2010年01月01日 16:55, soft buzz 写道:
   Hi,
  do u have idea on Android/VOIP working? share here
  thanks
  buzz
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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.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] Re: When the new activity starts, the data of previous activity is gone.

2010-01-01 Thread Rui Wu
Hi Pranav,
I didn't catch the point for your second problem. Do you want to pass the
value of edittext in first activity to second activity, then show the
strings in the edittext of second activiy. If so, you can try in the similar
way as the first problem.
BRs,
Rui


2010/1/1 android09 pranav.jaja...@gmail.com

 Hi Rui Wu,

 Thanks a lot. It works very good and perfectly as i want. Now, i know
 that where was my problem. Actually, i had not added this line/lines :
mData.strFirstName = edFirstName.getEditableText().toString();.
 That's why i was not getting any result.

 Now, i got it. I have also one query. I have two activities. First
 activity consist on edittext and button whereas second activity
 consist only edittext. When i write in edittext of first activity and
 press a button of first activity than the edittext of second activity
 should get the same string. Actually, i want to get the email id from
 the first activity and also it should be automatically get in the
 edittext of second activity.

 If you have any idea about it, please tell me. Again thanks for help
 me out from this problem.

 Regards,
 --
 Pranav

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




-- 
BRs,
Rui

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

2010-01-01 Thread Kaj Bjurman
I just found this thread that also confirms that it's a Sprint Hero
bug:

http://groups.google.com/group/android-developers/browse_thread/thread/554f72f397a8539f/722034a5aca418c6?lnk=gstq=AppWidget#722034a5aca418c6



On 31 Dec 2009, 23:37, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 Hi,

 I have a strange problem, on a few devices. I have developed anAppWidget, and 
 it uses a database to store the configuration for each
 instance of the widget. The widget id is the key in the database.

 Everything works on most devices, but I got a bug report a couple of
 days ago. A user said that the widget never worked after reboot. The
 user who was very helpful sent me a log from his phone, and I could
 then see that the widget got a new id each time he did a reboot.

 The log says this about his device (A Sprint Hero in US):

 Device model: HERO200
 Firmware version: 1.5
 Kernel version: 2.6.27-533ce29d
 htc-ker...@and18-2 )
 #742 PREEMPT Fri Aug 28 21:59:31 CST 2009
 Build number: 1.56.651.2

 He can reproduce the problem on his friends device as well, but I have
 never seen the problem with HTC Hero/Magic here in Europe.

 Something about the code. onUpdate in my widget class gets invoked
 after reboot. The integer array with widget id:s does e.g say that
 only one widget exists, and that it has id 5.

 I then try to execute:

 AppWidgetProviderInfo info = appWidgetManager.getAppWidgetInfo
 (widgetId);

 and get null back, so I query for all ids:

 int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName
 (PACKAGE_NAME, className));

 and get back an array that says that a widget with id 6 exists. (The
 new id is always 1 larger than before reboot)

 What to do? Is this a known bug?

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


[android-developers] Re: What is the Sprint Hero AppWidget problem?

2010-01-01 Thread Kaj Bjurman
Did you find a workaround?



On 4 Nov 2009, 06:20, btm...@gmail.com btm...@gmail.com wrote:
 Hello all,

 I wrote a widget that has been working fine for most folks. However, I
 started getting bug reports about how the widget would be blank on
 reboot (not receive an update?), and it seemed that the Sprint Hero
 continually came up. I thought I was crazy but I'm finding that other
 people are having the same problems:

 Searching Google for sprint heroappwidgetproblems yields:

 Added warning about the problem on the Sprint Hero device: On the
 Sprint Hero (HTC ROM v1.29.xxx) theAppWidgetAPI is broken in such a
 way that it won't ...

 More specific blog post that mentions it but doesn't explain the
 problem:

 http://koxx3.wordpress.com/2009/10/22/htc-hero-sprint-bug/

 I found the reason : HTC changed the Android widget management at
 startup !
 I hope they will fix it in a new ROM release, but I’d like to find a
 solution to bypass this problem.
 EDIT 28/10/2009 : problem solve for ‘Pure calendar’ with new option.

 I e-mailed the author in hopes of getting an answer, but I haven't
 received any response. Does anybody with a Sprint Hero know what the
 problem is?

 Thank you,
 -Brian

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


[android-developers] Custom Layout

2010-01-01 Thread Business Talk
What's the deal with the custom layouts? I implemented a custom layout
class and began defining xml layout using my new class. Than I
realized that I can't just add the child views that way one can add
views to the predefined layouts. I had to do it manually modifing the
xml.

Than I found out that the onMeasure/onLayout methods were getting
wrong getMeasuredHeight/getMeasuredWidth results. Why??? (I realy
feel like cursing here but what's to point.)

On the other hand, If I do all of it programatically, instantiate  the
layout object in the activity and add the child view to it, all works
fine.  Any Ideas?

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


[android-developers] Re: Android and VOIP

2010-01-01 Thread JP
SIP is commonly used to control a call.
Keep in mind that Google's supposed to come out with VoIP for Google
Voice on Android. Then everybody will want Google Voice, noone will
want your solution, no matter how well implemented, and that was that
then.
JP

On Jan 1, 1:52 am, datoudatou datouda...@gmail.com wrote:
 hi, guys:

 i have done some test. it really worked in a very first step...
 android can support playing and recording the speach at the same time
 (the attachment is my test code, head phone is necessary or it will
 become noisy soon).

 i believe the next step is to use amr_nb/gsm/g.729 (jni modules is
 prefered) to compress the pcm16 data
 into smaller RTP packages, then, send them through wifi or 3g network...

 but i think the diffculties are not focused on these things,
 how to keep the android handsets always on-line with lower power consume
 is the major or we can't
 let the answer peer response immediately.

 i have an idea which to use the common tel-line to activate the
 answer-call peer
 (just ring 1-2 times then hung up), then the app will catch this event,
 start the activity and connect to the remote voip server, but how can i
 control the tel-line signal and
 identify which call is from voip app or from the regular missed call ...

 if keeping the caller and answer peer on-line at the same time is the
 pre-condition,
 (no matter sip or some other heartbeat like mechanism)
 the current fact is the phone will use up the battery very soon...

 any ideas ?

 great thanks.

 于 2010年01月01日 16:55, soft buzz 写道:

  Hi,
  do u have idea on Android/VOIP working? share here
  thanks
  buzz
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



  AudioTest.tar.gz
 8KViewDownload

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


[android-developers] Lat Long Problem in Broadcast Receiver

2010-01-01 Thread Nishant
Hello All,

I have developed application which runs when SMS is received.
At that time I have started thread and passed the object of the
Context in thread.

In thread, I am accessing Lat-long by implementing LocationListner and
also set :

LocationManager locationManager = (LocationManager)
context.getSystemService(Context.LOCATION_SERVICE);

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
1000L, 500.0f, this);

And it's onLocationChanged(), i have fetched lat-long.
But onLocationChanged() is not able to call this function.

Can anyone has any suggestion what i have made mistake?

Regards,
Nishant Shah

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: blocking UI thread when Yes/No AlertDialog is displayed

2010-01-01 Thread Alok Kulkarni
@Swapnil, when you say that you cant call Alert Dialog from non ui thread ,
you can do that using a Handler as i said.Did u try that out ? It works in
my case where i do an an AsyncTask (seperate thread)in which i communicate
with the server and based on response i decide which screen to show. For
this i call the sendEmptyMessage which is handled by the Handler which is
written on the UI thread.
Thanks,
Alok.

On Thu, Dec 31, 2009 at 1:45 PM, Miguel Morales therevolti...@gmail.comwrote:

 Sorry, just re-read your original text, it seems that message passing
 between threads is the way to go.
 Just use two way message passing.

 On Thu, Dec 31, 2009 at 12:09 AM, Miguel Morales
 therevolti...@gmail.com wrote:
  Why not use Thread.wait() and Thread.notify() to communicate with the
  working thread.
  Or perhaps message passing to tell the worker thread to wait until
  further notice.
 
  here's how I would do it, though I'm not sure about wait() and
  notify() since I never use them myself.  But I *think* it would go
  something like this:
 
  /*worker thread class*/
  class MyThread extends Thread
  {
 Handler mHandler;
 public static final int DONE_MSG = 123;
 MyThread(Handler pHandler)
 {
 mHandler = pHandler;
 }
 @Override run()
 {
 //do something.
Bundle bundle = new Bundle();
bundle.putInt(TYPE, DONE_MSG);
Message msg = new Message();
msg.setData(bundle);
mHandler.sendMessage(msg);
  }
 
  /*activity class*/
  private Handler message_handler = new Handler()
  {
 Bundle bundle = msg.getData();
 int type = bundle.getInt(TYPE);
 if ( type == MyThread.DONE_MSG )
 {
 //dismiss the dialog...
 tThread.notify();
 }
  }
 
  tThread = new MyThread(message_handler);
  tThread.start();
 
  //then from your onClick handler
  //show the dialog
  tThread.wait();
 
  On Wed, Dec 30, 2009 at 11:49 PM, swapnil kamble swap.kam...@gmail.com
 wrote:
  Let me reframe my question. My intention is not to block UI thread but
 to
  block a thread when AlertDialog is shown till the user provides
 confirmation
  response.
 
  I have handshake process, where I have to provide an option to user
 whether
  to accept/reject and based on that user response I want to return a
 boolean
  value. And unless this response is not provided next line should not get
  executed, just exactly what Windows MessageBox does.
 
  Now there are two option to start this handshake process, one either
 from UI
  thread i.e. starting from some onclick event listener. But I can't use
 this
  way, because I want to block thread until response is not provided(modal
  dialog). Blocking this thread means blocking whole app. So this way i
 can't
  do this.
 
  Second option is to spawn a new worker thread and then run handshaking
 from
  it, we don't mind blocking non-ui thread. But again problem here is that
 I
  can't show AlertDialog from non UI thread.
 
  I know there is an option to post message and display AlertDialog from
 that
  Handler, but then in that case my thread continues and completes its
  execution even if user response is not provided which I don't want.
 
  On Wed, Dec 30, 2009 at 1:16 PM, Romain Guy romain...@android.com
 wrote:
 
  If you block the UI thread, the dialog won't work. The user won't be
  able to click it, and it might not even draw at all. So a very bad
  idea :)
 
  On Tue, Dec 29, 2009 at 10:33 PM, Frank Weiss fewe...@gmail.com
 wrote:
   Just like Treking, I'm puzzled by Swapnil's desire to block the UI
   thread.
   Perhaps if he explained what he does not want the UI thread doing
 while
   the
   dialog is displayed, would shed light on the issue for all.
  
   On Dec 29, 2009 9:59 PM, TreKing treking...@gmail.com wrote:
  
   I can put my code in listeners but still I dont want that thread to
   continue its execution
  
   Which thread? The UI thread? I'm pretty sure you DO want the UI
 thread
   to
   continue it's execution. Why would you NOT?
   What are you trying to accomplish? I can't think of why you would
 want
   this
   behavior...
  
  
  
 -
   ...
  
   On Wed, Dec 30, 2009 at 12:27 AM, swapnil kamble 
 swap.kam...@gmail.com
   wrote:   Thanks for your ...
  
   --
  
   You received this message because you are subscribed to the Google
   Groups
   Android Developers group...
  
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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
 
 
 
  --
  Romain Guy
  Android framework engineer
  

[android-developers] Query on releasing to sony app store

2010-01-01 Thread karthikr

Hi Guys,

I am planning to submit my application in sony app market.

Is there anything that I can do to make sure that my application is
not backed up and pirated from the phone?

Or is there an alternate way to make sure that my app runs only on
sony devices?

Regaards,
R.Karthik

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


[android-developers] How can I rotate an Image in different angles?

2010-01-01 Thread Martin
HI!

I have a png-picture in
ImageView rotatedimage = new ImageView ()

Is there a better way to rotate it in changing directions than the
following way? There I have to create a new picture for every new
rotating angle and add it to the layout:

Bitmap bitmap = BitmapFactory.decodeResource(getResources
(),R.drawable.frosch);
Matrix rotationMatrix = new Matrix();
rotationMatrix.setRotate(grad);

Bitmap rotatedbitmap = Bitmap.createBitmap(frogbitmap, 0, 0,
rotatedbitmap.getWidth(), rotatedbitmap.getHeight(), rotationMatrix,
true);

BitmapDrawable bmd = new BitmapDrawable(rotatedbitmap);

rotatedimage.setImageDrawable(bmd);

mtrx.postRotate(10);
rotatedimage.setImageMatrix(mtrx);


Greetings, Martin

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

2010-01-01 Thread Martin
Thank you, I will try it :-)
Martin


On 31 Dez. 2009, 16:16, skink psk...@gmail.com wrote:
 On Dec 31, 3:13 pm, Martin google-gro...@digle.de wrote:





  Hi!

  How can I minimize the stuttering of my graphics?
  I am using MANY ImageView's in my program (and JUST ImageView's). I
  change their positions directly, when I need to change them without
  using onDraw to redraw everything. Is it ok, If I do not overwrite
  onDraw?

  I have in average 10 objects which I added to the mainscreen-layout.
  These 10 objects are 5 trees and 5 flowers.
  The trees and flowers have 5 different states and therefore 5
  different ImageViews which I all added to the layout, whose just are
  invisible.
  So I have about 50 ImageViews added to my main screen
  When one of these objects changes its state, I just make its ImageView
  invisible and the ImageView of the new state visible.

  Is it ok to do it like that?
  I realized that if I just use one ImageView for every object and
  change the ressource of it when its state changes, all objects, which
  are currently added to the mainscreen-layout, change their position to
  (0;0). That was the reason, I have so many ImageView's added to the
  mainscreen-layout.
  Is there a better solution for that?

  Greetings,
  Martin

 hi,

 i'd use 10 ordinary Views, each one with own LevelListDrawable

 pskink

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


[android-developers] Package of R.java

2010-01-01 Thread Marek Urbaniak
Is it possible to instruct Eclipse and Ant to have a R.java file
generated in the package com.example whilst the package declared in an
AndroidManifest.xml file is com.example.d?

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


[android-developers] Downloader activity

2010-01-01 Thread Steve
Hi there,

I have integrated the downloader activity (Google provided) into my
application.. On the whole a very straight forward process. A problem
I have though, is, after the downloader has completed the window
disappears and nothing happens. If I hold down the HOME key I see my
app and if I click on it my appss window comes up and runs correctly.
Also when I run it subsequently it works correctly. Has anyone else
experienced this? It certainly looks like the downloader should
trigger my app when it is done; I am not sure if the window is just
not getting focus or someething. It is a fullscreen GL app.

Any ideas?

Steve

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

2010-01-01 Thread jotobjects
Thanks very much.  This best practice outline is worthy of an
official Android blog.

Otherwise developers are going to come up with their own
misunderstandings (like assuming the com.android.camera component will
always be there - not a terribly unreasonable assumption although it
violated the rule against depending on classes outside android.jar).

Two followup questions about intent resolution - It is unclear to me
why the browser was chosen (we don't know what URI was actually
supplied). The API doc for android.content.Intent says where no
explicit type is included in the Intent, instead the scheme of the
intent data ... is considered.  In this case the type WAS included.
So is it correct to say the scheme would NOT be considered in the
resolution?  Second question: If there is more than on matching intent
filter doesn't the platform put up a chooser automatically (seems like
I saw that somewhere)?

Happy New Year.


On Dec 31 2009, 6:45 pm, Mark Murphy mmur...@commonsware.com wrote:
 jotobjects wrote:
  On Dec 30, 8:39 am, Mark Murphy mmur...@commonsware.com wrote:
  Mark Murphy wrote:
  The intent filter you are trying to match is:
  intent-filter
     action android:name=android.intent.action.VIEW /
     category android:name=android.intent.category.DEFAULT /
     data android:mimeType=video/* /
  /intent-filter
  Actually, to clarify: that's an intent filter for the built-in video
  player (out of the Camera app). One hopes that most devices have some
  app that supports a similar filter.

  What is the best way to find out how the intent should be configured?

 Magic 8-Ball.

 (Do I need an extra on this Intent? Signs point to no)

 :-)

  Is going to the source code for the camera app and looking at the
  manifest the best or only way?

 It's one starting point, to be certain.

 In this case, it's using a standard action (ACTION_VIEW) and a
 reasonable-looking MIME type. One would hope that there will be 1+
 applications on the device that support viewing that MIME type. As it
 turns out, there are 2+ in Android proper, as the OP reported that the
 Browser handled the request, probably based on scheme.

 You'll note that ACTION_VIEW of video/mpeg is not documented in the SDK
 anywhere, at least that I can find. This means that it is possible that
 a given device may have 0 apps that can support it, if some future
 Android edition modifies or drops the intent filter, or if some OEM
 messes around too much. That's the reason for my tell the client there
 is no default video player answer from earlier today, because,
 technically, there *isn't* a default video player, at least not one
 that's part of the SDK contract.

  Would you still have to test every
  device to see if it works with the video viewer app on that device.

 That depends a bit on what you want to do and how you want to do it.

 Given an Intent, you can use methods on PackageManager to figure out if
 there is anything that would satisfy that Intent. So, if the feature is
 optional, you could use that to disable a menu choice or button or
 something, so the user couldn't attempt to use something that would fail.

 Similarly, you can use createChooser() to deal with the case of 2+ apps
 thinking they can handle the Intent (e.g., email or GMail or SMS or
 Twidroid for an ACTION_SEND of text/plain).

 If, however, the feature is mandatory (i.e., your app can't run without
 it), you're better served trying to handle it yourself, at least as a
 fallback option. For example, the OP could implement a simple video
 player using VideoView and only resort to using it on devices that fail
 to offer anything that can ACTION_VIEW a video/mpeg.

 Where things get icky is if there is some device or app that does
 support ACTION_VIEW of a video/mpeg URL, but its support is broken
 somehow. This is not significantly different than a desktop OS video
 player not necessarily having the right codecs to play back such-and-so
 video content, and there's no great answer for that case, either.

 Intents and MIME types are not significantly different concepts from
 their equivalents in desktop OSes. We think that Android should know how
 to play video because we see our desktops able to play video from a URL.
 However, at the same time, those of us who don't use Windows much are
 used to the notion that certain things can't readily be viewed (e.g.,
 link to a Microsoft Access database), MIME type or not. Just as savvy
 developers try to make their desktop or Web applications deal with
 varying end user support for different MIME types, so should Android
 developers.

 Now, it would be really cool if Google stepped up and declared a more
 extensive list of Intent actions and Uri/MIME types that all Android
 devices should support. That would go a long way towards clearing up the
 sorts of issues the OP encountered. Right now, there's only a half-dozen
 in the list, and none are based on MIME type:

 

[android-developers] Re: Package of R.java

2010-01-01 Thread jotobjects
I don't know (probably not?)  but what is your objective for wanting
that capability?

On Jan 1, 11:01 am, Marek Urbaniak marek.urban...@gmail.com wrote:
 Is it possible to instruct Eclipse and Ant to have a R.java file
 generated in the package com.example whilst the package declared in an
 AndroidManifest.xml file is com.example.d?

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

2010-01-01 Thread Walt Armour
I hadn't thought too much about that but had briefly considered it.
I'm trying to use these images directly as resources so putting them
in assets would require a fair bit more code to get everything loaded
up into drawables for use as icons as such (at least, best I can tell
it would take more code).

At the moment I'm leaning heavily toward the 'copy over to my res/
directory' option because that gives the benefit of everything working
cleanly in Eclipse as well.

I guess I'll toss this into the pile of feature requests for a future
release: ability to have resources in other directories elsewhere in
the developer's file system.

On Dec 31 2009, 10:52 pm, joebowbeer joe.bowb...@gmail.com wrote:
 Have you considered packaging the images as assets using aapt's -A
 modifier?

 -A  additional directory in which to find raw asset files

 On Dec 30, 11:32 pm, Walt Armour waltarm...@gmail.com wrote:

  We will potentially be sharing images between an android app and other
  apps (gotta keep those costs down).  I am attempting to find a way to
  have the android app use image files that are outside of its project
  directory tree (i.e. not in res/drawable).

  At the moment I'm thinking some custom work with aapt (via ant build)
  is my best shot.

  I will first attempt multiple -S parameters (or multiple values for -
  S) but I'm not expecting that to work.

  I will then see about two aapt runs.  The first would generate the apk
  from the non-project directory.  The second would generate from the
  project directory as normal and include (using -I) the first apk.

  Has anyone attempted something like this before?  Does anyone see any
  immediate problems with any of these approaches?  I'm thinking there
  may be some hiccup in the identifier numbering but hopefully that can
  be handled.

  Worst case scenario I'll just add an ant target to manually copy the
  external resources over before doing the build.  I am really loathe to
  do that though.  Accessing the images directly when needed is much
  safer.



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

2010-01-01 Thread jotobjects
Where was the announcement or rumor on VOIP for google voice on
android?

Also, there are VOIP products using sipdroid that supposedly do this
now.

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

2010-01-01 Thread MarcoAndroid
Hi,

My guess is that you have to call tracker.start() for each Activity,
as it says this in the example: Then call its start() method, passing
the web property ID *and activity being tracked*.
But that's just a guess... So I've posted those questions in the maybe
more appropriate discussiongroup 
http://groups.google.com/group/google-analytics-api
Post: 
http://groups.google.com/group/google-analytics-data-export-api/browse_thread/thread/b3794b6455a1d399

tracker.stop() you have to call when your application is closing. So
onDestroy() in your last Activity or onTerminate() in your Application
i guess again. But that would mean each onCreate() tracker.start()
does not need to have a matching onDestroy() tracker.close() call?

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

2010-01-01 Thread jotobjects


On Dec 30 2009, 11:32 pm, Walt Armour waltarm...@gmail.com wrote:
 may be some hiccup in the identifier numbering but hopefully that can
 be handled.
The resource ID's (R.*) potentially change on every build and are
inlined because the Java compiler is not expecting static finals to
change. Essentially you have to clean all class files on every build
(and there is no clean task in the Android ant scripts)


 Worst case scenario I'll just add an ant target to manually copy the
 external resources over before doing the build.  I am really loathe to
 do that though.  Accessing the images directly when needed is much
 safer.
ant copy task is pretty smart about not doing unnecessary copies.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: blocking UI thread when Yes/No AlertDialog is displayed

2010-01-01 Thread Dianne Hackborn
On Thu, Dec 31, 2009 at 2:39 AM, swapnil kamble swap.kam...@gmail.comwrote:

 Have you used MessageBox.show() API in Windows ? If yes then you can
 understand it easily what I am saying.


This is API is not really blocking the thread -- it is running a nested
event loop, until the user responds to the dialog.  This kind of behavior is
very deliberately not implemented in Android because it results in poor
application interaction behavior and edge cases, which is especially
problematic in an environment like a cell phone when an application must
be interruptible at any time.

For example, if your application is sitting there blocking its main thread
like this, and the user receives an incoming call or handles a notification,
what do you think should happen?  If we try to pause the activity while in
this state to move on to the next thing, we will end up calling
Activity.onPause() and all kinds of other questionable stuff while nested
down inside of your app.  Or if you have a broadcast receiver for, say, the
device going to sleep, this code would end up being called from deep in your
blocking method call.  In all of these cases, it is unlikely for the
application to really expect this to happen.

These kinds of nested event loops are just bad news.  PalmOS was the king
example of the horror they cause, but even Windows suffers from it -- all
those apps that get in weird unresponsive states while waiting on a dialog?
 MessageBox is often to blame.

My strong suggestion: re-arrange your code to not do this kind of thing.
 You have some method that needs to get input from the user to return a
response?  Make that method async as well, to return its result in a
callback, because if it needs to wait for the user then that is truly what
it is.

-- 
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: Package of R.java

2010-01-01 Thread Marek Urbaniak
To share code for a normal and a demo version of an application.

On Jan 1, 8:27 pm, jotobjects jotobje...@gmail.com wrote:
 I don't know (probably not?)  but what is your objective for wanting
 that capability?

 On Jan 1, 11:01 am, Marek Urbaniak marek.urban...@gmail.com wrote:

  Is it possible to instruct Eclipse and Ant to have a R.java file
  generated in the package com.example whilst the package declared in an
  AndroidManifest.xml file is com.example.d?



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

2010-01-01 Thread SizzlingSkizzorsProgrammer
Yes, I've tried logging and the HTTP execute definitely takes the
largest chunk of time, but how can I speed it up?  Is there another
protocol/method?

On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
 On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
 wrote:



  It works fine, but it's quite slow...any way to make it faster?

 A guess would be that the HTTP network speed is 100's of times slower
 than all the rest of the code. You might log the time before and after
 the execute method if you haven't already done that.

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

2010-01-01 Thread Frank Weiss
Considering that the execute method's latency includes network and server
times, on what basis do you think it's taking too long? What latency are you
observing, less than one second, more than one minute?

On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com
 wrote:

 Yes, I've tried logging and the HTTP execute definitely takes the
 largest chunk of time, but how can I speed it up?  Is there another
 protocol/method?

 On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
  On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
  wrote:
 
 
 
   It works fine, but it's quite slow...any way to make it faster?
 
  A guess would be that the HTTP network speed is 100's of times slower
  than all the rest of the code. You might log the time before and after
  the execute method if you haven't already done that.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] Re: Package of R.java

2010-01-01 Thread Frank Weiss
You've posed an important software engineering question. I think you might
find some answers by googling for: android project dependency

Here's another thread that goes into it:
http://groups.google.com/group/android-developers/browse_thread/thread/5a3570fe3b87b62e

On Fri, Jan 1, 2010 at 1:14 PM, Marek Urbaniak marek.urban...@gmail.comwrote:

 To share code for a normal and a demo version of an application.

 On Jan 1, 8:27 pm, jotobjects jotobje...@gmail.com wrote:
  I don't know (probably not?)  but what is your objective for wanting
  that capability?
 
  On Jan 1, 11:01 am, Marek Urbaniak marek.urban...@gmail.com wrote:
 
   Is it possible to instruct Eclipse and Ant to have a R.java file
   generated in the package com.example whilst the package declared in an
   AndroidManifest.xml file is com.example.d?
  
 

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: Lat Long Problem in Broadcast Receiver

2010-01-01 Thread Kumar Bibek
Do you have the correct permissions ?? I little bit og Logcat output
will help us a lot... :)

Thanks and Regards,
Kumar Bibek


On Jan 1, 9:13 pm, Nishant nish...@saltriver.com wrote:
 Hello All,

 I have developed application which runs when SMS is received.
 At that time I have started thread and passed the object of the
 Context in thread.

 In thread, I am accessing Lat-long by implementing LocationListner and
 also set :

 LocationManager locationManager = (LocationManager)
 context.getSystemService(Context.LOCATION_SERVICE);

 locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
 1000L, 500.0f, this);

 And it's onLocationChanged(), i have fetched lat-long.
 But onLocationChanged() is not able to call this function.

 Can anyone has any suggestion what i have made mistake?

 Regards,
 Nishant Shah

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

2010-01-01 Thread Kumar Bibek
I guess, the default Android's way is the best. Of course, you can add
more libraries, but then that would be redundant. I hope Google has
already taken care of the performance part.

Thanks and Regards,
Kumar Bibek

On Jan 2, 3:15 am, Frank Weiss fewe...@gmail.com wrote:
 Considering that the execute method's latency includes network and server
 times, on what basis do you think it's taking too long? What latency are you
 observing, less than one second, more than one minute?

 On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com

  wrote:
  Yes, I've tried logging and the HTTP execute definitely takes the
  largest chunk of time, but how can I speed it up?  Is there another
  protocol/method?

  On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
   On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
   wrote:

It works fine, but it's quite slow...any way to make it faster?

   A guess would be that the HTTP network speed is 100's of times slower
   than all the rest of the code. You might log the time before and after
   the execute method if you haven't already done that.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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] Posts to this Android Dev group hacked/intercepted/moved !?!

2010-01-01 Thread RoryD
I posted a message to this group several days ago - now when I check
my Google Groups profile the message in question is appearing under a
completely different Google Group (http://groups.google.com/group/
world_wide_with_god_minstry) - this group is filled with other
apparently misdirected messages (including several others intended for
Android Developers group sent by other today  within the last few
days.

I definitely submitted my message to this group first, here's a link
to mail-archive showing that:
http://www.mail-archive.com/android-developers@googlegroups.com/msg73192.html.

But now the actual message appears here

http://groups.google.com/group/world_wide_with_god_minstry/browse_thread/thread/ce4a6500ba51be36/66731f82d4153dda?lnk=gstq=android+database#66731f82d4153dda

I'd say this was just my account being hacked, except can't find any
way in the UI of actually moving a message after posting it.  Is this
an error with Google Groups itself?

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

2010-01-01 Thread SizzlingSkizzorsProgrammer
About 5 seconds, which isn't unbearable, but considering my app needs
frequent requests some kind of optimization must be possible.

Look at the android market...it seems to load everything pretty fast
(much faster than my app at least!)

On Jan 1, 3:15 pm, Frank Weiss fewe...@gmail.com wrote:
 Considering that the execute method's latency includes network and server
 times, on what basis do you think it's taking too long? What latency are you
 observing, less than one second, more than one minute?

 On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com



  wrote:
  Yes, I've tried logging and the HTTP execute definitely takes the
  largest chunk of time, but how can I speed it up?  Is there another
  protocol/method?

  On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
   On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
   wrote:

It works fine, but it's quite slow...any way to make it faster?

   A guess would be that the HTTP network speed is 100's of times slower
   than all the rest of the code. You might log the time before and after
   the execute method if you haven't already done that.

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

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


Re: [android-developers] Re: Best HTTP Request Method

2010-01-01 Thread Frank Weiss
I've seen 5 sec occasionally getting an rss feed of about 28 KB using
java.net.URL.openConnection().getInputStream() and then parsing it with
SAXParser. It looks like you're doing a POST to send form data(?) so you may
have to stick with HTTPClient.

If you're doing frequent requests, you can probably take advantage of
HTTPClient's keep-alive connection management.

If you're looking for optimizations, I strongly suggest you create a test
app which performs the same request you're having performance problems with.
Collect more data, such as the size of the request and response. Try the
same request from a different platform (like your laptop or desktop).
Compare the network paths between the desktop and Android to the server.

I know you'd like to just get an answer do this/try this. I hope that by
looking into the problem in more detail you''ll find a solution.

On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com
 wrote:

 About 5 seconds, which isn't unbearable, but considering my app needs
 frequent requests some kind of optimization must be possible.

 Look at the android market...it seems to load everything pretty fast
 (much faster than my app at least!)

 On Jan 1, 3:15 pm, Frank Weiss fewe...@gmail.com wrote:
  Considering that the execute method's latency includes network and server
  times, on what basis do you think it's taking too long? What latency are
 you
  observing, less than one second, more than one minute?
 
  On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer 
 cbo...@gmail.com
 
 
 
   wrote:
   Yes, I've tried logging and the HTTP execute definitely takes the
   largest chunk of time, but how can I speed it up?  Is there another
   protocol/method?
 
   On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
wrote:
 
 It works fine, but it's quite slow...any way to make it faster?
 
A guess would be that the HTTP network speed is 100's of times slower
than all the rest of the code. You might log the time before and
 after
the execute method if you haven't already done that.
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] onContextMenuClosed() not called under 2.x?

2010-01-01 Thread Jonas Petersson
Dear Experts,

In one of my applications I programmatically open the context menu
when something is clicked in my MapActivity overlay. This works
perfectly under 1.x as well as on my 2.0 Milestone.  I've used
showContextMenuForChild() historically, but openContextMenu() does
that same thing.

As expected onCreateContextMenu() is called to build the menu and then
onContextItemSelected() is called when something is selected. So far
all is well.

The odd thing is that under 1.x the onContextMenuClosed() method is
called when I press the back key, but not so under 2.0. This confuses
states for my app since I need to know whether menu is shown or not - or 
maybe there is a way to know this that I have not (yet) figured out...

Is this a deliberate change or should I file it as a bug? Googling
comes up pretty dry (stuff that is over a year old).

Anyone with a 2.0.1 Droid that would care to test whether this has
already been fixed? (The ETA for Milestone 2.0.1 seems hazy still, but
it appears that at least one of my reported bugs has been fixed in 2.0.1 
event though it isn't flagged as such.)

 Many thanks in advance / Jonas

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


[android-developers] how do you draw a new line?!

2010-01-01 Thread schwiz
This is really frustrating, I am trying to get a carriage return drawn
in my custom view and nothing is working.  I have tried
'System.getProperty(line.separator)' but that makes it say null and
I have tried '\r' and '\n' and those just both draw a little square.
I am using the canvas.drawText meathod.  Thanks for your reply!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Touch handling sleep not helping enough on 1.5/1.6

2010-01-01 Thread Robert Green
I just tried the thread priority hacks but they didn't seem to offer
any kind of big improvement.  Any other ideas?

On Dec 31 2009, 12:27 am, Robert Green rbgrn@gmail.com wrote:
 Cool, I'll give it a shot.  I was thinking about bumping up my
 rendering thread.  I'll report the results I get.

 On Dec 30, 10:49 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

  I can suggest something weird - to boost priority for the time of
  rendering.
  See how I did that in 
  ToF:http://code.google.com/p/tapsoffire/source/browse/trunk/src/org/tof/u...
  (onBeforeRender/onAfterRender)

  Dmitry

  On 31 дек, 05:39, Robert Green rbgrn@gmail.com wrote:

   I hate to bump it just to bump it but I'm really in need of some good
   suggestions here.

   Thanks to anyone who can offer anything new to try.

   On Dec 29, 3:13 pm, Robert Green rbgrn@gmail.com wrote:

Hey guys,

I'm really in a bind here.  I've got this new game engine that's
almost done but the input system is killing me.  I have a virtual
analog stick on the screen and it works great, especially on Android
2.0 (Droid) but on any 1.5/1.6 device, the touching is causing my game
to crawl.

I know all of the standard stuff - I pipe my input events into a queue
for my main game thread and thensleepfor 16ms which should ensure
that no more than 60 motion events are dispatched per second.  That
works fine but even so, just touching the screen, even with my event
handling code commented out (except for thesleep, of course), drops
my game from 30FPS to 20FPS.  It's really bad.  I bound some keyboard
keys to the movement to replace thetouchcontrols for testing and the
game maintained a great framerate.  That won't work because most
phones now only have touchscreens so I really need to figure this one
out.

Wait for Android 2.0 is not a great answer, either.

So far I've tried;

Activity.onTouchEvent with a 16, 20, 32, 50mssleepbefore returning
Activity.dispatchTouchEvent with a 16,20,32 and 50mssleep
Commented out all code except thesleepto test - problem is still
there, so it's not my hander.

What else can I do?

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


[android-developers] How can I get the highest framerate with this quellcode?

2010-01-01 Thread Martin
Hi!

I am programming a game with the following quellcode.
I am just using ImageView's which I move around and I have to handle
some touch events.
What do I have to change to have the highest framerate?

If I remove this block
try
{
Thread.sleep(45);
}
catch(InterruptedException ex) {}
the graphics don't get painted and I see nothing.
If I do NOT remove this block, the graphics get painted but I do not
have the hightest framerate and the graphic is stuttering.

How can I solve this problem?
Greetings, Martin


---
Here is the quellcode:





//package 

//imports...

public class LeonardFrog extends Activity implements FrogLanded
{


//declaration of variables...

private OnTouchListener jumpListener = new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {

// do something...

return true;
}
};


@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

setContentView(R.layout.main);
updatePhysicsDraw();

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


private synchronized void updatePhysics()
{

// This function calculates all new positions of ImageView's

}




public void onDraw ()
{
// This function moves many ImageView's around
}


private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
Global.calculating=true;
updatePhysics();
onDraw();
Global.calculating=false;

}
};

class AnimationLoop implements Runnable
{
public void run()
{
while(true)
{
while(running)
{
try
{
Thread.sleep(45);
}
catch(InterruptedException ex) {}

if (!Global.calculating)
handler.sendEmptyMessage(0);
}
}
}
}

}

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


[android-developers] Re: Posts to this Android Dev group hacked/intercepted/moved !?!

2010-01-01 Thread Martin
Hey, you are true!
I also see my posts there:

http://groups.google.com/group/world_wide_with_god_minstry/browse_thread/thread/c359df2ca1264536/d44bb834318705e3#d44bb834318705e3

http://groups.google.com/group/world_wide_with_god_minstry/browse_thread/thread/1f8500086eb7bb16/135908ed6a9576ab#135908ed6a9576ab

http://groups.google.com/group/world_wide_with_god_minstry/browse_thread/thread/e665b3643afa5285/507ac1af9d85cf65#507ac1af9d85cf65

And if I look at my profile, I see that my messages are also in this
group.

What happens there?

Martin



On 2 Jan., 00:18, RoryD rory1doug...@gmail.com wrote:
 I posted a message to this group several days ago - now when I check
 my Google Groups profile the message in question is appearing under a
 completely different Google Group (http://groups.google.com/group/
 world_wide_with_god_minstry) - this group is filled with other
 apparently misdirected messages (including several others intended for
 Android Developers group sent by other today  within the last few
 days.

 I definitely submitted my message to this group first, here's a link
 to mail-archive showing 
 that:http://www.mail-archive.com/android-developers@googlegroups.com/msg73

 But now the actual message appears here

 http://groups.google.com/group/world_wide_with_god_minstry/browse_thr...

 I'd say this was just my account being hacked, except can't find any
 way in the UI of actually moving a message after posting it.  Is this
 an error with Google Groups itself?

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

2010-01-01 Thread theSmith
You might also want to run a method trace around your network activity
to see where the most processing time is spent.  The results you get
wont be in actual time, but a relative time just because method
tracing is slow.

Just wrap you code with a start and stop calls, and make sure to have
the writing to external storage permission in your manifest.

// start tracing to /sdcard/calc.trace
Debug.startMethodTracing(calc);
// ...
// stop tracing
Debug.stopMethodTracing();


Traceview
http://developer.android.com/guide/developing/tools/traceview.html


-theSmith
On Jan 1, 7:08 pm, Frank Weiss fewe...@gmail.com wrote:
 I've seen 5 sec occasionally getting an rss feed of about 28 KB using
 java.net.URL.openConnection().getInputStream() and then parsing it with
 SAXParser. It looks like you're doing a POST to send form data(?) so you may
 have to stick with HTTPClient.

 If you're doing frequent requests, you can probably take advantage of
 HTTPClient's keep-alive connection management.

 If you're looking for optimizations, I strongly suggest you create a test
 app which performs the same request you're having performance problems with.
 Collect more data, such as the size of the request and response. Try the
 same request from a different platform (like your laptop or desktop).
 Compare the network paths between the desktop and Android to the server.

 I know you'd like to just get an answer do this/try this. I hope that by
 looking into the problem in more detail you''ll find a solution.

 On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com

  wrote:
  About 5 seconds, which isn't unbearable, but considering my app needs
  frequent requests some kind of optimization must be possible.

  Look at the android market...it seems to load everything pretty fast
  (much faster than my app at least!)

  On Jan 1, 3:15 pm, Frank Weiss fewe...@gmail.com wrote:
   Considering that the execute method's latency includes network and server
   times, on what basis do you think it's taking too long? What latency are
  you
   observing, less than one second, more than one minute?

   On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer 
  cbo...@gmail.com

wrote:
Yes, I've tried logging and the HTTP execute definitely takes the
largest chunk of time, but how can I speed it up?  Is there another
protocol/method?

On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
 On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
 wrote:

  It works fine, but it's quite slow...any way to make it faster?

 A guess would be that the HTTP network speed is 100's of times slower
 than all the rest of the code. You might log the time before and
  after
 the execute method if you haven't already done that.

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

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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] Updating a unique AppWidgetProvider from a Service

2010-01-01 Thread theSmith
Here is my issue, I want to be able to update a specific
AppWidgetProvider (home screen widget) from a custom service class.  I
have to build the remote view in the service because I'm also doing
some networking in there, which takes some time.

The problem is that I can't figure out how to update a specific widget
(individual widgets can have different update intervals, using the
alarm manager).

If I wanted to do it from the onUpdate of the AppWidgetProvider I
could just call appWidgetManager.updateAppWidget(appWidgetId,
remoteView);

Does anyone have any experience with this or any suggestions?

-theSmith

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Touch handling sleep not helping enough on 1.5/1.6

2010-01-01 Thread SoftwareForMe.com SoftwareForMe.com
Hi,

Just off the top of my head...

* Research event propagation order and catch the event as early as possible
(view before activity?)
* Be sure to return true to stop propagation from your handler
* Look into other methods to catch the event stream besides the onTouchEvent
override

My experimentation on 1.5/1.6 (many months ago) showed with a short pause
(20 ms, if I recall correctly) brought frame rates to about 95% of what they
were with no touch events. Thus, what your experiencing might be influenced
by something else in your architecture, or perhaps one of the first bullets
above.

SoftwareForMe.com

On Fri, Jan 1, 2010 at 5:10 PM, Robert Green rbgrn@gmail.com wrote:

 I just tried the thread priority hacks but they didn't seem to offer
 any kind of big improvement.  Any other ideas?

 On Dec 31 2009, 12:27 am, Robert Green rbgrn@gmail.com wrote:
  Cool, I'll give it a shot.  I was thinking about bumping up my
  rendering thread.  I'll report the results I get.
 
  On Dec 30, 10:49 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:
 
   I can suggest something weird - to boost priority for the time of
   rendering.
   See how I did that in ToF:
 http://code.google.com/p/tapsoffire/source/browse/trunk/src/org/tof/u...
   (onBeforeRender/onAfterRender)
 
   Dmitry
 
   On 31 дек, 05:39, Robert Green rbgrn@gmail.com wrote:
 
I hate to bump it just to bump it but I'm really in need of some good
suggestions here.
 
Thanks to anyone who can offer anything new to try.
 
On Dec 29, 3:13 pm, Robert Green rbgrn@gmail.com wrote:
 
 Hey guys,
 
 I'm really in a bind here.  I've got this new game engine that's
 almost done but the input system is killing me.  I have a virtual
 analog stick on the screen and it works great, especially on
 Android
 2.0 (Droid) but on any 1.5/1.6 device, the touching is causing my
 game
 to crawl.
 
 I know all of the standard stuff - I pipe my input events into a
 queue
 for my main game thread and thensleepfor 16ms which should ensure
 that no more than 60 motion events are dispatched per second.  That
 works fine but even so, just touching the screen, even with my
 event
 handling code commented out (except for thesleep, of course), drops
 my game from 30FPS to 20FPS.  It's really bad.  I bound some
 keyboard
 keys to the movement to replace thetouchcontrols for testing and
 the
 game maintained a great framerate.  That won't work because most
 phones now only have touchscreens so I really need to figure this
 one
 out.
 
 Wait for Android 2.0 is not a great answer, either.
 
 So far I've tried;
 
 Activity.onTouchEvent with a 16, 20, 32, 50mssleepbefore returning
 Activity.dispatchTouchEvent with a 16,20,32 and 50mssleep
 Commented out all code except thesleepto test - problem is still
 there, so it's not my hander.
 
 What else can I do?

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

2010-01-01 Thread Sasikumar.S
Thank U 

On Thu, Dec 31, 2009 at 7:56 PM, Wouter wouterg...@gmail.com wrote:

 use this as your background for your button

 android:background=@android:color/transparent

 On Dec 31, 7:55 am, Fei Zhang getid...@gmail.com wrote:
  use a transparent image as background
 
  2009/12/31 Sasikumar.S sasikumar.it1...@gmail.com
 
   Hi,
 
   How to make a button as transparent in android?...
 
   --
   Thanks  Regards
   Sasikumar.S
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Thanks  Regards
Sasikumar.S

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Any Tips for implementing free versions of applications?

2010-01-01 Thread schwiz
upload a paid version too, and in the free version keep track of how
many times they play or how long they play with preferences and then
don't allow them to start a new game and also give them a button to
take them directly to the market with your paid version.

On Dec 31 2009, 10:49 am, dan.x.sheph...@googlemail.com
dan.x.sheph...@googlemail.com wrote:
 Hi, I already mentioned this briefly in another post as part of
 another publishing topic.

 But I think it is pretty important for a lot of us to know good ways
 to make free versions that can't be cracked too easily etc.  After all
 most people just download the free stuff, I know I do, so its
 important for numbers.

 I just made a game called ScrollSlider and I want to make a free
 version with limited evaluation period perhaps, but I could use some
 advice on how to do it.  I'm also having problems with data
 persistence as views appear and disappear and managing game loop view
 thread accordingly.

 Cheers in advance for any tips,

 Dan

 www.cuffedtothekeyboard.com

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


[android-developers] Re: When the new activity starts, the data of previous activity is gone.

2010-01-01 Thread android09
Hi Rui Wu,

I got the solution of the second problem. Actually, i have used the
same string value for the both fields. It means i have used the same
string value for the edittext in the first activity as well as in
second activity which has also one edittext. When i press next button
it takes the string, entered by the user and it shows in the edittext
of the second activity.

By the way, thank you for communicating with me.

Regards,

Pranav

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

2010-01-01 Thread Nishant
Thanks for the reply.

Yes, I have set this 2 permissions:

uses-permission
android:name=android.permission.ACCESS_COARSE_LOCATION/uses-
permission
uses-permission
android:name=android.permission.ACCESS_FINE_LOCATION/uses-
permission

I am testing this application on device (HTC Tatto) having 1.6 SDK.

I am not able to get LogCat because of testing on device.

Thanks  Regards,
Nishant Shah

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

2010-01-01 Thread SizzlingSkizzorsProgrammer
Thanks a lot!  Just wondering:  how do you set the keep-alive
setting?  I just can't seem to get it!

Thanks for all your help!

On Jan 1, 5:08 pm, Frank Weiss fewe...@gmail.com wrote:
 I've seen 5 sec occasionally getting an rss feed of about 28 KB using
 java.net.URL.openConnection().getInputStream() and then parsing it with
 SAXParser. It looks like you're doing a POST to send form data(?) so you may
 have to stick with HTTPClient.

 If you're doing frequent requests, you can probably take advantage of
 HTTPClient's keep-alive connection management.

 If you're looking for optimizations, I strongly suggest you create a test
 app which performs the same request you're having performance problems with.
 Collect more data, such as the size of the request and response. Try the
 same request from a different platform (like your laptop or desktop).
 Compare the network paths between the desktop and Android to the server.

 I know you'd like to just get an answer do this/try this. I hope that by
 looking into the problem in more detail you''ll find a solution.

 On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com



  wrote:
  About 5 seconds, which isn't unbearable, but considering my app needs
  frequent requests some kind of optimization must be possible.

  Look at the android market...it seems to load everything pretty fast
  (much faster than my app at least!)

  On Jan 1, 3:15 pm, Frank Weiss fewe...@gmail.com wrote:
   Considering that the execute method's latency includes network and server
   times, on what basis do you think it's taking too long? What latency are
  you
   observing, less than one second, more than one minute?

   On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer 
  cbo...@gmail.com

wrote:
Yes, I've tried logging and the HTTP execute definitely takes the
largest chunk of time, but how can I speed it up?  Is there another
protocol/method?

On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
 On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
 wrote:

  It works fine, but it's quite slow...any way to make it faster?

 A guess would be that the HTTP network speed is 100's of times slower
 than all the rest of the code. You might log the time before and
  after
 the execute method if you haven't already done that.

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en

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

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


[android-developers] Re: Touch handling sleep not helping enough on 1.5/1.6

2010-01-01 Thread Robert Green
Were your results of 95% achieved while you were really pushing the
GPU?  I've found that if I do absolutely nothing but sleep for 16ms
and return true, I STILL get massive slowdown.  It has nothing to do
with my architecture.  I'm pushing the GPU down to about 30FPS with a
6ms update and so it seems that the more CPU/GPU time my game needs,
the worse this problem is.  No problems on the Droid, of course.  Only
on 1.5 and 1.6 devices.

I've tried implementing the sleep in both onTouch and dispatch and
they seem to have the same result.

Any other ideas?

On Jan 1, 10:13 pm, SoftwareForMe.com SoftwareForMe.com
softwareforme@gmail.com wrote:
 Hi,

 Just off the top of my head...

 * Research event propagation order and catch the event as early as possible
 (view before activity?)
 * Be sure to return true to stop propagation from your handler
 * Look into other methods to catch the event stream besides the onTouchEvent
 override

 My experimentation on 1.5/1.6 (many months ago) showed with a short pause
 (20 ms, if I recall correctly) brought frame rates to about 95% of what they
 were with no touch events. Thus, what your experiencing might be influenced
 by something else in your architecture, or perhaps one of the first bullets
 above.

 SoftwareForMe.com

 On Fri, Jan 1, 2010 at 5:10 PM, Robert Green rbgrn@gmail.com wrote:
  I just tried the thread priority hacks but they didn't seem to offer
  any kind of big improvement.  Any other ideas?

  On Dec 31 2009, 12:27 am, Robert Green rbgrn@gmail.com wrote:
   Cool, I'll give it a shot.  I was thinking about bumping up my
   rendering thread.  I'll report the results I get.

   On Dec 30, 10:49 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

I can suggest something weird - to boost priority for the time of
rendering.
See how I did that in ToF:
 http://code.google.com/p/tapsoffire/source/browse/trunk/src/org/tof/u...
(onBeforeRender/onAfterRender)

Dmitry

On 31 дек, 05:39, Robert Green rbgrn@gmail.com wrote:

 I hate to bump it just to bump it but I'm really in need of some good
 suggestions here.

 Thanks to anyone who can offer anything new to try.

 On Dec 29, 3:13 pm, Robert Green rbgrn@gmail.com wrote:

  Hey guys,

  I'm really in a bind here.  I've got this new game engine that's
  almost done but the input system is killing me.  I have a virtual
  analog stick on the screen and it works great, especially on
  Android
  2.0 (Droid) but on any 1.5/1.6 device, the touching is causing my
  game
  to crawl.

  I know all of the standard stuff - I pipe my input events into a
  queue
  for my main game thread and thensleepfor 16ms which should ensure
  that no more than 60 motion events are dispatched per second.  That
  works fine but even so, just touching the screen, even with my
  event
  handling code commented out (except for thesleep, of course), drops
  my game from 30FPS to 20FPS.  It's really bad.  I bound some
  keyboard
  keys to the movement to replace thetouchcontrols for testing and
  the
  game maintained a great framerate.  That won't work because most
  phones now only have touchscreens so I really need to figure this
  one
  out.

  Wait for Android 2.0 is not a great answer, either.

  So far I've tried;

  Activity.onTouchEvent with a 16, 20, 32, 50mssleepbefore returning
  Activity.dispatchTouchEvent with a 16,20,32 and 50mssleep
  Commented out all code except thesleepto test - problem is still
  there, so it's not my hander.

  What else can I do?

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

2010-01-01 Thread Raja Nagendra Kumar
Hi,

We are trying to create avd though ant using the android bat..

When we execute

 [echo] Creating avd profile: foo1.5
 [exec] Current OS is Windows XP
 [exec] Executing 'cmd' with arguments:
 [exec] '/c'
 [exec] 'android'
 [exec] 'create'
 [exec] 'avd'
 [exec] '-n'
 [exec] 'foo1.5'
 [exec] '-t'
 [exec] '1'
 [exec] '-f'
 [exec] '-p'
 [exec] '${dataDir}'
 [exec] ''
 [exec] 'c:/temp/raja.txt'


it goes into reccursion and all the tools folder files are getting
delegated.. The issue is ${dataDir} which is not assgined a value has
some internal effect  This is observed on DK 1.6 and 2.0 Update too..




createAVD:
 [echo] 1
 [echo] API3
 [echo] API3
 [echo] ${${dp.trgt.ref}}
 [exec] Android 1.5 is a basic Android platform.
 [exec] Do you wish to create a custom hardware profile [no]
Exception in thr
ead main java.lang.StackOverflowError
 [exec] at java.io.Win32FileSystem.resolve
(Win32FileSystem.java:237)
 [exec] at java.io.File.init(File.java:207)
 [exec] at java.io.File.listFiles(File.java:1056)
 [exec] at
com.android.sdklib.internal.avd.AvdManager.recursiveDelete(Av
dManager.java:952)
...

 [exec] at
com.android.sdklib.internal.avd.AvdManager.recursiveDelete(Av
dManager.java:954)
 [exec] at
com.android.sdklib.internal.avd.AvdManager.recursiveDelete(Av
dManager.java:954)
 [exec] at
com.android.sdklib.internal.avd.AvdManager.recursiveDelete(Av
dManager.java:954)
 [exec] at
com.android.sdklib.internal.avd.AvdManager.recursiveDelete(Av
dManager.java:954)
 [exec] The batch file cannot be found.
 [exec] Result: 1

BUILD SUCCESSFUL
Total time: 36 seconds
F:\tejasoft\work\companies\zoomin\mobile\androidant createAVD

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


[android-developers] Facing serious problem with static objects

2010-01-01 Thread Alok Kulkarni
Hi guys, I am facing a problem in my application.
I have a few static arrays and Hashmaps in my app which i fill in when my
Activity starts.Then this  activity later launches another Activity. Now
user presses Home button of Back button and again restarts the app, even
then the static objects remain in memory. I beleive this is default android
behaviour.
I have an example app.
package com.cm.test;

import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class MyActivity extends Activity {
public static HashMapString, String hMap = new HashMapString,
String();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.i(***,Hash map size = +hMap.size());

hMap.put(Alok,Alo);
hMap.put(Jitu,Jit);

Log.i(***,Activity onCreate() called);
}
@Override
public void onDestroy()
{
Log.i(***,Activity onDestroy() called);
super.onDestroy();

}


@Override
public void onResume()
{
super.onResume();
Log.i(***,Activity onResume() called);
}
@Override
public void onStop()
{

super.onStop();

Log.i(***,Activity onStop() called);
}

}
Output First time is Size = 0. for 1st launch, Next for every launch ,
HashMap size is 2... If i use ArrayList , the size of ArrayList goes on
increasing.
I dont want this to happen.One thing was that to clear the HashMap in
onDestroy() or in onStop() in case user presses Home button. But my Activity
launches another ListActivity in it. So the alternae option is to clear the
Hashmaps in onDestroy() | onStop() of this activity.
I am not much clear when the Activity exits. From the posts that i have read
i found few things here
http://groups.google.com/group/android-developers/browse_thread/thread/4c1b8955ebfd5799?pli=1
The manifest part android:clearTaskOnLaunch=true does not work in my case.
What do you people suggest in this case?
Thanks,
Alok.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Any Tips for implementing free versions of applications?

2010-01-01 Thread dan.x.sheph...@googlemail.com
Thanks, I've just uploaded a trail version.  Because it was a puzzle
game that takes a certain length of time to do I just made it time out
after 2 minutes.  They can still keep using it, but only for 2 minutes
at a time, which is enough to do puzzle in easy level, but not in
medium or hard unless you are some kind of genius with very fast
fingers.  This way I also don't have to check if they are reinstalling
where one would have to leave some kind of data on the phone or keep a
record of owners in a remote database or something like that.  I think
the idea of tracking usage and a link direct to the market is a good
one.  But I don't know how you tell what the exact direct android
market URL to an application is on the phone.  Anyway, thank you for
your advice.  I think when I make something a bit larger/better I
might go about spend more time on such things.  I did put a hit
counter on the associated web site at least just to see if anyone
visits the site.  If it gets busy, then maybe I could put pay per
click adverts on it or something, but I doubt it will get that busy.

On Jan 2, 5:06 am, schwiz sch...@gmail.com wrote:
 upload a paid version too, and in the free version keep track of how
 many times they play or how long they play with preferences and then
 don't allow them to start a new game and also give them a button to
 take them directly to the market with your paid version.

 On Dec 31 2009, 10:49 am, dan.x.sheph...@googlemail.com

 dan.x.sheph...@googlemail.com wrote:
  Hi, I already mentioned this briefly in another post as part of
  another publishing topic.

  But I think it is pretty important for a lot of us to know good ways
  to make free versions that can't be cracked too easily etc.  After all
  most people just download the free stuff, I know I do, so its
  important for numbers.

  I just made a game called ScrollSlider and I want to make a free
  version with limited evaluation period perhaps, but I could use some
  advice on how to do it.  I'm also having problems with data
  persistence as views appear and disappear and managing game loop view
  thread accordingly.

  Cheers in advance for any tips,

  Dan

 www.cuffedtothekeyboard.com

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


[android-developers] Re: Best HTTP Request Method

2010-01-01 Thread Brion Emde
I think that it is automatic. Just be sure to keep your HttpClient
object around for as long as you're going to be using it. For example:
create the HttpClient in your onCreate() and close it in onDestroy()
for your activity.

On Jan 1, 10:45 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
wrote:
 Thanks a lot!  Just wondering:  how do you set the keep-alive
 setting?  I just can't seem to get it!

 Thanks for all your help!

 On Jan 1, 5:08 pm, Frank Weiss fewe...@gmail.com wrote:



  I've seen 5 sec occasionally getting an rss feed of about 28 KB using
  java.net.URL.openConnection().getInputStream() and then parsing it with
  SAXParser. It looks like you're doing a POST to send form data(?) so you may
  have to stick with HTTPClient.

  If you're doing frequent requests, you can probably take advantage of
  HTTPClient's keep-alive connection management.

  If you're looking for optimizations, I strongly suggest you create a test
  app which performs the same request you're having performance problems with.
  Collect more data, such as the size of the request and response. Try the
  same request from a different platform (like your laptop or desktop).
  Compare the network paths between the desktop and Android to the server.

  I know you'd like to just get an answer do this/try this. I hope that by
  looking into the problem in more detail you''ll find a solution.

  On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer cbo...@gmail.com

   wrote:
   About 5 seconds, which isn't unbearable, but considering my app needs
   frequent requests some kind of optimization must be possible.

   Look at the android market...it seems to load everything pretty fast
   (much faster than my app at least!)

   On Jan 1, 3:15 pm, Frank Weiss fewe...@gmail.com wrote:
Considering that the execute method's latency includes network and 
server
times, on what basis do you think it's taking too long? What latency are
   you
observing, less than one second, more than one minute?

On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer 
   cbo...@gmail.com

 wrote:
 Yes, I've tried logging and the HTTP execute definitely takes the
 largest chunk of time, but how can I speed it up?  Is there another
 protocol/method?

 On Dec 31 2009, 6:07 pm, jotobjects jotobje...@gmail.com wrote:
  On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com
  wrote:

   It works fine, but it's quite slow...any way to make it faster?

  A guess would be that the HTTP network speed is 100's of times 
  slower
  than all the rest of the code. You might log the time before and
   after
  the execute method if you haven't already done that.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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.comandroid-developers%2Bunsubs
   cr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

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


[android-developers] Re: Facing serious problem with static objects

2010-01-01 Thread Brion Emde
What is the reason that your HashMap and arrays are static? Perhaps
they are a component of each instance of your Activity, rather than
having a single HashMap and arrays for all instances?


On Jan 2, 12:27 am, Alok Kulkarni kulsu...@gmail.com wrote:
 Hi guys, I am facing a problem in my application.
 I have a few static arrays and Hashmaps in my app which i fill in when my
 Activity starts.Then this  activity later launches another Activity. Now
 user presses Home button of Back button and again restarts the app, even
 then the static objects remain in memory. I beleive this is default android
 behaviour.
 I have an example app.
 package com.cm.test;

 import java.util.HashMap;

 import android.app.Activity;
 import android.os.Bundle;
 import android.util.Log;

 public class MyActivity extends Activity {
     public static HashMapString, String hMap = new HashMapString,
 String();

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         Log.i(***,Hash map size = +hMap.size());

         hMap.put(Alok,Alo);
         hMap.put(Jitu,Jit);

         Log.i(***,Activity onCreate() called);
     }
     @Override
     public void onDestroy()
     {
         Log.i(***,Activity onDestroy() called);
         super.onDestroy();

     }

     @Override
     public void onResume()
     {
         super.onResume();
         Log.i(***,Activity onResume() called);
     }
     @Override
     public void onStop()
     {

         super.onStop();

         Log.i(***,Activity onStop() called);
     }

 }

 Output First time is Size = 0. for 1st launch, Next for every launch ,
 HashMap size is 2... If i use ArrayList , the size of ArrayList goes on
 increasing.
 I dont want this to happen.One thing was that to clear the HashMap in
 onDestroy() or in onStop() in case user presses Home button. But my Activity
 launches another ListActivity in it. So the alternae option is to clear the
 Hashmaps in onDestroy() | onStop() of this activity.
 I am not much clear when the Activity exits. From the posts that i have read
 i found few things 
 herehttp://groups.google.com/group/android-developers/browse_thread/threa...
 The manifest part android:clearTaskOnLaunch=true does not work in my case.
 What do you people suggest in this case?
 Thanks,
 Alok.

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