[android-developers] Re: Motorola Droid -- Poor accelerometer performance

2009-12-08 Thread Heiko
With SENSOR_DELAY_GAME I get very unstable sample rates. Mostly it
averages around 9 samples/second, but I also got 20, 30, 60 and 80.
Seems like the SensorEventListener is very unreliable. The iPod 2G and
iPhone 3GS have approximately the same hardware as the Droid (even the
same accelerometer), but the sample rates average around 85 on these
devices (reliable).

Any word on the reliability of the SensorEventListener? I am kind of
stuck here at the moment...

Cheers
Heiko

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

2009-12-08 Thread Jack Ganesh
No One knows ? ? ?



On Dec 8, 9:08 am, Jack Ganesh ganesh...@gmail.com wrote:
 HI All,
  Any one knows how to Kill my all the activity at a time ?

 Am inside so many sub menu if i click exit button there it should
 close all teh activity and show the OEM Screen.

 Cheers,
 Ganesh

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

2009-12-08 Thread peter
anyone kowns?

On 12月7日, 下午1时31分, peter heywoodpres...@gmail.com wrote:
 Hello, Everyone:
  I found that in SmsMessage class, it has an instance of
 method named getServiceCenterAddress( ).
 this method could get the Message Center Address from message's pdu
 that you recived.

 But my application want to get this address directly, and base
 on it to do some performance.
 Is there have any method directly to get Message Center
 Service Number ?

 Thanks!

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


[android-developers] Re: Where could I download the SDK source code

2009-12-08 Thread budziq


On Dec 8, 3:59 am, Grant jeasun...@gmail.com wrote:
 Dear All:

 Where could I download the SDK source code

 Thanks.

Well, it depends on what You mean by SDK source code...
If it is the SDK itself then it is http://developer.android.com/sdk/index.html

And if you really mean the source code then you would start with:
http://android.git.kernel.org/?p=platform/development.git;a=summary
and you should look into one of the snapshots
such as merge from donut or merge from eclair to get more or less
the source for SDK.
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary
is also very useful.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Difference between ImageView.setImageBitmap() and RemoteView.setImageViewBitmap() ????

2009-12-08 Thread Jeff Sharkey
One alternative you can use is RemoteViews.setImageViewUri(), and then
write your own ContentProvider that feeds images through
openAssetFile().

j


On Wed, Nov 18, 2009 at 8:55 PM, tedd jeevitha.jaya...@gmail.com wrote:
 Hi,

 I have seen that the ImageView.setImageBitmap() can process high
 resolution images(even of size greater than 480x640),  but
 RemoteView.setImageViewBitmap() fails with FAILED BINDER TRANSCATION
 error 

 Is there ary constraint on the bitmap size which RemoteView can
 handle 
 Why is the difference in the behaviour 

 Plz clarify this...


 Thanks,
 tedd

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




-- 
Jeff Sharkey
jshar...@android.com

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


Re: [android-developers] ACTION_APPWIDGET_PICK , filtering the list

2009-12-08 Thread Jeff Sharkey
The current API doesn't allow for filtering of that list, and that
ACTION is the only method of binding.  A future API improvement might
be to allow automatic binding of widgets if the certificates match
between the requested provider and host.

j


On Thu, Nov 26, 2009 at 6:44 AM, daniel.benedykt
daniel.bened...@gmail.com wrote:
 Hi

 I have my own widget container.
 I am running the intent 'ACTION_APPWIDGET_PICK'  but I want only to
 show some items in the list and not all items.
 Is there a way to filter the list?

 if not, is there any way to let the user just add one widget to my
 container, and not have to select form the list?

 Thanks

 Daniel

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




-- 
Jeff Sharkey
jshar...@android.com

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


Re: [android-developers] Re: appwidget Image on Orientation Change Issue

2009-12-08 Thread Jeff Sharkey
Remember that widget RemoteViews updates are applied over a
potentially-cached layout.  You should always set all values on each
update you send.  For example, if the last update you passed only
updated a TextView, that single update could potentially be applied
over the top of a brand new layout (such as after an orientation
change).

j


On Sun, Nov 29, 2009 at 3:20 AM, Ryan rgra...@gmail.com wrote:
 Ok I think I figured it out. In certain cases when the widget is
 clicked i updated the RemoteViews to hide some on screen controls/
 views using setViewVisibility on the remoteview, however I did not re-
 set the setImageURI. When the screen rotated the Image dissappeared.
 However this is odd because I would expect the image to dissappear on
 updating the RemoteView without the ImageURI even without rotating the
 screen. But it would only dissappear after rotating. When I did not go
 through the routine that hid the controls/ did not set the
 setViewVisibility, the image did not dissappear on rotation.

 I am curious as to what happens to the RemoteView on orientation
 change and why sometimes it seems to retain the ImageURI and others it
 loses it.

 In any case I have my workaround.

 - Ryan

 On Nov 28, 12:12 am, Ryan rgra...@gmail.com wrote:
 I am building an appwidget that is displaying images from the sdcard.
 I am investigating how to get the appwidget to perform correctly on an
 orientation change. Currently I am setting the image on an image
 button in the remoteview from a Bitmap I created in the program.
 However it seems that when the orientation changes this bitmap is
 destroyed and the image won't display unless I update the remoteview
 of the appwidget after the orientation change.

 What should I do so that when the appwidget is remade after
 orientation change the image is able to be redisplayed automatically?
 The only thing I can think of is using a setImageViewURI() to point
 the remoteview to the image file itself using a URI (I am having
 issues getting this to work correctly thus far).

 It seems that none of my code is excecuted on this orientation change
 as it is only rebuilding the remoteview. Is there an accepted practice
 here? Thanks,

 - Ryan

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




-- 
Jeff Sharkey
jshar...@android.com

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


Re: [android-developers] Re: Safe way to get the My Contacts Group?

2009-12-08 Thread Jeff Sharkey
You're correct, the Google Contacts sync adapter could change the
TITLE for this group in the future.

However, it's more likely that we'll use RES_PACKAGE and TITLE_RES to
set a custom, localized title in the future.

j


On Thu, Nov 19, 2009 at 12:11 PM, jak. koda...@gmail.com wrote:
 I'm a little worried about using the literal string 'System Group: My
 Contacts' to find the group.
 Can this differ on certain devices or locales?

 String where = ContactsContract.Groups.ACCOUNT_NAME +  ==' + toAcct
 + ' AND  + ContactsContract.Groups.TITLE + =='System Group: My
 Contacts';

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




-- 
Jeff Sharkey
jshar...@android.com

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


Re: [android-developers] android Contacts application theme/style

2009-12-08 Thread Jeff Sharkey
The default framework theme is dark.  :)

j


On Thu, Nov 19, 2009 at 4:16 PM, n179911 n179...@gmail.com wrote:
 Hi,

 Can you please tell me why the android Contacts application
 theme/style is using 'dark' theme? For example, the activity's
 background is Black instead of White.
 I have looked at their Android Manifest xml file and their layout xml
 file (e.g. call details.xml) file, but i don't see how they specified
 using a 'dark' theme?

 Can you please tell me how do they do that? I have looked at
 http://developer.android.com/guide/topics/ui/themes.html, but I don't
 see Contacts app is doing that.

 Thank you for any help.

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




-- 
Jeff Sharkey
jshar...@android.com

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


Re: [android-developers] Android 2.0 Bugs in ContactsContract.Intents.Insert

2009-12-08 Thread Jeff Sharkey
The Organization and Notes fields have been fixed in a future release,
internal tracking #2256272.

As for the Name field, our current splitting algorithm lives down in
the provider, which is why it only assigns to the first-name field.
Future API should probably be added to allow callers to specify
first/last name separately.

j


On Wed, Nov 25, 2009 at 4:10 PM, wusch jwu...@gmail.com wrote:
 Hi all, so I am using the Android 2.0 intents to create contacts.

 Looks like several of the Constants when past as Extra's in the Intent
 objects do not properly map to the fields in the Add UI in the
 contacts app.

 Specifically the ones I am having issues with are:

 COMPANY
 JOB_TITLE

 do not seem to map to the Organization fields on the Add UI,

 and
 NAME

 seems to put the data into First Name field and leaves Family Name
 blank on the Add UI.

 I tried searching for a bug reporting mechanism for Android O/S, but
 didn't have much luck.    Can someone point me at the bug repository?
 I can provide sample code that demonstrates the bug.

 Thanks,
 Jeff

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




-- 
Jeff Sharkey
jshar...@android.com

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


[android-developers] Re: GK:How to Kill all Activity at a time ?

2009-12-08 Thread Dexter#39;s Brain
Why would you want to do it?

But there are, according to me, 2 ways.
1. Home Button
2. Power Off

Actually, if you really want to kill your process, you can use any
other Task Manager kind of application.

Thanks and Regards,
Kumar Bibek
http://tech-droid.blogspot.com

On Dec 8, 1:15 pm, Jack Ganesh ganesh...@gmail.com wrote:
 No One knows ? ? ?

 On Dec 8, 9:08 am, Jack Ganesh ganesh...@gmail.com wrote:

  HI All,
   Any one knows how to Kill my all the activity at a time ?

  Am inside so many sub menu if i click exit button there it should
  close all teh activity and show the OEM Screen.

  Cheers,
  Ganesh



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

2009-12-08 Thread Jack Ganesh
Hi Dexter,
   Through Code i need to kill all Activity. Am into my Sub
Menu in my Application.
there if i press exit then i need to come to OEM Screen means Phone
welcome screen.
How to do ? ? ?

Cheers,
Ganesh

On Dec 8, 2:39 pm, Dexter#39;s Brain coomar@gmail.com wrote:
 Why would you want to do it?

 But there are, according to me, 2 ways.
 1. Home Button
 2. Power Off

 Actually, if you really want tokillyour process, you can use any
 other Task Manager kind of application.

 Thanks and Regards,
 Kumar Bibekhttp://tech-droid.blogspot.com

 On Dec 8, 1:15 pm, Jack Ganesh ganesh...@gmail.com wrote:



  No One knows ? ? ?

  On Dec 8, 9:08 am, Jack Ganesh ganesh...@gmail.com wrote:

   HIAll,
    Any one knows how toKillmyalltheactivityat atime?

   Am inside so many sub menu if i click exit button there it should
   closealltehactivityand show the OEM Screen.

   Cheers,
   Ganesh- Hide quoted text -

 - Show quoted text -

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


[android-developers] Re: How can I call service methods from broadcastReceiver?

2009-12-08 Thread MSChoi
I tested with blocking some lines of function call inside of
startSensor() and stopSensor().
Then there is no failure message.

Does any expert know how to call those function in startSensor(),
stopSensor().
Please tell me how~

/**
* remoteService.java
*/
public class RemoteService extends Service {

  //emit codes...

  SensorManager sensorManager;


  public void startSensor(){
//String service_name = Context.SENSOR_SERVICE; ---block
//sensorManager = (SensorManager)getSystemService(service_name);
---block
//sensorManager.registerListener(accelSensorListener, ---block
//
SensorManager.SENSOR_ACCELEROMETER,SensorManager.SENSOR_DELAY_UI); ---
block
  }


  public void stopSensor(){
//sensorManager.unregisterListener(accelSensorListener); ---block
  }

 //emit codes...
}


On 12월7일, 오후5시18분, MSChoi moon_...@hotmail.com wrote:
 I am very apperciate with your answer.

 1. Maybe you can not raise a Toast from aBroadcastReceiverbecasue
 the string resource is not matching with my code.
 You can test the code after erase all Toast inBroadcastReceiver.

 2. As you mentioned before , I created an activity in other
 application which calls statService method, so I could start service.

 3. I understand your idea. I can add more information in an intent and
 I can do what I want at the start of the sevice or end of it.
But I still need to handle the service during service life cycle,
 using an activity in the other application.
Could you give me more information or sample code about it.

 Thank you.

 On 12월7일, 오후4시39분, Mark Murphy mmur...@commonsware.com wrote:



   Hello

   I made two applications. One for an activity receiving user input, the
   other for a background service.
   In the service package, I create two files
   (startSensorBroadReceiver.java, remoteService.java).
   StartSensorBroadReceiver will receiver an intent from activity
   application and call method inside of the service.

  I would get rid of the broadcast receiver and just have the activity work
  with the service.

   There is no erron in the codes but I can not excute what is want.
   I meet a message like this The application ServiceExample has stopped
   unexpectedly. Please try again.

   could you let me know. what is wrong? and how I can call service
   methods frombroadcastReceiver?

  1. I would not raise a Toast from aBroadcastReceiver.

  2. You cannot call new RemoteService() to create an Android service. You
  need to call startService() with an appropriate Intent to start up your
  RemoteService. And, bear in mind that the service will not be started
  until after your onReceive() method returns.

  3. You cannot call methods on a service from aBroadcastReceiververy
  easily. I would strongly recommend you find some other solution (e.g., put
  extras on the Intent you use with startService(), so your service learns
  what to do from those extras alone).

  You can see an example of aBroadcastReceiverusing startService() to
  start up a service here:

 http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices...

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html- 원본 텍스트 숨기기 -

 - 원본 텍스트 보기 -

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


[android-developers] Upgrade problems with HTC hero type phones

2009-12-08 Thread SCMSoft
Hi all,

We have a number of users experiencing crashes with our apps on Hero
type phones (hero, droid eris, etc.). After some debugging, it appears
that they upgraded the app, but that the phone somehow cached the old
version of the AndroidManifest. For instance, the app version is still
reported as one less than the latest, and the crash is caused by the
phone not seeing a new activity in the Manifest (which is true for the
old version manifest, but the new manifest of course has the activity
defined).
This seems to be limited to Hero phones, but we've seen it on all
types (tmeu hero, verizon desirec, etc.).
Is there any way to fix this besides spending many characters of the
limited description size on something like Hero users: please
uninstall before upgrading? Will there be a Hero fix to fix this
behaviour?

Thanks,

Mathijs, Swiss Codemonkey team

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


[android-developers] deleting then recreating a MapView in the same MapActivity fails

2009-12-08 Thread steelbytes
Hi,

I've got an Activity that extends MapActivity.

it uses ViewGroup.removeAllViews()  LayoutInflater.inflate() to
changes parts of itself.

if it creates then deletes then [re]creates a MapView using the above
method, it gets an exception during inflate that says:
You are only allowed to have a single MapView in a MapActivity

how to I get MapActivity to forget the previous MapView instance?

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


[android-developers] Getting altitude / height / elevation

2009-12-08 Thread Neilz
Anyone know if it's possible to obtain the physical height or altitude
of your device, using the sensors or by any other means?

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

2009-12-08 Thread Mark Murphy
Through Code i need to kill all Activity. Am into my Sub
 Menu in my Application.
 there if i press exit then i need to come to OEM Screen means Phone
 welcome screen.
 How to do ? ? ?

Don't do it. That goes against Android conventions.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


[android-developers] How to show menu item automatically?

2009-12-08 Thread Sasikumar.S
Hi,

How to show menu items automatically (without clicking menu button) when the
layout is viewed?..

-- 
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: Exception in com.google.android.location.ConfirmAlertActivity

2009-12-08 Thread Dexter#39;s Brain
Hi,

There is an error in your XML file, at line no 54. Check it out. Or
paste that part of your xml. Also, mention the API version you are
using.

Thanks,
Kumar Bibek
http://tech-droid.blogspot.com

On Dec 8, 1:43 am, Vijay vijay.meenakshisunda...@gmail.com wrote:
 I get a ResourceNotFoundException from
 com.google.android.location.ConfirmAlertActivity. But I'm sure
 secondary_text_dark.xml is in my base/core/res/res/color. Does anyone
 know the reason?

 Here is my log:

 E/AndroidRuntime( 5629): Uncaught handler: thread
 android.server.ServerThread exiting due to uncaught exception
 E/AndroidRuntime( 5629): *** EXCEPTION IN SYSTEM PROCESS.  System will
 crash.
 E/AndroidRuntime( 5629): java.lang.RuntimeException: Unable to start
 activity ComponentInfo{com.google.android.location/
 com.google.android.location.ConfirmAlertActivity}:
 android.view.InflateException: Binary XML file line #54: Error
 inflating class java.lang.reflect.Constructor
 E/AndroidRuntime( 5629):        at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2401)
 E/AndroidRuntime( 5629):        at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2417)
 E/AndroidRuntime( 5629):        at android.app.ActivityThread.access$2100
 (ActivityThread.java:116)
 E/AndroidRuntime( 5629):        at android.app.ActivityThread$H.handleMessage
 (ActivityThread.java:1794)
 E/AndroidRuntime( 5629):        at android.os.Handler.dispatchMessage
 (Handler.java:99)
 E/AndroidRuntime( 5629):        at android.os.Looper.loop(Looper.java:123)
 E/AndroidRuntime( 5629):        at com.android.server.ServerThread.run
 (SystemServer.java:411)
 E/AndroidRuntime( 5629): Caused by: android.view.InflateException:
 Binary XML file line #54: Error inflating class
 java.lang.reflect.Constructor
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.createView
 (LayoutInflater.java:512)
 E/AndroidRuntime( 5629):        at
 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
 (LayoutInflater.java:617)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
 (LayoutInflater.java:620)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
 (LayoutInflater.java:620)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
 (LayoutInflater.java:407)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
 (LayoutInflater.java:320)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
 (LayoutInflater.java:276)
 E/AndroidRuntime( 5629):        at
 com.android.internal.policy.impl.PhoneWindow.setContentView
 (PhoneWindow.java:334)
 E/AndroidRuntime( 5629):        at
 com.android.internal.app.AlertController.installContent
 (AlertController.java:204)
 E/AndroidRuntime( 5629):        at
 com.android.internal.app.AlertActivity.setupAlert(AlertActivity.java:
 74)
 E/AndroidRuntime( 5629):        at
 com.google.android.location.ConfirmAlertActivity.onCreate
 (ConfirmAlertActivity.java:50)
 E/AndroidRuntime( 5629):        at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1123)
 E/AndroidRuntime( 5629):        at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2364)
 E/AndroidRuntime( 5629):        ... 6 more
 E/AndroidRuntime( 5629): Caused by:
 java.lang.reflect.InvocationTargetException
 E/AndroidRuntime( 5629):        at
 com.android.internal.widget.DialogTitle.init(DialogTitle.java:38)
 E/AndroidRuntime( 5629):        at
 java.lang.reflect.Constructor.constructNative(Native Method)
 E/AndroidRuntime( 5629):        at java.lang.reflect.Constructor.newInstance
 (Constructor.java:446)
 E/AndroidRuntime( 5629):        at android.view.LayoutInflater.createView
 (LayoutInflater.java:499)
 E/AndroidRuntime( 5629):        ... 19 more
 E/AndroidRuntime( 5629): Caused by: android.content.res.Resources
 $NotFoundException: File res/color/secondary_text_dark.xml from color
 state list resource ID #0x0
 E/AndroidRuntime( 5629):        at
 android.content.res.Resources.loadColorStateList(Resources.java:1873)
 E/AndroidRuntime( 5629):        at
 android.content.res.TypedArray.getColorStateList(TypedArray.java:303)
 E/AndroidRuntime( 5629):        at android.widget.TextView.init
 (TextView.java:380)
 E/AndroidRuntime( 5629):        at android.widget.TextView.init
 (TextView.java:320)
 E/AndroidRuntime( 5629):        ... 23 more
 E/AndroidRuntime( 5629): Caused by: android.content.res.Resources
 $NotFoundException: File res/color/secondary_text_dark.xml from xml
 type colorstatelist resource ID #0x0
 E/AndroidRuntime( 5629):        at
 android.content.res.Resources.loadXmlResourceParser(Resources.java:
 1980)
 E/AndroidRuntime( 5629):        at
 android.content.res.Resources.loadColorStateList(Resources.java:1868)
 E/AndroidRuntime( 5629):        ... 26 more

-- 
You received this message because you are subscribed to the 

[android-developers] Re: How to show menu item automatically?

2009-12-08 Thread Dexter#39;s Brain
openOptionsMenu()

Thanks and Regards,
Kumar Bibek

http://tech-droid.blogspot.com

On Dec 8, 3:40 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
 Hi,

 How to show menu items automatically (without clicking menu button) when the
 layout is viewed?..

 --
 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: Getting altitude / height / elevation

2009-12-08 Thread Neilz
Hi, thanks for the reply.

Yes, I just found the getAltitude() method of Location. Unfortunately
it just seems to return 120.0, and doesn't seem to have the accuracy
of getLatitude() and getLongitude(). I need the same degree of
accuracy for it to be any use.

On Dec 8, 10:35 am, Dexter#39;s Brain coomar@gmail.com wrote:
 You can use the location manager.

 There are attributes like latitude, longitude and altitude which you
 can get directly from the Location Manager.

 If the provider is GPS PROVIDER, they you would probably get the
 height everytime, but if you are querying for the NETWORK PROVIDER,
 then the height would always be set to zero, well, in most cases.

 Thanks and Regards,
 Kumar Bibek

 http://tech-droid.blogspot.com

 On Dec 8, 3:30 pm, Neilz neilhorn...@googlemail.com wrote:

  Anyone know if it's possible to obtain the physical height or altitude
  of your device, using the sensors or by any other means?



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

2009-12-08 Thread Kumar Bibek
Well, the documentation doesn't mention anything about the accuracy.
You can try and check by moving around, from ground to first floor,
how does it behave.

I guess, it is a GPS fix, then you can probably look up in Google how
does it calculate the altitude and what's the accuracy.

Thanks and Regards,
Kumar Bibek

http://tech-droid.blogspot.com

On Dec 8, 3:51 pm, Neilz neilhorn...@googlemail.com wrote:
 Hi, thanks for the reply.

 Yes, I just found the getAltitude() method of Location. Unfortunately
 it just seems to return 120.0, and doesn't seem to have the accuracy
 of getLatitude() and getLongitude(). I need the same degree of
 accuracy for it to be any use.

 On Dec 8, 10:35 am, Dexter#39;s Brain coomar@gmail.com wrote:

  You can use the location manager.

  There are attributes like latitude, longitude and altitude which you
  can get directly from the Location Manager.

  If the provider is GPS PROVIDER, they you would probably get the
  height everytime, but if you are querying for the NETWORK PROVIDER,
  then the height would always be set to zero, well, in most cases.

  Thanks and Regards,
  Kumar Bibek

 http://tech-droid.blogspot.com

  On Dec 8, 3:30 pm, Neilz neilhorn...@googlemail.com wrote:

   Anyone know if it's possible to obtain the physical height or altitude
   of your device, using the sensors or by any other means?



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


Re: [android-developers] Re: How to show menu item automatically?

2009-12-08 Thread Sasikumar.S
Hi kumar,

Thanks for ur reply...

how to use that?..

On Tue, Dec 8, 2009 at 4:16 PM, Dexter#39;s Brain coomar@gmail.comwrote:

 openOptionsMenu()

 Thanks and Regards,
 Kumar Bibek

 http://tech-droid.blogspot.com

 On Dec 8, 3:40 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
  Hi,
 
  How to show menu items automatically (without clicking menu button) when
 the
  layout is viewed?..
 
  --
  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
 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: How to show menu item automatically?

2009-12-08 Thread Kumar Bibek
Just in your onCreate() or onResume() method, call this.

Thanks,
Kumar Bibek
http://tech-droid.blogspot.com

On Dec 8, 3:58 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
 Hi kumar,

 Thanks for ur reply...

 how to use that?..

 On Tue, Dec 8, 2009 at 4:16 PM, Dexter#39;s Brain 
 coomar@gmail.comwrote:



  openOptionsMenu()

  Thanks and Regards,
  Kumar Bibek

 http://tech-droid.blogspot.com

  On Dec 8, 3:40 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
   Hi,

   How to show menu items automatically (without clicking menu button) when
  the
   layout is viewed?..

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


Re: [android-developers] Re: How to show menu item automatically?

2009-12-08 Thread Sasikumar.S
Hi kumar,

Thanks U


On Tue, Dec 8, 2009 at 4:29 PM, Kumar Bibek coomar@gmail.com wrote:

 Just in your onCreate() or onResume() method, call this.

 Thanks,
 Kumar Bibek
 http://tech-droid.blogspot.com

 On Dec 8, 3:58 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
  Hi kumar,
 
  Thanks for ur reply...
 
  how to use that?..
 
  On Tue, Dec 8, 2009 at 4:16 PM, Dexter#39;s Brain coomar@gmail.com
 wrote:
 
 
 
   openOptionsMenu()
 
   Thanks and Regards,
   Kumar Bibek
 
  http://tech-droid.blogspot.com
 
   On Dec 8, 3:40 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
Hi,
 
How to show menu items automatically (without clicking menu button)
 when
   the
layout is viewed?..
 
--
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
 
  --
  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
 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: GK:How to Kill all Activity at a time ?

2009-12-08 Thread Jack Ganesh
HI Mark,
Say some thing ? ? ?

Am in need to perfom this operation.



On Dec 8, 3:40 pm, Dexter#39;s Brain coomar@gmail.com wrote:
 Hi Mark,

 I am aware that this is the Android convention. But, in some
 situations, you just want to kill your activity.

 For example, in your browser, if you have been opening many pages, and
 then you click on Back, it takes you to the previous page in the
 browser's history. Say, my history has 10 pages, so to finally exit
 the application, I have to press back 10 times..

 One option obviously would be to press the Home button, and this
 suffices in this case. But, there might be a situation where you just
 want to close your application completely.

 Is there a way to do this?

 On Dec 8, 3:32 pm, Mark Murphy mmur...@commonsware.com wrote:



              Through Code i need to kill all Activity. Am into my Sub
   Menu in my Application.
   there if i press exit then i need to come to OEM Screen means Phone
   welcome screen.
   How to do ? ? ?

  Don't do it. That goes against Android conventions.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html- Hide quoted 
  text -

 - Show quoted text -

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


[android-developers] Tasks Running in Android

2009-12-08 Thread Sasikumar.S
Hi,

How to find, what are the tasks running in android emulator?...

-- 
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] Is there any way to but an Object to transfer between some Activities without Serialization

2009-12-08 Thread Le Tuan Anh
Normally, I used to apply method Intent.putExtrae(String,
Serializable) to put an Object transfer between some Activity in
Android.

But now, my object can not implement Serialization, so do you know any
other way to put Object in an Intent to get the same effect.

Thanks a lot

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

2009-12-08 Thread satishbabumsc
Try with  ps -A 

@
Satish bellapu

Sent from BlackBerry® on Airtel

-Original Message-
From: Sasikumar.S sasikumar.it1...@gmail.com
Date: Tue, 8 Dec 2009 16:42:53 
To: android-beginn...@googlegroups.com; android-chen...@googlegroups.com; 
android-developers@googlegroups.com; Blogspot 
Postsasikumar.it1989.andr...@blogger.com; 
MobileApplicationDevelopersmobile-application-develop...@googlegroups.com
Subject: [android-developers] Tasks Running in Android

Hi,

How to find, what are the tasks running in android emulator?...

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

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

2009-12-08 Thread Heiko
Problem solved. In case others experience the same problems:

The constants for the sensors seem to be wrong. I used: getSensorList
(SensorManager.SENSOR_ACCELEROMETER).get(0);  which returned a handle
to the magnetic field sensor. Also the Sensor.TYPE_ACCELEROMETER
constant returned a wrong handle. I solved it by manually looking up
the list and choosing the accelerometer afterwards:

getSensorList(Sensor.TYPE_ALL).get(0);

Now getting sample rates from 120-170 samples/second.

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

2009-12-08 Thread Sasikumar.S
Use finish(); to kill the current activity...

On Dec 8, 4:11 pm, Jack Ganesh ganesh...@gmail.com wrote:
 HI Mark,
 Say some thing ? ? ?

 Am in need to perfom this operation.

 On Dec 8, 3:40 pm, Dexter#39;s Brain coomar@gmail.com wrote:

  Hi Mark,

  I am aware that this is the Android convention. But, in some
  situations, you just want to kill your activity.

  For example, in your browser, if you have been opening many pages, and
  then you click on Back, it takes you to the previous page in the
  browser's history. Say, my history has 10 pages, so to finally exit
  the application, I have to press back 10 times..

  One option obviously would be to press the Home button, and this
  suffices in this case. But, there might be a situation where you just
  want to close your application completely.

  Is there a way to do this?

  On Dec 8, 3:32 pm, Mark Murphy mmur...@commonsware.com wrote:

           Through Code i need to kill all Activity. Am into my Sub
Menu in my Application.
there if i press exit then i need to come to OEM Screen means Phone
welcome screen.
How to do ? ? ?

   Don't do it. That goes against Android conventions.

   --
   Mark Murphy (a Commons Guy)http://commonsware.com
   Android App Developer Books:http://commonsware.com/books.html-Hide quoted 
   text -

  - Show quoted text -



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


[android-developers] Re: AppWidget / Home screen widget and size

2009-12-08 Thread Kaj Bjurman
Doesn't anyone got input on this issue? Isn't it possible to solve the
problem?


On 6 Dec, 19:50, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 I tried to create a folder named xml-small and placed the widget
 provider xml-files there.

 It looks like I need to use something like 50x50 dip for one cell on
 the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
 only work on the DSTL1. The HTC Tattoo which also is considered xml-
 small displays a 3x1 widget if I use 200x50 dip :(

 240x50 dip works as 4x1 on HTC Tattoo

 On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:

  Hi,

  I got some problems when specifying the size of my AppWidget / Home
  screen widget. The widget is currently available in the sizes 1x1, 2x1
  and 4x1 if we count in cells.

  Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
  and Motorola Droid (480 x 854), but I do have problems on the DSTL1
  (240x400).

  I have specified the sizes according to the description 
  here:http://android-developers.blogspot.com/2009/04/introducing-home-scree...

  Below is what I got in my xml-files.

  The problem on the DSTL1 is that it says that the 4x1 widget is too
  large to be placed on the home screen. The 2x1 widget looks like it is
  3x2, and the 1x1 widget looks like 2x2.

  What should I do? What's wrong?

  !-- small, 1x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=72dip
      android:minHeight=72dip
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

  !-- medium, 2x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=146dip
      android:minHeight=72dip
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

  !-- large, 4x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=294dp
      android:minHeight=72dp
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

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

2009-12-08 Thread Sasikumar.S
Hi,

Thanks for ur reply...

What is that  ps -A ?

On Tue, Dec 8, 2009 at 4:46 PM, satishbabu...@gmail.com wrote:

 Try with  ps -A

 @
 Satish bellapu

 Sent from BlackBerry® on Airtel
 --
 *From: * Sasikumar.S sasikumar.it1...@gmail.com
 *Date: *Tue, 8 Dec 2009 16:42:53 +0530
 *To: *android-beginn...@googlegroups.com; 
 android-chen...@googlegroups.com; android-developers@googlegroups.com;
 Blogspot Postsasikumar.it1989.andr...@blogger.com;
 MobileApplicationDevelopersmobile-application-develop...@googlegroups.com
 
 *Subject: *[android-developers] Tasks Running in Android

 Hi,

 How to find, what are the tasks running in android emulator?...

 --
 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
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Thanks  Regards
 Mobile Application Developers Group
 http://groups.google.com/group/mobile-application-developers




-- 
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: SensorManager.registerListener gives unexpected results

2009-12-08 Thread TonyDoc
Thanks, looks like I'm not going inasane...

Does anyone else have a Samsung Galaxy and can try this?

On Dec 6, 4:52 pm, Lance Nanek lna...@gmail.com wrote:
 T-Mobile G1:

 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=79
 V/SensorEvent( 2054): Time=159
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=39
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=59
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=60
 V/SensorEvent( 2054): Time=40
 V/SensorEvent( 2054): Time=58
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=39
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=21
 V/SensorEvent( 2054): Time=17
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=60
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=18
 V/SensorEvent( 2054): Time=20
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=19
 V/SensorEvent( 2054): Time=59
 V/SensorEvent( 2054): Time=39
 V/SensorEvent( 2054): Time=59
 V/SensorEvent( 2054): Time=79
 V/SensorEvent( 2054): Time=100

 On Dec 6, 6:09 am, TonyDoc tony...@gmail.com wrote:

  Hi,

  Could someone try the sample source for me on their device? I think it
  may be hardware related, I'm developing on a Samsung Galaxy.

  I get this output.

  12-06 11:04:01.337: VERBOSE/SensorEvent(27604): Time=213
  12-06 11:04:01.547: VERBOSE/SensorEvent(27604): Time=211
  12-06 11:04:01.767: VERBOSE/SensorEvent(27604): Time=212
  12-06 11:04:01.977: VERBOSE/SensorEvent(27604): Time=211
  12-06 11:04:02.187: VERBOSE/SensorEvent(27604): Time=214
  12-06 11:04:02.427: VERBOSE/SensorEvent(27604): Time=237
  12-06 11:04:02.657: VERBOSE/SensorEvent(27604): Time=226
  12-06 11:04:02.857: VERBOSE/SensorEvent(27604): Time=207
  12-06 11:04:03.077: VERBOSE/SensorEvent(27604): Time=216
  12-06 11:04:03.287: VERBOSE/SensorEvent(27604): Time=212
  12-06 11:04:03.497: VERBOSE/SensorEvent(27604): Time=212
  12-06 11:04:03.707: VERBOSE/SensorEvent(27604): Time=210
  12-06 11:04:03.927: VERBOSE/SensorEvent(27604): Time=211
  12-06 11:04:04.557: VERBOSE/SensorEvent(27604): Time=214
  12-06 11:04:04.967: VERBOSE/SensorEvent(27604): Time=413

  Thanks

  On Nov 30, 3:03 pm, TonyDoc tony...@gmail.com wrote:

   Here is the sample code

   package com.example.example;

   import android.app.Activity;
   import android.hardware.Sensor;
   import android.hardware.SensorEvent;
   import android.hardware.SensorEventListener;
   import android.hardware.SensorManager;
   import android.os.Bundle;
   import android.util.Log;
   import android.view.View;
   import android.view.View.OnClickListener;

   public class CopyOfTimedRun_Timer extends Activity implements
   OnClickListener, SensorEventListener {

       SensorManager mSensorManager;
       long lastTime;

       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           mSensorManager = (SensorManager) getSystemService
   (SENSOR_SERVICE);
           mSensorManager.registerListener
   (this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
   SensorManager.SENSOR_DELAY_FASTEST);
           setContentView(R.layout.main);
       }

       @Override
       public void onSensorChanged(SensorEvent event) {
           if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){
               Log.v(SensorEvent, Time=+(System.currentTimeMillis()-
   lastTime));
           }
           lastTime = System.currentTimeMillis();
       }

       @Override
       public void onAccuracyChanged(Sensor sensor, int accuracy) {}

       @Override
       public void onClick(View v) {}

   }

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

2009-12-08 Thread TonyDoc
What do you mean? Newer builds? Do you mean 1,6, 2.0? I'm using 1.5
SDK to try this...

On Dec 7, 5:45 pm, dan raaka danra...@gmail.com wrote:
 The newer versions of the build dont exhibit this problem ..
 -Dan

 On Mon, Nov 30, 2009 at 6:30 AM, TonyDoc tony...@gmail.com wrote:
  I'm registering a sensor listener with this line of code.

  mSensorManager.registerListener(this,mSensorManager.getDefaultSensor
  (Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);

  The rate is set to SENSOR_DELAY_FASTEST with the expectation that I
  would receive events roughly every 20-30ms. It turns out that I
  receive events only every 200-220ms (just now, my event code simply
  logcats the system time).

  No matter which rate I use, SENSOR_DELAY_NORMAL, SENSOR_DELAY_UI,
  SENSOR_DELAY_GAME, or SENSOR_DELAY_FASTEST, I get the same result?

  Any ideas to what am I doing wrong?

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

2009-12-08 Thread Sasikumar.S
Hi,

After i created my project. The R file is not generating.
I need to build the application to create that R file.
After i add any image or string. It is not automatically adding in R file.
I need to build another time to generate that code in R file.
what is the reason?...

-- 
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] integration testing with content provider

2009-12-08 Thread tenacious
I have an application which uses its own content provider in several
activities.  I've written a ProviderTestCase2 for my content provider
without much problem.  For this I extended RenamingDelegatingContext
to use a test database instance.

Now I want to write integration tests against my activities, but I
again want to use a test database instance for the provider - like I
did in my provider test.  I'm having problems here.  I don't see a way
to inject a mock context or MockContentResolver into activities
launched in ActivityInstrumentationTestCase2.  So, I've tried using
ActivityUnitTestCase, but this seems wrong since my test isn't a unit
test, and I want to be able to write tests that simulate user
interaction and make assertions about data in the test instance of my
database.

So...
1) Should I be using ActivityInstrumentationTestCase2 as the base test
class?
2) If not, what base test class would you recommend?
3) How have you gotten this to work for you?  Any examples?

Thanks,
Free

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

2009-12-08 Thread Le Tuan Anh
There is something wrong with your layout (XML), just check the file
content, refresh and run again.


Le Tuan Anh
Sent from Sint-Josse-Ten-Noode, Brx, Belgium

2009/12/8 Sasikumar.S sasikumar.it1...@gmail.com

 Hi,

 After i created my project. The R file is not generating.
 I need to build the application to create that R file.
 After i add any image or string. It is not automatically adding in R file.
 I need to build another time to generate that code in R file.
 what is the reason?...

 --
 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
 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] R file not generating automatically

2009-12-08 Thread Sasikumar.S
Hi,

Thanks for ur repply..

Not only for single project.

I created lot of projects.
In All the project the R file is not generating for past 3 days..

On Tue, Dec 8, 2009 at 5:03 PM, Le Tuan Anh anhlt1...@gmail.com wrote:

 There is something wrong with your layout (XML), just check the file
 content, refresh and run again.


 Le Tuan Anh
 Sent from Sint-Josse-Ten-Noode, Brx, Belgium

 2009/12/8 Sasikumar.S sasikumar.it1...@gmail.com

 Hi,

 After i created my project. The R file is not generating.
 I need to build the application to create that R file.
 After i add any image or string. It is not automatically adding in R file.
 I need to build another time to generate that code in R file.
 what is the reason?...

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

Re: [android-developers] R file not generating automatically

2009-12-08 Thread Sasikumar.S
WHAT MAY BE THE CHANGES IN LAYOUT FILE?...

On Tue, Dec 8, 2009 at 5:08 PM, Le Tuan Anh anhlt1...@gmail.com wrote:

 I got the same problem in several times, the reason only I can figure out
 and fixed is look at the layout file carefully to debug and then it work.

 Le Tuan Anh
 Sent from Sint-Josse-Ten-Noode, Brx, Belgium

 2009/12/8 Sasikumar.S sasikumar.it1...@gmail.com

 Hi,

 Thanks for ur repply..

 Not only for single project.

 I created lot of projects.
 In All the project the R file is not generating for past 3 days..


 On Tue, Dec 8, 2009 at 5:03 PM, Le Tuan Anh anhlt1...@gmail.com wrote:

 There is something wrong with your layout (XML), just check the file
 content, refresh and run again.


 Le Tuan Anh
 Sent from Sint-Josse-Ten-Noode, Brx, Belgium

 2009/12/8 Sasikumar.S sasikumar.it1...@gmail.com

  Hi,

 After i created my project. The R file is not generating.
 I need to build the application to create that R file.
 After i add any image or string. It is not automatically adding in R
 file.
 I need to build another time to generate that code in R file.
 what is the reason?...

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





-- 
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: File Downloads in Android Web Browser

2009-12-08 Thread AJ
i hope at least somebody would be having any idea on this.

Thanks,
AJ

On Dec 8, 10:40 am, AJ ajeet.invinci...@gmail.com wrote:
 Hi All,

 I have problem in downloading the content when Content-Disposition:
 attachment is specified in response coming from the server.

 I searched the forum and found that earlier one guy also had the
 similar issues. I am facing the exactly same problem which being
 specified there.

 Here is the link 
 :-http://groups.google.com/group/android-developers/browse_thread/threa...

 Is this Android Browser issue?
 Can anybody throw some light on it.

 Thanks,
 AJ

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


[android-developers] Re: Is there any way to but an Object to transfer between some Activities without Serialization

2009-12-08 Thread Kumar Bibek
NopesIt can't be done with the simplicity you are asking for.

The Remote Interface way, or the Parcelable way.

Thanks and Regards,
Kumar Bibek

http://tech-droid.blogspot.com

On Dec 8, 4:13 pm, Le Tuan Anh anhlt1...@gmail.com wrote:
 Normally, I used to apply method Intent.putExtrae(String,
 Serializable) to put an Object transfer between some Activity in
 Android.

 But now, my object can not implement Serialization, so do you know any
 other way to put Object in an Intent to get the same effect.

 Thanks a lot

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


[android-developers] broadcastreceiver never died?

2009-12-08 Thread sleith
hi,
i created application with name Test, and has a class that extends
broadcastreceiver that listen for PACKAGE_RESTARTED.
i use Advanced Task Killer, and killed the Test application. but when
i kill another application, for example gmail, the Test's
broadcastreceiver got the intent (i logged it).

Does it means that broadcastreceiver will never died?

Thanks :)

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


Re: [android-developers] Re: GK:How to Kill all Activity at a time ?

2009-12-08 Thread Mark Murphy
 For example, in your browser, if you have been opening many pages, and
 then you click on Back, it takes you to the previous page in the
 browser's history. Say, my history has 10 pages, so to finally exit
 the application, I have to press back 10 times..

Press HOME, and you're done. Moreover, that's what Android is trying to
teach users to do -- press HOME, and they're done.

Remember: everybody keeps holding iPhone up as perfection for user design,
and applications there do not have normally an exit option AFAICT. Users
just press The One And Only Button, and they're done. (Note: my iPod Touch
hasn't been, er, touched since before the OS 3.0 upgrade, so perhaps they
changed their UI approach recently and I missed it).

So, just make sure your app behaves the way you want when the user presses
HOME, and you're done.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


Re: [android-developers] broadcastreceiver never died?

2009-12-08 Thread Mark Murphy
 i created application with name Test, and has a class that extends
 broadcastreceiver that listen for PACKAGE_RESTARTED.
 i use Advanced Task Killer, and killed the Test application. but when
 i kill another application, for example gmail, the Test's
 broadcastreceiver got the intent (i logged it).

 Does it means that broadcastreceiver will never died?

No, it means that a new copy was started.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


[android-developers] Re: loop sound

2009-12-08 Thread JacobGladish
After loading the file in Audacity (windows vista)  and looping it, it
revealed that my file simply didn't play cleanly. The original audio
sources I have are in apple's core audio format. The funny thing is
that I used quicktime pro to convert them from .caf to .wav, and then
both mp3 and ogg from there. I used audacity to convert directly
from .caf to .ogg and everything is working fine now.

Audcatiy is

On Dec 7, 11:23 am, JacobGladish jacobglad...@yahoo.com wrote:
 I'll definitely test in audacity. I've been converting audio files to/
 from just about every format over the past few days. It's possible it
 has gotten corrupted along the way. Thanks for the suggestion.

 On Dec 7, 10:53 am, niko20 nikolatesl...@yahoo.com wrote:



  One other thing - are you sure yoursoundis really loopable? Load it
  into Audacity and play it in looped mode, does it not have the click
  then? Just to check!

  -niko

  On Dec 7, 9:51 am, niko20 nikolatesl...@yahoo.com wrote:

   Hi, you don't need a callback. write() blocks until more data is
   needed. So you could just make a separate thread that pushes the data
   out as fast as write() will let it.

   -niko

   On Dec 7, 9:02 am, JacobGladish jacobglad...@yahoo.com wrote:

MODE_STATIC still has a clickingsoundwhen it loops. What I think I
need to do is continuously stream the data via AudioTrack.write(). Any
ideas on how how to manage the timing of this? I was thinking that I
should use setPositionNotificationPeriod() to call a callback every n
frames, and in that callback load up n more frames from my buffer.

On Dec 7, 3:34 am, niko20 nikolatesl...@yahoo.com wrote:

 Hi,

 Dont know the answer to that one, I haven't used AudioTrack in
 MODE_STATIC much.

 -niko

 On Dec 6, 11:39 pm, JacobGladish jacobglad...@yahoo.com wrote:

  What is the setLoopPoints (int startInFrames, int endInFrames, int
  loopCount) on the AudioTrack? Will this cause the play() on a static
  AudioTrack toloopor do I need to create a streaming AudioTrack and
  manage my own timer calling write() repeatedly?

  On Dec 7, 12:13 am, JacobGladish jacobglad...@yahoo.com wrote:

   I'm using mostly oggs and it still does it. I'm going to try the
   AudioTrack route.

   On Dec 6, 9:19 pm, niko20 nikolatesl...@yahoo.com wrote:

Hi,

Using only the built in Audio stuff (MediaPlayer, SoundPool), 
the only
way to get seamless looping is to use samples in OGG format. 
Otherwise
you'll need to load the data yourself and play it by shoving it 
out
continously into a AudioTrack stream.

-niko

On Dec 6, 8:03 pm, JacobGladish jacobglad...@yahoo.com wrote:

 Has anyone been able to play a loopingsoundwithout any 
 noticeable
 delays or ticking sounds when it resets? I tried using the 
 MediaPlayer
 with setLookup(true). That seems to require that I manually 
 fade-in
 thesound-bite with volume control slowing incresing in order 
 to work
 around a nasty ticksoundwhen I call play(), but there's still 
 a very
 noticeablesoundwhen the it loops. The SoundPool doesn't do any
 better and also seems to require some unknown delay between 
 loading
 thesoundand playing it.

 I think my SoundPool issue is very similar to this:

http://code.google.com/p/android/issues/detail?id=1484

 I was hoping to get some feedback from someone who had any 
 experience
 with this before trying the AudioTrack route.- Hide quoted 
 text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

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


[android-developers] Problems with Accelerometer - random values

2009-12-08 Thread Enrique López Mañas
Hello all,

I'm using a HTC Magic in order to develop an application which makes
use of the accelerometer. Following the indications from tutorials and
the docs, this is a snapshot of the code I'm using:

/* Next code register the ACCELEROMETER SENSOR*/
  SensorManager mSensorManager = (SensorManager) getSystemService
(Context.SENSOR_SERVICE);

  ListSensor listSensors = mSensorManager.getSensorList
(Sensor.TYPE_ACCELEROMETER);
  Sensor acelerometerSensor = listSensors.get(0);
  mSensorManager.registerListener(this, acelerometerSensor,
SensorManager.SENSOR_DELAY_UI);

/*OnSensorChanged Method, here I receive the wrong values*/
public void onSensorChanged(SensorEvent event) {
// TODO Auto-generated method stub
synchronized (this) {
  switch(event.sensor.getType()) {
case Sensor.TYPE_ACCELEROMETER:
   for (int i=0 ; i3 ; i++) {
  mAccelerometerValues[i] =
event.values[i];
   }
 if ( mAccelerometerValues[0]  = 1)
  //selectAndChange() send some HTTP
Petitions and updates the screen
 selectAndChange(0, null,,3);
 else if ( mAccelerometerValues[0]  = -1)

 [...]

default:
 }

 }
}

I'm nevermind getting values that don't match with the accelerometer.
With the phone standing over my table, with no movement, I get values
like:

[0,0,15]
[0,6,8]
[0,0,0]

And sometimes the expected value:
[0,9.8,0]

I guess my SensorManager is kind of mixing all the other sensors, but
I do not guess where the problem could be. I have been checking other
codes, and in all of them the estructure is aproximately the same.

Any clues of what could I try?

Thank you

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


Re: [android-developers] Problems with Accelerometer - random values

2009-12-08 Thread Mark Murphy

 Hello all,

 I'm using a HTC Magic in order to develop an application which makes
 use of the accelerometer. Following the indications from tutorials and
 the docs, this is a snapshot of the code I'm using:

 /* Next code register the ACCELEROMETER SENSOR*/
   SensorManager mSensorManager = (SensorManager) getSystemService
 (Context.SENSOR_SERVICE);

   ListSensor listSensors = mSensorManager.getSensorList
 (Sensor.TYPE_ACCELEROMETER);
   Sensor acelerometerSensor = listSensors.get(0);
   mSensorManager.registerListener(this, acelerometerSensor,
 SensorManager.SENSOR_DELAY_UI);

 /*OnSensorChanged Method, here I receive the wrong values*/
 public void onSensorChanged(SensorEvent event) {
   // TODO Auto-generated method stub
   synchronized (this) {
 switch(event.sensor.getType()) {
 case Sensor.TYPE_ACCELEROMETER:
  for (int i=0 ; i3 ; i++) {
 mAccelerometerValues[i] =
 event.values[i];
  }
if ( mAccelerometerValues[0]  = 1)
   //selectAndChange() send some HTTP
 Petitions and updates the screen
selectAndChange(0, null,,3);
else if ( mAccelerometerValues[0]  = -1)

  [...]

   default:
  }

  }
 }

 I'm nevermind getting values that don't match with the accelerometer.
 With the phone standing over my table, with no movement, I get values
 like:

 [0,0,15]
 [0,6,8]
 [0,0,0]

 And sometimes the expected value:
 [0,9.8,0]

 I guess my SensorManager is kind of mixing all the other sensors, but
 I do not guess where the problem could be. I have been checking other
 codes, and in all of them the estructure is aproximately the same.

 Any clues of what could I try?

Rather than:

Sensor acelerometerSensor = listSensors.get(0);  
mSensorManager.registerListener(this, acelerometerSensor,
SensorManager.SENSOR_DELAY_UI);

try:

mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
SensorManager.SENSOR_DELAY_UI);

This may not help, but it is safer code than just assuming get(0) will
give you the best accelerometer.

Also, have you checked around your table for a black hole, neutron star,
or any other strong gravitational source that might affect your readings?
:-)

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


[android-developers] Re: Problems with Accelerometer - random values

2009-12-08 Thread Enrique López Mañas
Thank you Mark,

Yes, I just take out from my table my USB black hole, but still not
working. I was reading on another Thread that the problem might be
because of external influences like music or whatever, but I'm not
playing on my application:

The Thread is:

https://groups.google.com/group/android-developers/browse_thread/thread/5b4ce338d4c57669/c405d018e26683ab#c405d018e26683ab

On the LogCat I'm getting as well the following messages:

12-08 14:02:06.854: DEBUG/SensorManager(13541): found sensor: AK8976A
3-axis Accelerometer, handle=0
12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
3-axis Magnetic field sensor, handle=1
12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
Orientation sensor, handle=2
12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
Temperature sensor, handle=3
12-08 14:02:06.884: DEBUG/Sensors(75): sensors=0001, real=0001
12-08 14:02:06.884: DEBUG/AKMD(56): Compass OPEN

Last one make me fill uncomfortable. Am I really using the Compass? :S

On 8 Dez., 13:41, Mark Murphy mmur...@commonsware.com wrote:
  Hello all,

  I'm using a HTC Magic in order to develop an application which makes
  use of the accelerometer. Following the indications from tutorials and
  the docs, this is a snapshot of the code I'm using:

  /* Next code register the ACCELEROMETER SENSOR*/
    SensorManager mSensorManager = (SensorManager) getSystemService
  (Context.SENSOR_SERVICE);

    ListSensor listSensors = mSensorManager.getSensorList
  (Sensor.TYPE_ACCELEROMETER);
    Sensor acelerometerSensor = listSensors.get(0);
    mSensorManager.registerListener(this, acelerometerSensor,
  SensorManager.SENSOR_DELAY_UI);

  /*OnSensorChanged Method, here I receive the wrong values*/
  public void onSensorChanged(SensorEvent event) {
             // TODO Auto-generated method stub
             synchronized (this) {
                       switch(event.sensor.getType()) {
                                      case Sensor.TYPE_ACCELEROMETER:
                                        for (int i=0 ; i3 ; i++) {
                                               mAccelerometerValues[i] =
  event.values[i];
                                        }
                      if ( mAccelerometerValues[0]  = 1)
                                    //selectAndChange() send some HTTP
  Petitions and updates the screen
                              selectAndChange(0, null,,3);
                      else if ( mAccelerometerValues[0]  = -1)

                                       [...]

                             default:
                       }

               }
  }

  I'm nevermind getting values that don't match with the accelerometer.
  With the phone standing over my table, with no movement, I get values
  like:

  [0,0,15]
  [0,6,8]
  [0,0,0]

  And sometimes the expected value:
  [0,9.8,0]

  I guess my SensorManager is kind of mixing all the other sensors, but
  I do not guess where the problem could be. I have been checking other
  codes, and in all of them the estructure is aproximately the same.

  Any clues of what could I try?

 Rather than:

 Sensor acelerometerSensor = listSensors.get(0);  
 mSensorManager.registerListener(this, acelerometerSensor,
 SensorManager.SENSOR_DELAY_UI);

 try:

 mSensorManager.registerListener(this,
 mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
 SensorManager.SENSOR_DELAY_UI);

 This may not help, but it is safer code than just assuming get(0) will
 give you the best accelerometer.

 Also, have you checked around your table for a black hole, neutron star,
 or any other strong gravitational source that might affect your readings?
 :-)

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

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


[android-developers] Re: Problems with Accelerometer - random values

2009-12-08 Thread Enrique López Mañas
Ok, now the values are for some reason (with my phone so far from any
computer device, and facing up) the following:

[1.1304889, -0.88532263, 11.863323]


On 8 Dez., 14:07, Enrique López Mañas eenriquelo...@gmail.com wrote:
 Thank you Mark,

 Yes, I just take out from my table my USB black hole, but still not
 working. I was reading on another Thread that the problem might be
 because of external influences like music or whatever, but I'm not
 playing on my application:

 The Thread is:

 https://groups.google.com/group/android-developers/browse_thread/thre...

 On the LogCat I'm getting as well the following messages:

 12-08 14:02:06.854: DEBUG/SensorManager(13541): found sensor: AK8976A
 3-axis Accelerometer, handle=0
 12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
 3-axis Magnetic field sensor, handle=1
 12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
 Orientation sensor, handle=2
 12-08 14:02:06.864: DEBUG/SensorManager(13541): found sensor: AK8976A
 Temperature sensor, handle=3
 12-08 14:02:06.884: DEBUG/Sensors(75): sensors=0001, real=0001
 12-08 14:02:06.884: DEBUG/AKMD(56): Compass OPEN

 Last one make me fill uncomfortable. Am I really using the Compass? :S

 On 8 Dez., 13:41, Mark Murphy mmur...@commonsware.com wrote:

   Hello all,

   I'm using a HTC Magic in order to develop an application which makes
   use of the accelerometer. Following the indications from tutorials and
   the docs, this is a snapshot of the code I'm using:

   /* Next code register the ACCELEROMETER SENSOR*/
     SensorManager mSensorManager = (SensorManager) getSystemService
   (Context.SENSOR_SERVICE);

     ListSensor listSensors = mSensorManager.getSensorList
   (Sensor.TYPE_ACCELEROMETER);
     Sensor acelerometerSensor = listSensors.get(0);
     mSensorManager.registerListener(this, acelerometerSensor,
   SensorManager.SENSOR_DELAY_UI);

   /*OnSensorChanged Method, here I receive the wrong values*/
   public void onSensorChanged(SensorEvent event) {
              // TODO Auto-generated method stub
              synchronized (this) {
                        switch(event.sensor.getType()) {
                                       case Sensor.TYPE_ACCELEROMETER:
                                         for (int i=0 ; i3 ; i++) {
                                                mAccelerometerValues[i] =
   event.values[i];
                                         }
                       if ( mAccelerometerValues[0]  = 1)
                                     //selectAndChange() send some HTTP
   Petitions and updates the screen
                               selectAndChange(0, null,,3);
                       else if ( mAccelerometerValues[0]  = -1)

                                        [...]

                              default:
                        }

                }
   }

   I'm nevermind getting values that don't match with the accelerometer.
   With the phone standing over my table, with no movement, I get values
   like:

   [0,0,15]
   [0,6,8]
   [0,0,0]

   And sometimes the expected value:
   [0,9.8,0]

   I guess my SensorManager is kind of mixing all the other sensors, but
   I do not guess where the problem could be. I have been checking other
   codes, and in all of them the estructure is aproximately the same.

   Any clues of what could I try?

  Rather than:

  Sensor acelerometerSensor = listSensors.get(0);  
  mSensorManager.registerListener(this, acelerometerSensor,
  SensorManager.SENSOR_DELAY_UI);

  try:

  mSensorManager.registerListener(this,
  mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
  SensorManager.SENSOR_DELAY_UI);

  This may not help, but it is safer code than just assuming get(0) will
  give you the best accelerometer.

  Also, have you checked around your table for a black hole, neutron star,
  or any other strong gravitational source that might affect your readings?
  :-)

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html

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


[android-developers] Re: Emulator on Linux 10 times slower than on Windows

2009-12-08 Thread brian.schim...@googlemail.com
@Michael MacDonald:
Seems like a good advice, but i my case didn't help neither.

@arnouf:
 - I'm not sure what you mean by using the good environment x86 /
64. I tested this on x86 hardware and on x64 hardware, but always
with a 32 Bit Linux. Is seems as if the host processor bits have no
impact on the speed of emulation.
 - I don't think that my speed issues are somehow related to the JDK
I'm using. The most simple test for speed goes like this: Start the
host computer, start a clean emulator from a terminal, wait for the
boot process to finish, and slide the drawer on the homescreen several
times. This does not involve any code compiled by me, but already
shows great differences in performance. Those host hardware
configurations that are slow on sliding the drawer are also slow on
anything else related to the emulator.

@all:
It seems as if my adb is crashing/hanging rather often, on all
hardware systems I'm using. I'm going investigate this a little bit
more. Thank you all for your advices and help.

Brian

On 7 Dez., 17:56, arnouf arnaud.far...@gmail.com wrote:
 I had this problem with Ubuntu 8.10, two things :
 - check that you're using the good environment x86 / 64
 - use preferly the SUN JDK 1.6  to compile Android development (you
 can use the JDK 1.5 to work with sources).

 Today I'm using a bipro intel, 4Gb, Ubuntu 9.10 and SUN JDK 1.5.0.20
 and performance are really good.

 BR

 On Dec 7, 5:49 pm, Michael MacDonald googlec...@antlersoft.com
 wrote:

  I've had bad Linux/hardware interactions with the emulator from audio.
  The emulator AFAIK uses the SDL audio libraries.  Try starting the
  emulator from the command line with the -noaudio flag and see if that
  works better.

  brian.schim...@googlemail.com wrote:
   To answer your questions:
   I was using Ubuntu two different hardware setups, both had 2 GB Ram
   installed, about 75% of which was free. See below for an output of
   free.

   As far as I can tell (that is, as far as java -version tells me),
   I'm using Sun's Java:

   java version 1.6.0_16
   Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
   Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

   But I think this wouldn't matter anyway, because the Android Emulator
   is based on Quemu which is native software, not Java. Or am I missing
   something?

   To make things even stranger than they were before, I removed my hard
   disk and attached it to yet another computer, which normally should
   perform about equally to the two systems I was using before, despite
   it only has 1 GB of Ram. I'm booting my Ubuntu from the hard disk
   attached via USB, and here everything runs smoothly, including the
   emulator. Even with method tracing turned on, performance is ok and
   very comparable to what I was used to have on XP.

   So the conclusion would be, that my first hardware setup can't be the
   bottleneck, since it runs the emulator fine under XP, and that my
   Ubuntu configuration can't be the bottleneck, since it runs the
   emulator fine on the third hardware configuration. Too bad that the
   first computer is broken now, and the third one doesn't belong to me,
   and the second one performs badly under ubuntu and currently has no
   XP.

   Just for completeness, here's the output of free, made on that nice
   third computer which runs it just fine:
                total       used       free     shared    buffers
   cached
   Mem:       1017192     971392      45800          0      18844
   310512
   -/+ buffers/cache:     642036     375156
   Swap:      2441840     218892    948

   On 5 Dez., 17:23, theSmith chris.smith...@gmail.com wrote:

   My emulators behave just fine under 9.10 Karmic Kola, unless I start
   method tracing, then it really slows down.
    Are you using the java sun jdk and not the open jdk?

   On Dec 5, 11:12 am, Mark Murphy mmur...@commonsware.com wrote:

   I'm using a dual boot configuration with Windows XP and Ubuntu 9.04.
   On XP, the emualtor is somehow slower than a real G1 device, but it's
   completely ok.

   But on Ubuntu, the emulator is unusable slow. Note that other programs
   run just fine under my ubuntu. I have no exact measurements, but I
   think the emulator about 10 times slower than on Windows. Installing a
   small app takes more than 2 minutes, starting an app sometimes takes
   over 2 minutes, returning to the home screen takes up to 40 seconds,
   and there is not a single click I can do that takes less than 2
   seconds to trigger some kind of reaction. I get around 2 fps at most,
   no matter what I do.

   I am writing this email on a notebook, dual-boot Vista and Ubuntu 9.04,
   and if anything, the Ubuntu emulator is a bit faster.

   Also, I noticed that under heavy usage of the emulator, the usage of
   my real CPU never went above 30%.

   Is there any explanation for this slowness on Ubuntu? Or even a way to
   further investigate where the bottleneck might be?

   How much RAM do 

[android-developers] Re: Updating SDK through AVD

2009-12-08 Thread Lieuwe

 I know the error message doesn't seem to relate to the problem, but
 that fixed it for me.

 -C


I found a direct link here:

http://dl-ssl.google.com/android/repository/android-1.5_r03-linux_x86.zip

Your solution may well have worked as I indeed had several of these
google API's already installed (but not all the SDK's)

L

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


[android-developers] ActivityManager.restartPackage() is not working

2009-12-08 Thread Asif k
Hi All,

  I want to kill my application whose base activity is
demo.test.MyActivity.

 I am trying to kill it from other application by following code, but
getting the error like  package name is not valid


 am.restartPackage(demo.test); // here am is ActivityManager define
earlier )

Thanks,
Asif

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

2009-12-08 Thread Abhi
can anyone help me on this topic please?

On Dec 8, 1:06 am, Abhi abhishek.r.sha...@gmail.com wrote:
 Hello,

 I have a tab layout with two tabs, the first of which has a listview
 of 5 clickable rows. Below this listview, I need a button. I have been
 able to create the listview but don't know how to create the button to
 the bottom of the display. Please help.

 Also, the listview is created using ArrayAdapter from a Strings array,
 like below

 String[] istrings = new String[] (I, Me, Myself);
 this.setListAdapter (new ArrayAdapterString (this,
 android.R.layout.simple_list_item_1, istrings));

 Looking forward to your help.

 Thanks,

 Sharma

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

2009-12-08 Thread Mark Murphy

 I was doing alarm manager and stuff.

 i did like below

 public class AlarmExample extends Activity {
   private Button setAlarmButton = null;

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

   setAlarmButton = (Button) findViewById(R.id.Button01);
   setAlarmButton.setOnClickListener(new OnClickListener() {
   public void onClick(View v) {

Intent intent = new Intent(AlarmExample.this,
 OnetimeAlarmReceiver.class);
PendingIntent pendingIntent = 
 PendingIntent.getBroadcast
 (AlarmExample.this, 1, intent, 0);

AlarmManager alarmManager = (AlarmManager) 
 getSystemService
 (ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, 
 System.currentTimeMillis
 () + (10 * 1000), pendingIntent);

Toast.makeText(AlarmExample.this, Alarm set,
 Toast.LENGTH_LONG).show();
   }

   });
   }
 }



 public class OnetimeAlarmReceiver extends BroadcastReceiver {

   @Override
   public void onReceive(Context context, Intent intent) {
   Toast.makeText(context, Alarm worked., 
 Toast.LENGTH_LONG).show();
   }
 }

Don't use a Toast from a BroadcastReceiver. Use Log to write to LogCat, or
write a line to a text file on the SD card, or something.

 Alarm is set, but never fired. neither in simulator nor in the device.
 Whats wrong ? need i do something in manifest file ?

LogCat (from adb logcat, DDMS, or the DDMS perspective in Eclipse) might
have some hints. For example, is your BroadcastReceiver declared in the
manifest?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


[android-developers] RemoteService and RemoteServiceBinding - Different package (apk) - Problem

2009-12-08 Thread Ash
Hi!!

I have made two different packages for API Demo sample -
RemoteService in Service app package (Service.apk)
RemoteServiceBinding in Client app package(Client.apk)
(two different apk and two different projects in eclipse)

The Service app offer services which Client app binds to and utilizes.
The Service app gets started during BOOT COMPLETE.

This model works great when I do a full source build(without eclipse).

But when I make them under Eclipse, and my Client app invokes
registerCallback method on Service app interface, the
IRemoteServiceCallback instance(interface implemented in Client app)
is received null in Service app.

I have confirmed that mCallback (object passed) is not null.

I couldn't observe any error in logs. What could be the problem?

Thanks in advance
Ash

#
Client app - code
#
private IRemoteServiceCallback mCallback = new
IRemoteServiceCallback.Stub() {
/**
 * This is called by the remote service regularly to tell us
about
 * new values.  Note that IPC calls are dispatched through a
thread
 * pool running in each process, so the code executing here
will
 * NOT be running in our main thread like most other things --
so,
 * to update the UI, we need to use a Handler to hop over
there.
 */
public void valueChanged(int value) {
mHandler.sendMessage(mHandler.obtainMessage(BUMP_MSG,
value, 0));
}
};

 private ServiceConnection mConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className,
IBinder service) {
// This is called when the connection with the service has
been
// established, giving us the service object we can use to
// interact with the service.  We are communicating with
our
// service through an IDL interface, so get a client-side
// representation of that from the raw service object.
mService = IRemoteService.Stub.asInterface(service);
mKillButton.setEnabled(true);
mCallbackText.setText(Attached.);

// We want to monitor the service for as long as we are
// connected to it.
try {
mService.registerCallback(mCallback);
} catch (RemoteException e) {
// In this case the service has crashed before we
could even
// do anything with it; we can count on soon being
// disconnected (and then reconnected if it can be
restarted)
// so there is no need to do anything here.
}

##
Service app code
##
private final IRemoteService.Stub mBinder = new IRemoteService.Stub()
{
public void registerCallback(IRemoteServiceCallback cb) {
if (cb != null) mCallbacks.register(cb);
}
public void unregisterCallback(IRemoteServiceCallback cb) {
if (cb != null) mCallbacks.unregister(cb);
}
};


PROBLEM-
-
The registerCallback gets invoked on Service app code but parameter
'cb' is null
#

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

2009-12-08 Thread Philip
Hi all,
Firstly, we can see here:
{sdk-path}/docs/reference/android/app/
SearchManager.html#SearchabilityMetadata

In particular, we can change the text in the Search button through
below:
android:searchButtonText If provided, this text will replace the
default text in the Search button.

Then, I need to change the color of the Search button. Maybe I need
to change the android framework, is it? what can I do?

Any suggests will be helpful. Thank you very much.

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

2009-12-08 Thread justinh
Is that the package name you have defined in your Manifest for the
package attribute? Also, you need to provide the parameter as a
String.

On Dec 8, 8:46 am, Asif k asifk1...@gmail.com wrote:
 Hi All,

   I want to kill my application whose base activity is
 demo.test.MyActivity.

  I am trying to kill it from other application by following code, but
 getting the error like  package name is not valid

  am.restartPackage(demo.test); // here am is ActivityManager define
 earlier )

 Thanks,
 Asif

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


[android-developers] JDBC Driver for SQLiteDatabase

2009-12-08 Thread kristianlm


Hi folks!


I've been looking around for a portable way to use database
functionality in Android without much success. I wanted to interface
the built-in SQLite database in Android through JDBC but there were no
drivers ...right? at least I could not find any!

So I started my own: http://code.google.com/p/sqldroid/


It's only a beginning, but it works for my relatively simple demands
at the moment.
So my question is:

Why is no such JDBC driver already included in Android? Am I missing
the big picture here? I fear this is a bad idea but that I don't see
it. Why would you not want to interface the built-in SQLite engine
through JDBC?


Any advice welcome!
Thanks,
Kris

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


[android-developers] Units for Paint.setTextSize() ?

2009-12-08 Thread WoodManEXP
Does anyone know what the units are for Paint.setTextSize(size) ?

With the TextView class you can use a call like

TextView.setTextSize(TypedValue.COMPLEX_UNIT_PT, ptSize)

to select the units of the size parameter. How are the units set for
Paint.setTextSize()?

Thank you,

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


[android-developers] Re: broadcastreceiver never died?

2009-12-08 Thread justinh
It's going to call every time that broadcast is sent. If you want to
handle specific packages you need to do that inside the receiver by
looking at the received Intent. Each time it's done handling that
broadcast it should be garbage collected.

On Dec 8, 6:53 am, sleith raysle...@gmail.com wrote:
 hi,
 i created application with name Test, and has a class that extends
 broadcastreceiver that listen for PACKAGE_RESTARTED.
 i use Advanced Task Killer, and killed the Test application. but when
 i kill another application, for example gmail, the Test's
 broadcastreceiver got the intent (i logged it).

 Does it means that broadcastreceiver will never died?

 Thanks :)

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


[android-developers] Re: Adding button to ListView

2009-12-08 Thread AJ
It looks the following link is explaining what do you want, but i am
not sure. Check it.

http://www.anddev.org/viewtopic.php?p=28745

Thanks,
AJ

On Dec 8, 6:59 pm, Abhi abhishek.r.sha...@gmail.com wrote:
 can anyone help me on this topic please?

 On Dec 8, 1:06 am, Abhi abhishek.r.sha...@gmail.com wrote:



  Hello,

  I have a tab layout with two tabs, the first of which has a listview
  of 5 clickable rows. Below this listview, I need a button. I have been
  able to create the listview but don't know how to create the button to
  the bottom of the display. Please help.

  Also, the listview is created using ArrayAdapter from a Strings array,
  like below

  String[] istrings = new String[] (I, Me, Myself);
  this.setListAdapter (new ArrayAdapterString (this,
  android.R.layout.simple_list_item_1, istrings));

  Looking forward to your help.

  Thanks,

  Sharma

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

2009-12-08 Thread Jags
hmm I was right at guessing that, i miss something in manifest. Thanks
a lot

i had to add this to have it worked

 receiver android:name=.OnAlarmReceiver
/receiver

regards
Jagat

On Dec 8, 8:01 pm, Mark Murphy mmur...@commonsware.com wrote:
  I was doing alarm manager and stuff.

  i did like below

  public class AlarmExample extends Activity {
     private Button setAlarmButton = null;

     /** Called when the activity is first created. */
    �...@override
     public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.main);

             setAlarmButton = (Button) findViewById(R.id.Button01);
             setAlarmButton.setOnClickListener(new OnClickListener() {
                     public void onClick(View v) {

                              Intent intent = new Intent(AlarmExample.this,
  OnetimeAlarmReceiver.class);
                              PendingIntent pendingIntent = 
  PendingIntent.getBroadcast
  (AlarmExample.this, 1, intent, 0);

                              AlarmManager alarmManager = (AlarmManager) 
  getSystemService
  (ALARM_SERVICE);
                              alarmManager.set(AlarmManager.RTC_WAKEUP, 
  System.currentTimeMillis
  () + (10 * 1000), pendingIntent);

                              Toast.makeText(AlarmExample.this, Alarm set,
  Toast.LENGTH_LONG).show();
                     }

             });
     }
  }

  public class OnetimeAlarmReceiver extends BroadcastReceiver {

    �...@override
     public void onReceive(Context context, Intent intent) {
             Toast.makeText(context, Alarm worked., 
  Toast.LENGTH_LONG).show();
     }
  }

 Don't use a Toast from a BroadcastReceiver. Use Log to write to LogCat, or
 write a line to a text file on the SD card, or something.

  Alarm is set, but never fired. neither in simulator nor in the device.
  Whats wrong ? need i do something in manifest file ?

 LogCat (from adb logcat, DDMS, or the DDMS perspective in Eclipse) might
 have some hints. For example, is your BroadcastReceiver declared in the
 manifest?

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

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


[android-developers] SDK version problem

2009-12-08 Thread Lieuwe
Hi,

I have this strange problem here. I am fairly new to Android
development and I was just playing around putting a few bits and
pieces from several samples together.

I created (in Eclipse) an Android 1.5 project (thats sdk version 3
right?) .. now it creates the apk file no problem, Eclipse doesn't
indicate any problems either, but when I run this through my Android
1.5 AVD I get an error message stating

ERROR: Application requires API version 4. Device API version is 3
(Android 1.5).
Launch canceled!

so how come it is quite capable of linking against the 1.5 library
without errors, but it won't execute it in the AVD ... and more
important - how do I found out which bit of code I apparently use is
from API version 4??

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

2009-12-08 Thread sleith
ok thanks for your replies :)

On Dec 8, 9:14 pm, justinh henderson.jus...@gmail.com wrote:
 It's going to call every time that broadcast is sent. If you want to
 handle specific packages you need to do that inside the receiver by
 looking at the received Intent. Each time it's done handling that
 broadcast it should be garbage collected.

 On Dec 8, 6:53 am, sleith raysle...@gmail.com wrote:

  hi,
  i created application with name Test, and has a class that extends
  broadcastreceiver that listen for PACKAGE_RESTARTED.
  i use Advanced Task Killer, and killed the Test application. but when
  i kill another application, for example gmail, the Test's
  broadcastreceiver got the intent (i logged it).

  Does it means that broadcastreceiver will never died?

  Thanks :)

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


[android-developers] Lazy Loading Images in a ListView

2009-12-08 Thread Samuh
I trying a hand at ListViews and my current experiment is aimed at
displaying some data in a ListView. The data to be displayed in each
row is simple: an image and some text. The images come from a remote
server and the textual data is hardcoded.

I have a class that downloads images using AsyncTask and caches the
list of images fetched as SoftReferences in a LinkedHashMap. I am also
passing a reference of the view to this class, so when the image
download/cache read is complete the class will set appropriate Bitmap
in the view.

Following is my code:

//class BasicAdapter extends ArrayAdapterRowData
...
static class ViewHolder{
TextView text;
ImageView icon;
}

@Override
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder;
if(convertView == null){
convertView = 
mInflater.inflate(R.layout.listview_row,null);

holder = new ViewHolder();
holder.text = (TextView) 
convertView.findViewById(R.id.row_txt);
holder.icon = (ImageView) 
convertView.findViewById(R.id.row_img);

convertView.setTag(holder);
}
else{
holder = (ViewHolder) convertView.getTag();
}

holder.text.setText(mDataSet.get(position).getMText());

//set default icon
holder.icon.setImageResource(R.drawable.icon);

// set the actual image from the cache
String imageUrl = mDataSet.get(position).getMUrl();
WriteThroughCache.getImage(holder.icon, imageUrl);

return convertView;

}

// My helper class that manages cache and image Download

public class WriteThroughCache{
static LinkedHashMapString,SoftReferenceBitmap imageCache =
new LinkedHashMapString,SoftReferenceBitmap();

public static void getImage(ImageView icon, String imageUrl){
if(imageCache.containsKey(imageUrl)){
Bitmap image = imageCache.get(imageUrl).get();
if(image != null){
icon.setImageBitmap(image);
return;
}
}

new LoadImageInBackground().execute(new 
Object[]{icon,imageUrl});

}

static class LoadImageInBackground extends AsyncTaskObject, Void,
Bitmap{
ImageView mIcon = null;
String mUrl = null;
@Override
protected Bitmap doInBackground(Object... params) {
mIcon = (ImageView)params[0];
mUrl = (String) params[1];
Bitmap image = BitmapFactory.decodeStream
(GetMethodExecutor.getResponseStream(mUrl));
return image;
}
@Override
protected void onPostExecute(Bitmap result) {
super.onPostExecute(result);
mIcon.setImageBitmap(result);
imageCache.put(mUrl, new SoftReferenceBitmap(result));
}


}
}

Problem: The applications seems to work just fine. However, when I
touch scroll the screen sometimes, the rows display the default image
and Loading.. text. These are never refreshed.
But if I fling the listview, everything works normal then.

I am not sure of what I am missing here, please guide.

Thanks.



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


[android-developers] Re: Adding button to ListView

2009-12-08 Thread justinh
You can specify a View id for the content of a tab. So in setContent
(int viewId) you would use something other than a ListView, ie, a view
that had a listview inside of it with a button on the bottom.

On Dec 8, 9:16 am, AJ ajeet.invinci...@gmail.com wrote:
 It looks the following link is explaining what do you want, but i am
 not sure. Check it.

 http://www.anddev.org/viewtopic.php?p=28745

 Thanks,
 AJ

 On Dec 8, 6:59 pm, Abhi abhishek.r.sha...@gmail.com wrote:

  can anyone help me on this topic please?

  On Dec 8, 1:06 am, Abhi abhishek.r.sha...@gmail.com wrote:

   Hello,

   I have a tab layout with two tabs, the first of which has a listview
   of 5 clickable rows. Below this listview, I need a button. I have been
   able to create the listview but don't know how to create the button to
   the bottom of the display. Please help.

   Also, the listview is created using ArrayAdapter from a Strings array,
   like below

   String[] istrings = new String[] (I, Me, Myself);
   this.setListAdapter (new ArrayAdapterString (this,
   android.R.layout.simple_list_item_1, istrings));

   Looking forward to your help.

   Thanks,

   Sharma

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


[android-developers] DatagramSocket and Receive

2009-12-08 Thread fala70
I am working with UDP and DatagramSocket. I verified that the Receive
function clear all data more of setLength of DatagramPacket. My
packets have a variable len. I use first two bytes to understand the
len packet.

public void run() {

byte []buff = new byte[1024];


}


private int ReadData(byte []byBuff, int iSize) throws IOException{

_datagram.setData(byBuff);
_datagram.setLength(iSize);
_socket.receive(_datagram);
int iRet = _datagram.getLength();
return iRet;
}

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

2009-12-08 Thread superjet
Hi, I've made a little test component that overrides ImageView, called
myImageView, and prints some text and an arrayList of Doubles over
whatever image is specified in the related xml.

However, right now, the text and Doubles that are drawn over the image
are defined within the myImageView class. Is there a way to pass the
data from the main onCreate function to the myImageView class before
the layout is drawn?

I'm new to OO programming, but based on my understanding of this:
http://developer.android.com/guide/topics/ui/custom-components.html
it's possible because ImageView is just like any other class. This
leaves me with two initial guesses:
1.  I could generate my test data in the main onCreate, and store it
in the array's xml file, and then read that xml file with
myImageView,

OR 2.  I could extend view instead of ImageView, but because of my new-
ness, then I would lose the ability to use it in an xml layout sense -
and that's what I really want.

Thanks for any tips, or references! I can post code if needed, but
this is more of an approach question.
sj

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


[android-developers] DatagramSocket and Receive

2009-12-08 Thread fala70
I am working with UDP and DatagramSocket. I verified that the Receive
function clear all data more of setLength of DatagramPacket. My
packets have a variable len. I use first two bytes to understand the
len packet.
This is my code:

public void run() {

byte []buff = new byte[1024];
while(true){
ReadData(buff,2);
iSizePack = buff[1]  0x00FF;
iSizePack = 8;
iSizePack |= (buff[0]  0x00FF);
ReadData(buff, iSizePack);
   }

}


private int ReadData(byte []byBuff, int iSize) throws IOException{

_datagram.setData(byBuff);
_datagram.setLength(iSize);
_socket.receive(_datagram);
int iRet = _datagram.getLength();
return iRet;
}


Seem that after first call to my ReadData to read the size of packet,
it read correctly the 2 bytes, but _socket.receive clear all remain
bytes, then to the next call of ReadData to read iSizePack, it read
the next datagram.

Can somebody confirm that ?
Is there a mode to maintain the data of datagram until of the datagram
is all read ?

thanks

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


Re: [android-developers] JDBC Driver for SQLiteDatabase

2009-12-08 Thread Mark Murphy
 Why is no such JDBC driver already included in Android?

Android does not support JDBC.

 Am I missing the big picture here?

Android is designed to be used on devices with limited RAM, limited CPU,
limited storage space for application code, and limited electricity
(battery), to connect to local databases.

JDBC is designed to be used on devices with lots of RAM, lots of CPU
speed, comparatively unlimited storage space for application code,
full-time AC power, to connect to local databases and database servers.

 Why would you not want to interface the built-in SQLite engine
 through JDBC?

You lose performance, battery life, and on-board storage space, all of
which are in short supply in an Android device.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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


[android-developers] Web server to use user-agent to determine if request was from Android

2009-12-08 Thread Stephen Abrams
Hello all,

I am curious about what user-agents we can expect the Android phones to use
by default when using WebView.  I am considering checking user-agents
strings for mobile and android to determine if request to server is from
an Android phone.


With a G2 development phone, WebView requests use:

Mozilla/5.0 (Linux; U; Android 1.5; en-us; Google Ion Build/CRB43)
AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1

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: Camera Preview Filter Choppiness

2009-12-08 Thread Streets Of Boston
You're right, rollback... i didn't even notice that.

Although the threads are a one-shot processing and end immediately
after that,  the system may start to choke on the sheer multitude of
them, especially if the decoding is a bit slow.

Greg, create only one thread and pause and resume the thread when
necessary.
Use the ExecutorService - spawning Futures - (java.util.concurrent
package) for that if you don't want to write your own concurrency and
synchronization implementation.

On Dec 7, 6:05 pm, rollbak roll...@gmail.com wrote:
 That's right, and also you are spawning new threads in every preview
 frame. And last but not least, i don't think having two surfaceview
 stacked is a good solution, at least is not intended for using it that
 way.

 On Dec 7, 2:10 pm, Streets Of Boston flyingdutc...@gmail.com wrote:



  How fast is 'decodeYUV' method? You call this method while your canvas
  is locked.
  If 'decodeYUV' is slow, it not only makes your background thread
  sluggish, but your main GUI-thread as well, because the canvas is
  locked for too long.

  Also, you don't synchronize on '_data'... Your implementation of
  'onPreviewFrame' is filling '_data' and your background thread is
  reading it. The filling(=arraycopy) of '_data' may not be finished
  before your it's being read by your background thread.

  On Dec 5, 9:41 pm, Greg madma...@gmail.com wrote:

   Hello,
   I've been working on creating a program that will output the Camera
   Preview with various user-chosen filters (SnapPhoto has this
   functionality) and I've run into some problems.

   I have the following set up.
   - Camera preview set to a SurfaceView (I had to set PUSH_BUFFERS or
   the program fails).
   - Have another SurfaceView lieing over the Camera preview SurfaceView
   (in a FrameLayout)
   - Registered a camera callback for the preview data

   My problem is that the output is extremely choppy and the program
   quickly becomes unresponsive. I've set up a thread to do the
   processing, but this doesn't seem to help. I've implemented the
   decoding (into rgb_) algorithm (courtesy of 
   dmanpearlhttp://groups.google.com/group/android-developers/msg/d3b29d3ddc8abf9b
   ) Is there anything I'm doing blatantly wrong or something I could fix
   to make this program run at a decent speed? Sorry if the code has poor
   style, I'm sort of an Android beginner and, for that matter, Java
   beginner.

   This code is inside the second SurfaceView, lieing over the Camera
   preview SurfaceView

   public void onPreviewFrame(byte[] data, Camera camera) {
                   if(hasSurface) {
                                   System.arraycopy(data, 0, _data, 0, 
   data.length);
                                   outputThread = new HandleOutput();
                                   outputThread.start();
                   }
           }

   where HandleOutput() extends Thread, and _data is a global array.

   and this is inside the Thread

   public void run() {
                           while(!done) {
                                   canvas = mHolder.lockCanvas();
                                   PixelManip.decodeYUV(rgb, _data, width, 
   height); //courtesy of
   dmanpearl (link above)
                                   PixelManip.applyFilter(filterID, _data, 
   rgb);
                                   bitmap.setPixels(rgb, 0, width, 0, 0, 
   width, height);
                                   canvas.drawBitmap(bitmap, 0, 0, paint);
                                   mHolder.unlockCanvasAndPost(canvas);
                                   done = true;
                           }
                   }

   Thanks,
   Greg

   P.S. Let me know if I should post any more code.- Hide quoted text -

 - Show quoted text -

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


[android-developers] How to know the encoding of an SMS

2009-12-08 Thread Carl
Hi,

I am writing an SMS application that processes SMSs according to the
encoding type.
Is there anyway to know, without needing to parse the PDU, if the
message is 7-bit encoded or using UCS-2 encoding?

Thank you.

Carl

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

2009-12-08 Thread bins
package citySlikkerV1.parsers;


public abstract class BaseClass
{
protected String[] mElements;
protected boolean[] mElementsState;

protected abstract void assignElementState( int ID, boolean state );
protected abstract int getElementCount();
protected abstract void setValues(int ID, String data);
}


public class KeyData extends BaseClass{


   //Key Owner List
public KeyData()
{
super( );
mElements = new String[]
{


};

mElementsState = new boolean[]
{


};
}

@Override
protected void assignElementState(int ID, boolean state)
{
// TODO Auto-generated method stub
if(state  ID == 0)
{
}



mElementsState[ID] = state;
}



@Override
protected  int getElementCount()
{
return this.mElements.length;
}

@Override
protected void setValues(int ID, String data)
{
// TODO Auto-generated method stub
switch( ID )
{
case 0://BUILDINFO
break;
case 1://BUILDID
 BUILDID=Integer.valueOf(data);
Log.e(switch,+BUILDID);
break;
case 2://BUILDNAME
 BUILDNAME=data;
Log.e(switch,+BUILDNAME);
 break;
case 3://REVNUE
REVNUE=Float.valueOf(data);
break;
case 4://STATE
STATE=Integer.valueOf(data);
break;

//key owner infomartion
case 5://UserId
UserId=Integer.valueOf(data);
break;
case 6://UserName
UserName=data;
 break;
case 7://RCode
UserRCode=Integer.valueOf(data);
break;
case 8://UserStatus

UserStatus=Integer.valueOf(data);
break;




default:
break;
}
}
public class CommonHandler extends DefaultHandler
{
// 
// Methods
// 

boolean CCODE = false;
boolean SCCODE = false;
boolean EVENTS = false;
int ccode = 0;
int sccode = 0;
int Elementlength  =0;
BaseClass temp = null;
BaseClass event=null;


public Activity activity;


public void startDocument() throws SAXException
{

}


public void endDocument() throws SAXException
{
temp = null;
}

/** Gets be called on opening tags like:
 * tag
 * Can provide attribute(s), when xml was like:
 * tag attribute=attributeValue*/

public void startElement(String namespaceURI, String localName,
  String qName, Attributes atts) throws SAXException
{

if(localName.equals(CC))
{

CCODE = true;
}

if( localName.equals(SC))
{
SCCODE = true;
}

if( localName.equals(EVS))
{
EVENTS=true;
}

if( event != null )
{
for( int i = 0; i  Elementlength; i++ )
{
if(localName.equals(event.mElements[i]))
{
event.assignElementState(i, true);
}
}
}

   if( temp != null )
   {
for( int i = 0; i  Elementlength; i++ )
{
if(localName.equals(temp.mElements[i]))
{

[android-developers] Re: Android Parser

2009-12-08 Thread bins
package citySlikkersV1.HttpClass;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;

import citySlikkersV1.ComManager.ComManager;
import android.app.Activity;
import android.util.Log;

public class HTTP_Request extends Activity {

private String url;
private UrlEncodedFormEntity mEntity;
private String response;

public HTTP_Request() {
this.url = null;
this.mEntity = null;
this.response = null;
}

public void go(String url,UrlEncodedFormEntity sendEntity){


InputStream inStream = null;


 try {
HttpPost  postMethod = new HttpPost (url);
HttpClient client = new DefaultHttpClient();
postMethod.setEntity(sendEntity);

final HttpParams params = client.getParams();
HttpConnectionParams.setConnectionTimeout(params, 6000);

HttpResponse httpResponse = client.execute(postMethod);
HttpEntity resEntity = httpResponse.getEntity();
inStream = resEntity.getContent();

ByteArrayOutputStream byteArrayOutputStream = new
ByteArrayOutputStream();
int byteCount = -1;
byte[] byteBuff = new byte[8196];
while ((byteCount = inStream.read(byteBuff, 0,
byteBuff.length)) != -1) {
byteArrayOutputStream.write(byteBuff, 0,
byteCount);
}

response = byteArrayOutputStream.toString();
 } catch (Exception e) {

response = errorError unzipping zipped content./
errro;
} finally {
try{
if (inStream != null) inStream.close();
if(inStream==null){
ComManager.getInstance
().UserPositionUpdates();

}
// very important
} catch (Exception e) {
/* Do nothing with this error */ }
}
}

public String getResponse() {

return this.response;

}

}

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

2009-12-08 Thread bins
package citySlikkersV1.ResponseHandler;


import java.io.StringReader;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import android.util.Log;
import citySlikkerV1.parsers.CommonHandler;

public class ResponseHandler
{


public void HandleResponse(String response)
{

 try{
 Log.e(Respone String,+response);
  //MyMap.J1=MyMap.i1+1;
  SAXParserFactory spf = SAXParserFactory.newInstance();
  SAXParser sp;
  sp = spf.newSAXParser();
  XMLReader xr = sp.getXMLReader();
  CommonHandler commHandler = new CommonHandler();
  xr.setContentHandler(commHandler);
  xr.parse(new InputSource( new StringReader( response 
) ) );

  }catch(Exception e){}
}



}

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

2009-12-08 Thread bins
package citySlikkersV1.RequestHandler;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;

import citySlikkerV1.UserInterface.GlobalData;

public class ItemExecutionHandler {


   private String response;

public ItemExecutionHandler()
{
this.response=null;
}

public String getURL()
{
String URLString  = ;
return URLString;
}


public UrlEncodedFormEntity ItemExectionString(int subcode,int
OtherUserid,int ItemId,int Boxid)
{

 UrlEncodedFormEntity entity1 = null ;

try {
ArrayListBasicNameValuePair pairs =new
ArrayListBasicNameValuePair();
pairs.add(new BasicNameValuePair(CCODE,7));
pairs.add(new BasicNameValuePair(SUBCODE,+subcode));
pairs.add(new BasicNameValuePair
(UID,+GlobalData.UserId));
pairs.add(new BasicNameValuePair(OID,+OtherUserid));
pairs.add(new BasicNameValuePair(ITEMID,+ItemId));

pairs.add(new BasicNameValuePair(BOXID,+Boxid));

entity1 = new UrlEncodedFormEntity(pairs, HTTP.UTF_8);

} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return entity1;

}



public void setResponse(String res)
{
this.response = res;
}

}

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

2009-12-08 Thread bins
package citySlikkersV1.DataStructure;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Vector;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;

public class MyStuffItems {

Bitmap mImage=null;

VectorMyItems mMyInventory=new VectorMyItems();
VectorMyKeys mMyKeyInventory=new VectorMyKeys();
VectorMyBuildings mMyBuildings=new VectorMyBuildings();
String mDescription=null;

public void SetMyInventory(int mId,String mName,int mBcount,int
mstrength,int mRange,int mlevel,int isenabled)
{
MyItems myItems =new MyItems();
myItems.mItemId=mId;
myItems.mItemName=mName;
myItems.mBulletcount=mBcount;
myItems.mItemlevel=mlevel;
myItems.mItemRange=mRange;
myItems.mItemStrength=mstrength;
myItems.isEnabled=isenabled;
myItems.mItemImage=mImage;

mMyInventory.add(myItems);
}

public VectorMyItems GetMyItems()
{
return mMyInventory;
}


public void downloadFile(String fileUrl)
{

URL myFileUrl =null;
 try {
  myFileUrl= new URL(fileUrl+.jpg);
 } catch (MalformedURLException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }
 try {
  HttpURLConnection conn= (HttpURLConnection)
myFileUrl.openConnection();
  conn.setDoInput(true);
  conn.connect();
// int length = conn.getContentLength();
  InputStream is = conn.getInputStream();

  mImage= BitmapFactory.decodeStream(is);
  } catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }
}

public void clear()
{
mMyInventory.clear();
mMyKeyInventory.clear();
mMyBuildings.clear();
Log.e(Clear data source,Mystuff items);
}

public class MyItems
{
public int mItemId=0;
public String mItemName=null;
public int mBulletcount=0;
public int mItemStrength=0;
public int mItemRange=0;
public int mItemlevel=0;
public int isEnabled=0;
public Bitmap mItemImage=null;
}

/*ItemDescription*/
public void SetItemDescription(String des)
{
mDescription=des;
}

public String getDescription()
{
return this.mDescription;
}


/* My key Data*/
public void SetMyKeys(int id,int number,int type)
{
Log.e(setkeys, ID +id);
MyKeys myKeys=new MyKeys();
myKeys.mKeyID=id;
myKeys.mKeynumber=number;
myKeys.mKeyType=type;

mMyKeyInventory.add(myKeys);
}

public VectorMyKeys GetMyKeys()
{
return mMyKeyInventory;
}



/* My Building Info Data*/
public void SetMyBuildingss(int id,int type,int SecureLevel,int
Tower,int Camera)
{
Log.e(MyBuildings, ID +id);
MyBuildings mybuilding=new MyBuildings();

mybuilding.mBuildId=id;
mybuilding.mBuildType=type;
mybuilding.mSecureLevel=SecureLevel;
mybuilding.mTower=Tower;
mybuilding.mCamera=Camera;

mMyBuildings.add(mybuilding);
}

public VectorMyBuildings GetMyBuildings()
{
return mMyBuildings;
}



public class MyKeys
{
public int mKeyID=0;
public int mKeynumber=0;
public int mKeyType=0;
}

public class MyBuildings
{
public int mBuildId=0;
public int mBuildType=0;
public int mSecureLevel=0;
public int mTower=0;
public int mCamera=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] Publish App

2009-12-08 Thread stanlick
I just published my first application to the market and the Just in
display show my icon and app name, but under the appname is shows my
birth certificate name!  How can I change this?  Is it something I am
missing in my manifest?  I'm sure my mom would it; but me -- not so
much.

Peace,
Scott

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

2009-12-08 Thread justinh
I'm pretty sure that has to do with the Developer Console settings,
not your app. When you signed up I think their was a field that said
This is your publishing name ?

On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:
 I just published my first application to the market and the Just in
 display show my icon and app name, but under the appname is shows my
 birth certificate name!  How can I change this?  Is it something I am
 missing in my manifest?  I'm sure my mom would it; but me -- not so
 much.

 Peace,
 Scott

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

2009-12-08 Thread stanlick
u rock bro!  I just found it.  Any idea why I'm getting a server error
when I try to purchase the app on my phone?

Peace,
Scott

On Dec 8, 9:59 am, justinh henderson.jus...@gmail.com wrote:
 I'm pretty sure that has to do with the Developer Console settings,
 not your app. When you signed up I think their was a field that said
 This is your publishing name ?

 On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:

  I just published my first application to the market and the Just in
  display show my icon and app name, but under the appname is shows my
  birth certificate name!  How can I change this?  Is it something I am
  missing in my manifest?  I'm sure my mom would it; but me -- not so
  much.

  Peace,
  Scott



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

2009-12-08 Thread justinh
If your phone uses the same Google account as your developer account,
they purposefully disallow you from downloading your own app. (and
giving it 5 stars :) )

On Dec 8, 11:02 am, stanlick stanl...@gmail.com wrote:
 u rock bro!  I just found it.  Any idea why I'm getting a server error
 when I try to purchase the app on my phone?

 Peace,
 Scott

 On Dec 8, 9:59 am, justinh henderson.jus...@gmail.com wrote:

  I'm pretty sure that has to do with the Developer Console settings,
  not your app. When you signed up I think their was a field that said
  This is your publishing name ?

  On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:

   I just published my first application to the market and the Just in
   display show my icon and app name, but under the appname is shows my
   birth certificate name!  How can I change this?  Is it something I am
   missing in my manifest?  I'm sure my mom would it; but me -- not so
   much.

   Peace,
   Scott

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

2009-12-08 Thread stanlick
Ahh, I see!  I was just trying to make sure it worked and I could
install it through the store.  So, realizing the Google accounts are
the same on my phone and dev acct, is the USB cable the only way I can
install/upgrade the app on my phone?

Peace,
Scott

On Dec 8, 10:08 am, justinh henderson.jus...@gmail.com wrote:
 If your phone uses the same Google account as your developer account,
 they purposefully disallow you from downloading your own app. (and
 giving it 5 stars :) )

 On Dec 8, 11:02 am, stanlick stanl...@gmail.com wrote:

  u rock bro!  I just found it.  Any idea why I'm getting a server error
  when I try to purchase the app on my phone?

  Peace,
  Scott

  On Dec 8, 9:59 am, justinh henderson.jus...@gmail.com wrote:

   I'm pretty sure that has to do with the Developer Console settings,
   not your app. When you signed up I think their was a field that said
   This is your publishing name ?

   On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:

I just published my first application to the market and the Just in
display show my icon and app name, but under the appname is shows my
birth certificate name!  How can I change this?  Is it something I am
missing in my manifest?  I'm sure my mom would it; but me -- not so
much.

Peace,
Scott



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

2009-12-08 Thread Brion Emde
I'm not completely clear what you are asking. Yesterday I happened to
find this clarification of addFooterView() (and addHeaderView() ) for
a ListView:

http://www.mail-archive.com/android-developers@googlegroups.com/msg19596.html

The sample program in that message worked very well for me and is just
what I wanted.

On Dec 7, 11:06 pm, Abhi abhishek.r.sha...@gmail.com wrote:
 Hello,

 I have a tab layout with two tabs, the first of which has a listview
 of 5 clickable rows. Below this listview, I need a button. I have been
 able to create the listview but don't know how to create the button to
 the bottom of the display. Please help.

 Also, the listview is created using ArrayAdapter from a Strings array,
 like below

 String[] istrings = new String[] (I, Me, Myself);
 this.setListAdapter (new ArrayAdapterString (this,
 android.R.layout.simple_list_item_1, istrings));

 Looking forward to your help.

 Thanks,

 Sharma

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

2009-12-08 Thread theSmith
Should we just create our own search activity or is there one
available in 1.5?  As far as I know the global search feature is only
1.6+.

When creating our own activity, how would we capture the search key
(hard) being pressed on a device?

-Chris

On Dec 7, 6:25 pm, Dianne Hackborn hack...@android.com wrote:
 On Mon, Dec 7, 2009 at 1:20 PM, AJ adam.j...@gmail.com wrote:
  1) drawable verses the new drawable-* ... if I don't have an icon in
  drawable.png will my application be icon-less in 1.5? Do I need to
  copy one of the new icons in there? If so, which one?

 If you want to run on pre-1.6 platforms, I would suggest putting your medium
 density bitmaps in drawable/* instead of drawable-mdpi/*.  1.6 and later
 will assume that these are medium density.

  2) search ... how does the SEARCH activity get raised for an
  application on SDK 1.5 devices (which don't appear to have a hardware
  search button.) Do I need to add a menu option and raise SEARCH as a
  sub-activity? [Note: I am 100% confused by search button on all
  android versions 'cos what I read says SDK 2.0 copes with virtual
  buttons, yet those devices (in emulator) seem to have hardware ones.
  What am I missing?]

 Whether or not there is a search button is really a device thing, and not a
 platform version thing.  For example, the G1 has a search key on its hard
 keyboard, and you can assume there will be devices running 2.0 and later
 that don't have a search key.  If search is important for your app, you will
 want to have another mechanism to get to it -- often a menu item.

 --
 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] Make SectionIndexer pick up new dataset

2009-12-08 Thread Lee
Hello,

I have an extended BaseAdapter that implements SectionIndexer. I build
my own index data whenever the dataset changes.

It works fine, but when the data set changes, the grid keeps using the
same SectionIndexer data even after a manual update of the section
data in my adapter and an adapter.notifyDataSetChanged(), and even if
I make a new adapter and call grid.setAdapter( newAdapter ).

Anyone know how I can make the grid pick up the new section data ?

If I call use:

grid.setFastScrollEnabled( false );
adapter.notifyDataSetChanged();
grid.setFastScrollEnabled( true );

it works, but then, when I use the thumb control, the index position
appears almost invisible in the top left corner of the grid!

Thanks for any suggestion to fix either of these,

Lee

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

2009-12-08 Thread Maps.Huge.Info (Maps API Guru)
You can always upload it somewhere on the web and download it to your
device that way. You'll need to allow unknown source under menu-
settings-applications in order to download it from a non-market
location though.

-John Coryat

Radar Now!

What Zip Code?

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


[android-developers] Re: Publish App

2009-12-08 Thread stanlick
Thanks brother!  Yeah, I've had my beta testers downloading it from my
web site, but it doesn't handle version upgrade notifications.

Peace,
Scott

On Dec 8, 10:27 am, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 You can always upload it somewhere on the web and download it to your
 device that way. You'll need to allow unknown source under menu-
 settings-applications in order to download it from a non-market
 location though.

 -John Coryat

 Radar Now!

 What Zip Code?

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


Re: [android-developers] Re: Publish App

2009-12-08 Thread Wayne Wenthin
I wrote a batch file that does this for me.   I export as xxx-unaligned.apk
then the batch deletes my old version uses zipalign on the ualigned,
uninstalls the old aligned version from my phone then reinstalls the new
version.

On Tue, Dec 8, 2009 at 8:12 AM, stanlick stanl...@gmail.com wrote:

 Ahh, I see!  I was just trying to make sure it worked and I could
 install it through the store.  So, realizing the Google accounts are
 the same on my phone and dev acct, is the USB cable the only way I can
 install/upgrade the app on my phone?

 Peace,
 Scott

 On Dec 8, 10:08 am, justinh henderson.jus...@gmail.com wrote:
  If your phone uses the same Google account as your developer account,
  they purposefully disallow you from downloading your own app. (and
  giving it 5 stars :) )
 
  On Dec 8, 11:02 am, stanlick stanl...@gmail.com wrote:
 
   u rock bro!  I just found it.  Any idea why I'm getting a server error
   when I try to purchase the app on my phone?
 
   Peace,
   Scott
 
   On Dec 8, 9:59 am, justinh henderson.jus...@gmail.com wrote:
 
I'm pretty sure that has to do with the Developer Console settings,
not your app. When you signed up I think their was a field that said
This is your publishing name ?
 
On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:
 
 I just published my first application to the market and the Just
 in
 display show my icon and app name, but under the appname is shows
 my
 birth certificate name!  How can I change this?  Is it something I
 am
 missing in my manifest?  I'm sure my mom would it; but me -- not so
 much.
 
 Peace,
 Scott
 
 

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




-- 
Writing code is one of few things
that teaches me I don't know everything.

Join the Closed Beta of Call Girl Manager
http://www.fuligin.com/forums

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

[android-developers] Camera - Icon image resource for 'take picture' button?

2009-12-08 Thread Mark Wyszomierski
Hi,

On the G1 camera app, there's a handsome looking camera button which
you can press to signal the app to take the picture. It's a round
button with a little camera icon in it. Is that button resource
available in android.R? I'd like to use it in my own app if possible.

Thanks

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


[android-developers] Re: Make SectionIndexer pick up new dataset

2009-12-08 Thread Lee
OK, looking at the cupcake source, seems this is the correct way to
dump the data:

grid.setFastScrollEnabled( false );

So my problem is: why is the index indicator (the transparent thing
supposed to be in the middle
showing the section) in the top left corner nearly invisible after
this:

grid.setFastScrollEnabled( true );

Lee

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

2009-12-08 Thread Thomas
 The user can still manually edit the box change the value.

Yes but if he/she just enters a new value and taps on OK - is the new
value passed to onDateSet() in the Hello, DatePicker demo?

Regards
Thomas

On 7 Dez., 21:16, dan raaka danra...@gmail.com wrote:
 The user can still manually edit the box change the value.
 -Dan



 On Mon, Dec 7, 2009 at 12:03 PM, Thomas kuenne...@googlemail.com wrote:
  Hello.

  Thank you very much for verifying this.

  Still, I cannot see why Samsung would want to prevent someone from
  selecting years prior to 2000?

  I have not read of any limitations in the DatePicker /
  DatePickerDialog docs from Google. Why would anyone alter the
  behaviour of a gui component?

  Can anybody shed some light on this? Perhaps some kind folks from
  Google, please??

  Regards
  Thomas

  On 7 Dez., 18:43, dan raaka danra...@gmail.com wrote:
   yes that is correct.
   -Dan

   On Sun, Dec 6, 2009 at 1:05 AM, Thomas kuenne...@googlemail.com wrote:
My app (TKBirthdayreminder) is heavily relying on DatePicker and
DatePickerDialog. A few users have reported problems while entering
the birthday date, specifically years prior to 2000. I was told by one
user that on a Samsung Moment hitting the minus button below the year
field will lead to 2002 - 2001 - 2000 - 2099. Can a Samsung Moment
owner please verify this assumption?

The DevGuide contains a small sample app:

 http://developer.android.com/guide/tutorials/views/hello-datepicker.html

Thank you very much.

Regards
Thomas

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

2009-12-08 Thread tikky
Hi,
I have a a simple activity with  a list view. Each element of the list
view contains a photo, text view and a button. I have an
onClickListener() implemented for the button.
When I touch the button, onClickListener gets called, which is what I
want. But when I use the D-PAD, and press down key, the entire list
item gets focus, so the center-select key takes no effect. I need the
focus to go only to the button instead of the entire list element, so
that when center key is pressed, it will do the same action as in the
touch mode.

How can I achieve this?
I have tried calling requestFocus() on the button, but still it does
not work.

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

2009-12-08 Thread Vijay
This error is from com.google.android.location.ConfirmAlertActivity.
Its not open source I believe. I use Donut.

Thanks.

On Dec 8, 4:42 am, Dexter#39;s Brain coomar@gmail.com wrote:
 Hi,

 There is an error in your XML file, at line no 54. Check it out. Or
 paste that part of your xml. Also, mention the API version you are
 using.

 Thanks,
 Kumar Bibekhttp://tech-droid.blogspot.com

 On Dec 8, 1:43 am, Vijay vijay.meenakshisunda...@gmail.com wrote:

  I get a ResourceNotFoundException from
  com.google.android.location.ConfirmAlertActivity. But I'm sure
  secondary_text_dark.xml is in my base/core/res/res/color. Does anyone
  know the reason?

  Here is my log:

  E/AndroidRuntime( 5629): Uncaught handler: thread
  android.server.ServerThread exiting due to uncaught exception
  E/AndroidRuntime( 5629): *** EXCEPTION IN SYSTEM PROCESS.  System will
  crash.
  E/AndroidRuntime( 5629): java.lang.RuntimeException: Unable to start
  activity ComponentInfo{com.google.android.location/
  com.google.android.location.ConfirmAlertActivity}:
  android.view.InflateException: Binary XML file line #54: Error
  inflating class java.lang.reflect.Constructor
  E/AndroidRuntime( 5629):        at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2401)
  E/AndroidRuntime( 5629):        at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
  2417)
  E/AndroidRuntime( 5629):        at android.app.ActivityThread.access$2100
  (ActivityThread.java:116)
  E/AndroidRuntime( 5629):        at 
  android.app.ActivityThread$H.handleMessage
  (ActivityThread.java:1794)
  E/AndroidRuntime( 5629):        at android.os.Handler.dispatchMessage
  (Handler.java:99)
  E/AndroidRuntime( 5629):        at android.os.Looper.loop(Looper.java:123)
  E/AndroidRuntime( 5629):        at com.android.server.ServerThread.run
  (SystemServer.java:411)
  E/AndroidRuntime( 5629): Caused by: android.view.InflateException:
  Binary XML file line #54: Error inflating class
  java.lang.reflect.Constructor
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.createView
  (LayoutInflater.java:512)
  E/AndroidRuntime( 5629):        at
  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
  (LayoutInflater.java:617)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
  (LayoutInflater.java:620)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.rInflate
  (LayoutInflater.java:620)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
  (LayoutInflater.java:407)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
  (LayoutInflater.java:320)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.inflate
  (LayoutInflater.java:276)
  E/AndroidRuntime( 5629):        at
  com.android.internal.policy.impl.PhoneWindow.setContentView
  (PhoneWindow.java:334)
  E/AndroidRuntime( 5629):        at
  com.android.internal.app.AlertController.installContent
  (AlertController.java:204)
  E/AndroidRuntime( 5629):        at
  com.android.internal.app.AlertActivity.setupAlert(AlertActivity.java:
  74)
  E/AndroidRuntime( 5629):        at
  com.google.android.location.ConfirmAlertActivity.onCreate
  (ConfirmAlertActivity.java:50)
  E/AndroidRuntime( 5629):        at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
  1123)
  E/AndroidRuntime( 5629):        at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2364)
  E/AndroidRuntime( 5629):        ... 6 more
  E/AndroidRuntime( 5629): Caused by:
  java.lang.reflect.InvocationTargetException
  E/AndroidRuntime( 5629):        at
  com.android.internal.widget.DialogTitle.init(DialogTitle.java:38)
  E/AndroidRuntime( 5629):        at
  java.lang.reflect.Constructor.constructNative(Native Method)
  E/AndroidRuntime( 5629):        at java.lang.reflect.Constructor.newInstance
  (Constructor.java:446)
  E/AndroidRuntime( 5629):        at android.view.LayoutInflater.createView
  (LayoutInflater.java:499)
  E/AndroidRuntime( 5629):        ... 19 more
  E/AndroidRuntime( 5629): Caused by: android.content.res.Resources
  $NotFoundException: File res/color/secondary_text_dark.xml from color
  state list resource ID #0x0
  E/AndroidRuntime( 5629):        at
  android.content.res.Resources.loadColorStateList(Resources.java:1873)
  E/AndroidRuntime( 5629):        at
  android.content.res.TypedArray.getColorStateList(TypedArray.java:303)
  E/AndroidRuntime( 5629):        at android.widget.TextView.init
  (TextView.java:380)
  E/AndroidRuntime( 5629):        at android.widget.TextView.init
  (TextView.java:320)
  E/AndroidRuntime( 5629):        ... 23 more
  E/AndroidRuntime( 5629): Caused by: android.content.res.Resources
  $NotFoundException: File res/color/secondary_text_dark.xml from xml
  type colorstatelist resource ID #0x0
  E/AndroidRuntime( 5629):        at
 

[android-developers] Eclipse Debug only my Classes

2009-12-08 Thread Jose Gomez
When I am debugging my code and stepping through the code elipse keeps going
on this darn tangents into the android classes which I don't care about. It
makes it very difficult to debug. Anyway I can force it to use only my code
and just go through the android stuff silently?

Its specially annoying on exceptions cause they get thrown in a class I have
no idea where ti got called.

Any help is appreciat3ed!
Sincerely
Jose C Gomez

http://www.josecgomez.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: Publish App

2009-12-08 Thread stanlick
care 2 share?

On Dec 8, 10:35 am, Wayne Wenthin wa...@fuligin.com wrote:
 I wrote a batch file that does this for me.   I export as xxx-unaligned.apk
 then the batch deletes my old version uses zipalign on the ualigned,
 uninstalls the old aligned version from my phone then reinstalls the new
 version.



 On Tue, Dec 8, 2009 at 8:12 AM, stanlick stanl...@gmail.com wrote:
  Ahh, I see!  I was just trying to make sure it worked and I could
  install it through the store.  So, realizing the Google accounts are
  the same on my phone and dev acct, is the USB cable the only way I can
  install/upgrade the app on my phone?

  Peace,
  Scott

  On Dec 8, 10:08 am, justinh henderson.jus...@gmail.com wrote:
   If your phone uses the same Google account as your developer account,
   they purposefully disallow you from downloading your own app. (and
   giving it 5 stars :) )

   On Dec 8, 11:02 am, stanlick stanl...@gmail.com wrote:

u rock bro!  I just found it.  Any idea why I'm getting a server error
when I try to purchase the app on my phone?

Peace,
Scott

On Dec 8, 9:59 am, justinh henderson.jus...@gmail.com wrote:

 I'm pretty sure that has to do with the Developer Console settings,
 not your app. When you signed up I think their was a field that said
 This is your publishing name ?

 On Dec 8, 10:53 am, stanlick stanl...@gmail.com wrote:

  I just published my first application to the market and the Just
  in
  display show my icon and app name, but under the appname is shows
  my
  birth certificate name!  How can I change this?  Is it something I
  am
  missing in my manifest?  I'm sure my mom would it; but me -- not so
  much.

  Peace,
  Scott

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

 --
 Writing code is one of few things
 that teaches me I don't know everything.

 Join the Closed Beta of Call Girl Managerhttp://www.fuligin.com/forums

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

2009-12-08 Thread Lee
Problem worked-around. If I change the height of the grid by 1 pixel
after the data set changes, the
SectionIndexer draws in the correct place too.

Sure there's a more elegant way :-)

Lee

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

2009-12-08 Thread Dianne Hackborn
Android since 1.0 has included a search API that could bring up an
app-specific search activity while within that app.  1.5 introduced global
search that apps could participate in outside of their app.  I don't
understand what you mean by a search activity available in 1.5 -- there is
global search, where you supply results but not the UI, which is available
starting in 1.6; and there is the traditional local app search, where the
app supplies the UI, so there can be no standard activity for that, since
it is entirely app-specific.

You don't need to capture the search key.  Use the search APIs to declare
your search activity in your manifest and let the system do the right thing.

On Tue, Dec 8, 2009 at 8:20 AM, theSmith chris.smith...@gmail.com wrote:

 Should we just create our own search activity or is there one
 available in 1.5?  As far as I know the global search feature is only
 1.6+.

 When creating our own activity, how would we capture the search key
 (hard) being pressed on a device?

 -Chris

 On Dec 7, 6:25 pm, Dianne Hackborn hack...@android.com wrote:
  On Mon, Dec 7, 2009 at 1:20 PM, AJ adam.j...@gmail.com wrote:
   1) drawable verses the new drawable-* ... if I don't have an icon in
   drawable.png will my application be icon-less in 1.5? Do I need to
   copy one of the new icons in there? If so, which one?
 
  If you want to run on pre-1.6 platforms, I would suggest putting your
 medium
  density bitmaps in drawable/* instead of drawable-mdpi/*.  1.6 and later
  will assume that these are medium density.
 
   2) search ... how does the SEARCH activity get raised for an
   application on SDK 1.5 devices (which don't appear to have a hardware
   search button.) Do I need to add a menu option and raise SEARCH as a
   sub-activity? [Note: I am 100% confused by search button on all
   android versions 'cos what I read says SDK 2.0 copes with virtual
   buttons, yet those devices (in emulator) seem to have hardware ones.
   What am I missing?]
 
  Whether or not there is a search button is really a device thing, and not
 a
  platform version thing.  For example, the G1 has a search key on its hard
  keyboard, and you can assume there will be devices running 2.0 and later
  that don't have a search key.  If search is important for your app, you
 will
  want to have another mechanism to get to it -- often a menu item.
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.

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




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

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

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

[android-developers] Re: SDK version problem

2009-12-08 Thread Tatyana Ulyanova
Hello!

I think you should set in AndroidManifest.xml (in Uses SDK attribute)
following options:
   Min SDK verion to 3 (it's corresponded to 1.5 SDK)
   Target SDK version to 3,4 or 5 (it is the best SDK for your
application)
   Max SDK version to 5 (it's currently the last Android 2.0 SDK, but
be careful with new 2.0 functionality )


Try this, I hope this helps you :)

Tatyana :)

On 8 Грд, 16:28, Lieuwe lieuwe.elger...@gmail.com wrote:
 Hi,

 I have this strange problem here. I am fairly new to Android
 development and I was just playing around putting a few bits and
 pieces from several samples together.

 I created (in Eclipse) an Android 1.5 project (thats sdk version 3
 right?) .. now it creates the apk file no problem, Eclipse doesn't
 indicate any problems either, but when I run this through my Android
 1.5 AVD I get an error message stating

 ERROR: Application requires API version 4. Device API version is 3
 (Android 1.5).
 Launch canceled!

 so how come it is quite capable of linking against the 1.5 library
 without errors, but it won't execute it in the AVD ... and more
 important - how do I found out which bit of code I apparently use is
 from API version 4??

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


  1   2   >