[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread hackbod

The green phone key is for use by the foreground application.

On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
 It shouldnt be stolen but it should be overridable.
 Much like the app picker behaves when multiple apps are registered for an
 Intent.

 I dont know how the internals of how the off hook button works but couldnt
 it broadcast an Intent to go off hook which then can be handled like any
 other intent. To avoid the annoying situation of having to choose an app
 every time a changeable default could be setup.
 (Like how RingDroid replaces the default ringtone picker)

 On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:

  Correct, you can't steal it from other apps.  When your apps is in the
  foreground, however, you will see the key as a normal key event that
  you can process however you want.

  On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
   I don't think you would be allowed to remap the phone button that would
  force people to use your app even if they didn't want to and my be
  considered malacious. That's just an opinion though

   -Original Message-
   From: [EMAIL PROTECTED] [EMAIL PROTECTED]

   Date: Mon, 3 Nov 2008 13:09:53
   To: Android Developersandroid-developers@googlegroups.com
   Subject: [android-developers] hooking to the PHONE button

   Hi,

   How can I make my own application run whenever the user presses the
   green PHONE button ?

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



[android-developers] Re: Simple Level App

2008-11-04 Thread Steve Oldmeadow

All you have to do is reverse the rotation e.g rotate by -rotateMe
after you have drawn the rotated image and then all subsequent draws
will be non rotated.



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



[android-developers] Re: camera events

2008-11-04 Thread hackbod

Sorry, you can't intercept what other applications are doing like
this.

On Nov 3, 8:58 pm, spackest [EMAIL PROTECTED] wrote:
 I run a free hosting web site which has functionality for emailing
 photos to your site and having them show up on the web.  I would like
 to write an android app that allows a user to authenticate to their
 free website, then I would like to receive an event each time a photo
 is saved.  I am hoping that I would then have enough information to
 then access the photo and send it off to the user's site.

 Just wondering how I can register to receive camera capture events,
 and then get to the recently captured images.

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



[android-developers] Re: Executing a different android application through intents.

2008-11-04 Thread friedger

Hi,

there is a list of publicly known intents at 
http://www.openintents.org/en/intentstable

If your app should provide an intent to other apps you have to define
the intent-filter in your manifest.

Feel free to add yours to the above mentioned list.


Friedger

On 4 Nov., 07:40, sush [EMAIL PROTECTED] wrote:
 Hello,

 I am working in intents specifically,I found that there are intent
 Actions such as DIAL, CALL, ANSWER etcwhich can be accessed by any
 Android Application whenever required. Similar type of Actions I want
 to create,  which I can access from a different project just passing
 the Action Name, say for Example for a MediaPlayer Application the
 customized Actions should be  ACTION_SelectSong, ACTION_Play,
 ACTION_Stop etc rather then using Android APIs directly.

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



[android-developers] Question about View, Canvas, and Drawable.. --Basics

2008-11-04 Thread joshbeck

Hello all,

Is this correct?

View: The android screen is divided up into views. Views are basic
layout objects.

Canvas: You need to have at least one canvas if you want to do any
drawing. Each
view potentially has its own canvas.

Drawable: ---)This is where my 10:30 bedtime turns into a 2:30 am nap
in the chair before work.)
 -What is the difference between a Bitmap and a Drawable?
Can Drawables only be used with ImageView Views?


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



[android-developers] Re: Tabs at bottom of screen

2008-11-04 Thread [EMAIL PROTECTED]


Hi,

If you find solution of this problem please email me.


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



[android-developers] more problems with opengl in the new sdk

2008-11-04 Thread petunio

Hi people

I am trying to migrate an opengl sample that it used to work under the
old (3) version of the sdk, and so far, I am not having much
success...

this is my function for setting up the opengl environment:

boolean initOpenGL()
{
egl = (EGL10) EGLContext.getEGL();

display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

int[] majorMinor = new int[2];

egl.eglInitialize(display, majorMinor))

int[] numConfigs = new int[1];

egl.eglGetConfigs(display, null, 0, numConfigs);

int configAttributes[] =
   {
EGL10.EGL_RED_SIZE, 5, EGL10.EGL_GREEN_SIZE, 6,
EGL10.EGL_BLUE_SIZE, 5,
EGL10.EGL_ALPHA_SIZE, 0,
EGL10.EGL_DEPTH_SIZE, 16,
// EGL11.EGL_STENCIL_SIZE, EGL11.EGL_DONT_CARE,   // don't
care about stencils
EGL10.EGL_SURFACE_TYPE, EGL10.EGL_WINDOW_BIT,
EGL10.EGL_NONE
};

EGLConfig eglConfigs[] = new EGLConfig[numConfigs[0]];

egl.eglChooseConfig(display, configAttributes, eglConfigs,
eglConfigs.length, numConfigs);

EGLConfig eglConfig = eglConfigs[0];

glc = egl.eglCreateContext(display, eglConfig,
EGL10.EGL_NO_CONTEXT, null);

gl = (GL10) (glc.getGL());

surface = egl.eglCreateWindowSurface(display, eglConfig, mHolder,
null);

egl.eglMakeCurrent(display, surface, surface, glc);
}


The program crashes when calls eglCreateWindowSurface()
The only thing I am not sure about in this function, is the parameter
mHolder, which I got it like this:


class myView extends SurfaceView implements SurfaceHolder.Callback
{

SurfaceHolder mHolder;

public myView(Context context, AttributeSet attrs)
   {
super(context, attrs);

mHolder = getHolder();
mHolder.addCallback(this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
   }


}

Also, there are two strange things:
- the override methods
   surfaceCreated, surfaceDestroyed, and surfaceChanged are never
being called
-in the adb logcat I get the following message after calling
eglGetDisplay():
GLLogger couldn't load libhgl.so library (cannot find library)



does anybody have any idea what I am doing wrong?
plase!




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



[android-developers] Re: Sending email

2008-11-04 Thread john

Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
pretty absent minded at times.

On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:
 I'm assuming you meant to say it only works on the phone, not the  
 emulator :)

 On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:



  Unfortunately yes, this only seems to work on the emulator. We had to
  break down and buy a G1 (as well as a two-year plan) so we could
  realistically get our software tested and released. It would be
  interesting, though, to see if you could install the email program on
  the emulator. If you do, you might want to post it to help some people
  out.

  Good luck!

  On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
  John - I'm assuming this only works on the real device and not the
  emulator?

  I'm trying

                          Intent sendIntent = new  
  Intent(Intent.ACTION_SEND);
                          sendIntent.putExtra(Intent.EXTRA_TEXT,  
  email text);
                          sendIntent.putExtra(Intent.EXTRA_SUBJECT,  
  Subject);
                          sendIntent.setType(message/rfc822);

  startActivity(Intent.createChooser(sendIntent, Title:));

  and am getting No Applications can perform this action which is the
  same when you select the email address in the contact list of the
  emulator. Prob because there is not email client in the emulator
  right?

  Justin - Is it possible to have access to the .apk for the mail
  programs that come with the G1 so we can install them on the  
  emulator?

  Thanks

  On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

  Hey, that did it! I set the the mime type to 'message/rfc822' and it
  worked right away. Brings up the default mail application with the
  fields that I specified populated.

  I had been trying to send it with a mime of text/plain and text/
  html.
  I thought that by specifying anEXTRA_EMAILit would fire the right
  broadcast receivers, but I guess the mime type is what counts.

  Thanks again!

  On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

  John,

  Take a look athttp://code.google.com/android/reference/android/
  content/Intent.html,
  there are several e-mail related fields you probably want to set.  
  For a
  mime type try 'message/rfc822' or 'message/rfc2822'. I haven't  
  tried this
  myself, so let me know how it works.

  Cheers,
  Justin
  Android Team @ Google

  Original Message Follows:
  
  From: john [EMAIL PROTECTED]
  Subject: [android-developers] Sending email
  Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

  Hello!

  Thanks in advance for trying to help me out. It doesn't seem like
  anyone has found a solution to this problem yet, so hopefully we  
  can
  figure this out and help a lot of people.

  I'm trying to get my application to send an email, but i can't  
  seem to
  find any solutions. Here's what I'm trying:

  I've got an Intent (called sender in this example) set to
  Intent.ACTION_SEND, with various email extras.

  When I try startActivity(Intent.createChooser(sender, Select send
  method.));
      I get No application can handle this request

  And when I try sendBroadcast(Intent.createChooser(sender, Select  
  send
  method.));
     Nothing happens at all.

  Is there something I need to put in my manifest file, or am I doing
  this completely wrong?

  Any help anyone can offer would be greatly appreciated. Happy  
  coding!

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



[android-developers] Any tool to analyze the memory?

2008-11-04 Thread qvark

Hi,

we are having problems in our application with Out of Memory after
executing several times the same set of activities, so we suspect we
are leaking memory somehow.

All the activities seem to be destroyed correctly, but the DDMS plugin
shows the memory increasing. The problem is we can see the memory
leaking but we don't know where! Do you know any way to generate a
memory dump and analyze it using a more powerful tool than the DDMS?

Thanks,

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



[android-developers] Re: Proper way of handling orientation change + async thread

2008-11-04 Thread zl25drexel

Thanks for your reply, any example codes?

On Nov 3, 8:28 pm, Greg [EMAIL PROTECTED] wrote:
 When you change orientation your Activity is destroyed and then re-
 created.  When you re-create the dialog view object that was sent to
 the background process is no longer valid, thus the error.

 There are probably several ways to handle this but the first that
 comes to my mind is:

 1) The background thread should not be trying to manipulate views
 directly.  Have it send a 'cancel' message to a handler in one of your
 UI classes (like the main activity).  The UI class can then take the
 appropriate action to cancel the dialog.

 2) If orientation can change while you have the dialog up (which it
 can), then you need to save that state when the activity is stopped
 and have your restart handler take care of recreating the dialog and
 displaying it when the activity is restarted (after orientation
 change).

 Your message handler should then take the cancel message from the
 background thread and dismiss the dialog if it exists.

 Hope this helps,

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



[android-developers] Extending ACTION_PICK ?

2008-11-04 Thread Jake Maui
 Is there a way that anyone knows of to extend the view of the image picker?
In particular, I'd like to decorate the image to indicate the the image has
some property.

Thx in advance ...


  private OnClickListener buttonListener = new OnClickListener() {
 public void onClick(View v) {
   Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
   photoPickerIntent.setType(image/*);
   startActivityForResult(photoPickerIntent, PHOTO_SELECT);

 }
  };

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



[android-developers] how to test if the screen is in HVGA-L mode

2008-11-04 Thread Hw3699

How to test if the screen is in HVGA-L mode?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exact Battery level value

2008-11-04 Thread Ian

AnyCut is available in the Market.

But its not AnyCut that is giving you the extra battery info, it is
only providing you with a shortcut to a Android app that displays the
battery info.

So that code must be somewhere in the android code base!

IV

2008/11/4 denismo [EMAIL PROTECTED]:

 Where can I get that AnyCut, preferably with the source code?

 Thanks.

 Denis

 On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:
 By installing AnyCut, I was able to add a shortcut to Battery info.
 This gave me a whole load of info I have not seen via any other menu option!
 (Makes me wonder what other goodies are hidden away!)

 IV

 2008/11/4 denismo [EMAIL PROTECTED]:



  Hi,

  for tuning power consumption of my application I need to be able to
  estimate how much it consumes power in, say, 1 hour. I will then try
  different strategies and experiment with parameters in order to reduce
  power consumption. Is it possible to implement something like this on
  Android?  Is it possible to get exact battery level value as a number?

  Thanks.

  Denis


 


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



[android-developers] Re: Exact Battery level value

2008-11-04 Thread Ian

True.

If its not documented, it must be cool! (joke!)

IV

2008/11/4 Jean-Baptiste Queru [EMAIL PROTECTED]:

 If it's not documented, you shouldn't rely on it.

 JBQ

 On Tue, Nov 4, 2008 at 5:23 AM, denismo [EMAIL PROTECTED] wrote:

 The answer is in Settings/BatteryInfo, thanks to Ian for pointing out
 its existence. ACTION_BATTERY_CHANGED carries various undocumented
 (thanks Google) extras, including level. Not sure what scale means
 though, but it's a good start.

 Denis

 On Nov 5, 12:12 am, denismo [EMAIL PROTECTED] wrote:
 Where can I get that AnyCut, preferably with the source code?

 Thanks.

 Denis

 On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:

  By installing AnyCut, I was able to add a shortcut to Battery info.
  This gave me a whole load of info I have not seen via any other menu 
  option!
  (Makes me wonder what other goodies are hidden away!)

  IV

  2008/11/4 denismo [EMAIL PROTECTED]:

   Hi,

   for tuning power consumption of my application I need to be able to
   estimate how much it consumes power in, say, 1 hour. I will then try
   different strategies and experiment with parameters in order to reduce
   power consumption. Is it possible to implement something like this on
   Android?  Is it possible to get exact battery level value as a number?

   Thanks.

   Denis


 


 


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



[android-developers] Re: OpenGL Basics

2008-11-04 Thread JavaAndroid

Hi Smith,
Thanks a Million for ur response..After going through several
times i m able to understand GLSurfaceView to some extent.but
still some portion of the code remains obscure
Correct me if am wrong.it looks like the animation which we want
to display should be implemented in the form of Renderer classand
that Renderer instance has to be passed to GLThread classGLThread
class takes care of displaying the Animation.

Having Said that, we must purely concentrate on CubeRenderer Class and
Cube class.is that correct???

Thanks in Advance

Thanks
JavaAndroid

On Nov 3, 9:13 pm, DSmith [EMAIL PROTECTED] wrote:
 If you just want to get some animation running quickly, don't worry
 about understanding GLSurfaceView: reuse it as is and concentrate on
 understanding the CubeRenderer class.  You can even reuse most of that
 class, just rewrite the drawFrame method to draw what you want.

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



[android-developers] Re: getCurrentLocation

2008-11-04 Thread Bobbie

The code I am using to get the location is very simple:

LocationManager lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
loc = lm.getLastKnownLocation(lm.getBestProvider(new Criteria(),
true));

When I get the location, it's always a network location.  If I hard
code it and replace lm.getBestProvider(new Criteria(), true) with
gps the application crashes.

Bobbie






On Nov 4, 7:53 am, Mark Murphy [EMAIL PROTECTED] wrote:
 Bobbie wrote:
  I have the latest SDK download and the SDK throws errors when I try to
  use getCurrentLocation, I can only use getLastKnownLocation and
  can only get a network location, can't even get a GPS location
  (which is what I want)...

 It works just fine with GPS.

  What's the deal here?  Was this deprecated or something?

 getCurrentLocation() was removed. My guess is that they didn't want this
 to be a blocking call, waiting for GPS to get a fix.

   I have tried sample code and everything and it throws

  an error before I can even launch the code...?

 You didn't provide us with the error message. You didn't provide us with
 sample source code that raises the error message. As a result, it is
 somewhat difficult to provide concrete assistance.

 Generally speaking, you need to do two things:

 1. Ensure you have the appropriate permissions (e.g.,
 ACCESS_FINE_LOCATION) in your AndroidManifest.xml file.

 2. Ensure somebody is asking your desired location provider for updates,
 otherwise getLastKnownLocation() may be perpetually null.

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

 Android Training on the Ranch! -- Mar 16-20, 
 2009http://www.bignerdranch.com/schedule.shtml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exact Battery level value

2008-11-04 Thread Peli

At least the source code exists:
http://git.source.android.com/?p=platform/packages/apps/Settings.git;a=blob;f=src/com/android/settings/BatteryInfo.java;h=ef60fc35b1f0f80f9bb88cc9d4fc5eaf55e9ef4b;hb=de2d9f5f109265873196f1615e1f3546b114aaa7

:-)

Peli

On Nov 4, 4:24 pm, Ian [EMAIL PROTECTED] wrote:
 True.

 If its not documented, it must be cool! (joke!)

 IV

 2008/11/4 Jean-Baptiste Queru [EMAIL PROTECTED]:



  If it's not documented, you shouldn't rely on it.

  JBQ

  On Tue, Nov 4, 2008 at 5:23 AM, denismo [EMAIL PROTECTED] wrote:

  The answer is in Settings/BatteryInfo, thanks to Ian for pointing out
  its existence. ACTION_BATTERY_CHANGED carries various undocumented
  (thanks Google) extras, including level. Not sure what scale means
  though, but it's a good start.

  Denis

  On Nov 5, 12:12 am, denismo [EMAIL PROTECTED] wrote:
  Where can I get that AnyCut, preferably with the source code?

  Thanks.

  Denis

  On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:

   By installing AnyCut, I was able to add a shortcut to Battery info.
   This gave me a whole load of info I have not seen via any other menu 
   option!
   (Makes me wonder what other goodies are hidden away!)

   IV

   2008/11/4 denismo [EMAIL PROTECTED]:

Hi,

for tuning power consumption of my application I need to be able to
estimate how much it consumes power in, say, 1 hour. I will then try
different strategies and experiment with parameters in order to reduce
power consumption. Is it possible to implement something like this on
Android?  Is it possible to get exact battery level value as a number?

Thanks.

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



[android-developers] Re: My new issue...How can I select a song from playlist available in phone (or) Emulator ...

2008-11-04 Thread yasmin afrose
Hi,

I didn't get any idea. I've added the following line in *PrankActivity.java*


startActivity(new Intent(

com.aspire.android.prankapp.GetSongNameActivity))

above line instead of

startService( ) ;

Then,

I've modified the code within onStart() under PrankService.java

String action = intent.getAction();

String path = E:/yasmin.matharussain/personal/entertain/A.R Hits/;

if(((action!=null)action.equals(com.aspire.android.prankapp.GetSongNameActivity))!(getString(R.id.songname).equals())){

//setContentView(R.layout.splash);

path = path+getString(R.id.songname);

player = new MediaPlayer();

try {

player.setDataSource(path);

} catch (IllegalArgumentException e) {

// *TODO* Auto-generated catch block

e.printStackTrace();

} catch (IllegalStateException e) {

// *TODO* Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

// *TODO* Auto-generated catch block

e.printStackTrace();

}

}else{

player = MediaPlayer.*create*(*this*, R.raw.*airtel*);

}

Then I've created one new file as *GetSongNameActivity.java*

package com.aspire.android.prankapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class GetSongNameActivity extends Activity implements OnClickListener
{
 TextView songname;
 Button proceed;

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

songname = (TextView)this.findViewById(R.id.songname);

proceed = (Button)this.findViewById(R.id.proceed);
proceed.setOnClickListener(this);
}

 public void onClick(View v) {

  if(songname!=null){
Log.i(Song Name :,songname.toString());
startService(new
Intent(com.aspire.android.prankapp.START_AUDIO_SERVICE));
  }else{
   Log.i(Song Name :, songname.toString());
  }

 }


}

Then I've created one more new file as *songname.xml*

?xml version=1.0 encoding=utf-8?

AbsoluteLayout

android:id=@+id/widget30

android:layout_width=fill_parent

android:layout_height=fill_parent

xmlns:android=http://schemas.android.com/apk/res/android;



EditText

android:id=@+id/songname

android:layout_width=188px

android:layout_height=50px

android:textSize=18sp

android:layout_x=128px

android:layout_y=6px



/EditText

Button

android:id=@+id/proceed

android:layout_width=wrap_content

android:layout_height=wrap_content

android:text=Ok

android:layout_x=98px

android:layout_y=92px



/Button

TextView

android:id=@+id/entersong

android:layout_width=wrap_content

android:layout_height=24px

android:text=Enter Song Path:

android:layout_x=6px

android:layout_y=8px



/TextView

/AbsoluteLayout

But,

I can't get the output. User enters Song Name using the layout of *
songname.xml*
But, always the else part is worked ( I've marked that fully  else part as *red
color*).

===


On Tue, Nov 4, 2008 at 3:17 PM, Al Sutton [EMAIL PROTECTED] wrote:


 Patience is a virtue

 What have you tried while you've been waiting?

 Al.

 yasmin afrose wrote:
  Hi,,,
 
  No body is there aa to save me from this issue :(
 
  On Tue, Nov 4, 2008 at 11:44 AM, yasmin afrose [EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] wrote:
 
  Hi All,
 
  Greetings!!!
 
  I've played .mp3 songs using MediaPlayer in Android 1.0.
 
  *My code was*:
 
  1:* PrankActivity.java*
  --
 
  package com.aspire.android.prankapp;
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.KeyEvent;
  public class *PrankActivity* extends Activity {
  /** Called when the activity is first created. */
  @Override
 /* public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  }*/
  public void onCreate(Bundle icicle)
  {
  super.onCreate(icicle);
  Intent i = getIntent();
  String action = i.getAction();
  if (action != null 
  action.equals(com.aspire.android.prankapp.WAKE_UP))
  {
  setContentView(R.layout.splash);
  //We'll need to start the music service here
   startService(new Intent
(com.aspire.android.prankapp.START_AUDIO_SERVICE));
  }
  else
  finish();
  }
  public boolean onKeyDown(int keyCode, KeyEvent event)
  {
  stopService(new Intent(
  com.aspire.android.prankapp.START_AUDIO_SERVICE));
  finish();
  return true;
  }
  }
 
  2 .* PrankSMSReceiver.java*
 
  *
 
  package
 
  

[android-developers] how to detect the Orientation of G1 Screen ?

2008-11-04 Thread Hw3699

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



[android-developers] Re: Tips for Orientation

2008-11-04 Thread Cheryl Sedota

FYI: I have a bug open against Android for not respecting the
activity's request to handle orientation changes itself:

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


On Oct 30, 7:01 am, Mark Hansen [EMAIL PROTECTED] wrote:
 You need to store whatever information determines the state of your
 application, use the following overrides:

 @Override
 public void onSaveInstanceState(Bundle savedInstanceState)
 {
     // example
    savedInstanceState.putString(someKey, someString);

 }

 then on the load:
 @Override
 public void onRestoreInstanceState(Bundle savedInstanceState)
 {
   // example
   String someString = savedInstanceState.getString(someKey);

 }

 A side note to this is there is some wackiness that goes on with the
 first install that I never really got an answer too, if you can figure
 it out let me know.. the post is here:

 http://groups.google.com/group/android-developers/browse_thread/threa...

 Good luck.

 On Oct 30, 6:56 am, Imran [EMAIL PROTECTED] wrote:

  Haii Al...

    The activity gets restarted when the mode changes form  landscape to
  portrait or vice-versa
     is there any way to stop the activity getting restarted. help
  me out guys

     Thanks in advance for any Replays..!!

  Cheers
  Imran

  On Oct 25, 1:21 am, Peli [EMAIL PROTECTED] wrote:

   You could use yet another method: :-)

   Define a textview with id=R.id.text_portrait in yourportraitlayout,
   and in thelandscapelayout as R.id.text_landscape.
   Now, if findViewById(R.id.text_portrait) returns null, you know that
   currently thelandscapelayout is being displayed :-)

   But seriously, I'm surprised that there are so many ways to obtain the
   same information, and I have no idea which would be the preferred
   one...

   Peli

   On Oct 24, 10:00 pm, ksmith44 [EMAIL PROTECTED] wrote:

Right.  I have done that too, and it works great.  The problem is that
aside from using a different layout, my Activity actually needs to do
slightly different logic bassed on the orientation, (it builds its
options menu differently forlandscapethan forportrait), which means
I need to be able to detect which orientation I am using.

Currently, I am using the Configuration method mentioned above and it
does seem to work.  But with so many different classes, methods and
constants available to get theoretically the exact same information, I
wondered if there was a preferred method.

On Oct 24, 12:39 pm, Mark Hansen [EMAIL PROTECTED] wrote:

 Setting this android:screenOrientation=sensor

 as mentioned above worked perfect.. it switched the view as the phone
 changed.

 I then only created alternate XML files for the layouts that needed
 tweaking and it worked like a charm.

 On Oct 24, 2:24 pm, ksmith44 [EMAIL PROTECTED] wrote:

  As a followup, I have now found at least 3 ways do determine the
  orientation, all of which use different constants with different
  values.

  * There is the aforementioned Activity.getRequestedOrientation which
  uses the ActivityInfo constants whereinlandscape=0 andportrait=1
  * Then there is getResources().getConfiguration().orientation which
  uses the Configuration constants whereinlandscape=2 andportrait=1
  * Then there is
  getWindow().getWindowManager().getDefaultDisplay().getOrientation().
  I am not sure what constants this is using, but it returns exactly 
  the
  opposite of the first:landscape=1 andportrait=0

  There are probably more.  Does anyone know the correct or preferred
  method?

  On Oct 23, 12:40 pm, ksmith44 [EMAIL PROTECTED] wrote:

   How can you determine the current orientation?  Most of my pages
   rotate just fine, but I have one page on which I actually need to 
   do
   slightly different logic based on the orientation (specifically, I
   want to add additional menu options inlandscape mode).  When I use
   getRequestedOrientation(), I always get back a -1 (UNSPECIFIED).  
   It
   appears as if this method only works if an orientation has been
   requested by the code using setRequestedOrientation.  Is there a
   better way to determine the current orientation?

   BTW, thanks hackbod for the gem about ctrl-F12.  I never found 
   that in
   the documentation and had been changing the 
   android:screenOrientation
   var in my manifest file and restarting every time I wanted to 
   test in
   the alternate orientation.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Urgent: MapActivity - Couldn't get connection factory client (API key does not work)

2008-11-04 Thread bryan

Eclipse 3.4.1
JDK 1.5.0_16
Android SDK 1-1.0_r1
Mac OS X 10.5


Used keytool -list -keystore ~/.android/debug.keystore to get my
md5.


public class MyMapView extends MapActivity {
private static final int MILLION = 100;
MapView map;
MapController controller;
double lat;
double lon;
GeoPoint myPoint;

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

Intent i = getIntent();
lat = i.getDoubleExtra(latitude, 0);
lon = i.getDoubleExtra(longitude, 0);
int latE6 = (int) (lat * MILLION);
int lonE6 = (int) (lon * MILLION);
myPoint = new GeoPoint(latE6, lonE6);

map = (MapView) findViewById(R.id.mapView);
ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);
zoom.addView(map.getZoomControls());
controller = map.getController();
controller.setZoom(17);
controller.setCenter(myPoint);
}
}



gps_mapview.xml:
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android android:layout_height=fill_parent
android:layout_width=fill_parent android:id=@+id/RelativeLayout01
com.google.android.maps.MapView
android:id=@+id/mapView
android:layout_width=fill_parent
android:layout_height=fill_parent
android:apiKey=07c5fr_xEBx7bK9b7bK9e0Wc07bK9CYr7bK9zQ
android:clickable=true/
LinearLayout android:layout_width=wrap_content
android:layout_height=wrap_content android:id=@+id/zoom
android:layout_alignParentBottom=true
android:layout_centerInParent=true
/LinearLayout
/RelativeLayout


On Nov 3, 11:27 am, Shahbaz Khalid [EMAIL PROTECTED] wrote:
 Hi,

 Very frustrated about this error since we can reproduce this on a number of
 machines.

 The error is self explanatory, googlemaps don't appear at all. This was
 working perfectly (albeit all the IOException warnings) before the API key
 requirement. Moving to another coordinate in googlemaps (Sending gps
 latitude/longitude coordinates through DDMS) doesn't work either (this
 worked before).

 Is there anyone who can post a working sample (with xmls) that works for
 them? Would also appreciate if they can post their platform/eclipse/jdk
 version details.

 Thanks

 On Mon, Nov 3, 2008 at 2:48 PM, ams163 [EMAIL PROTECTED] wrote:

  Hello,

  We've tried this on a number of our development machines, but so far
  this is not working for us.

  We are consistently getting the following errors in DDMS LogCat :

  'MapActivity - Couldn't get connection factory client'

  and a LOT of :

  'WARN/AndroidHttpConnectionFactory(167): IOException in HttpClient:
  The target server failed to respond'

  warnings. A few days ago this was working for us when there wasn't the
  googlemaps API key requirement, although we still had these HttpClient
  warning messages coming up for us.

  We are using Android SDK Debug certificate in eclipse as instructed
  here:

 http://code.google.com/android/toolbox/apis/mapkey.html

  Eclipse version is : Version: 3.3.2, Build id: M20080221-1800
  JDK: jdk1.6.0_06
  Latest Android SDK and Eclipse Plugin
  Platform, Windows XP SP2

  Would appreciate any help.

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



[android-developers] Is the address of a contact really held in POSTAL_LOCATION_LATITUDE ?

2008-11-04 Thread jarkman

I'm trying to fetch location data for contacts.

When I look in the Contacts.ContactMethods.POSTAL_LOCATION_LATITUDE
field, hoping to get a latitude, I find I actually get the postal
address of the contact !

Is that just a bug, or is there really a latitude for the contact in
there somewhere ?

Thanks,

Richard

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



[android-developers] Re: Showing the options menu

2008-11-04 Thread Mark Wyszomierski

Hmm seeing as how this is not working, is there a way to inject a menu
button key press to get the menu to come up?

Thanks

Mark Wyszomierski wrote:
 Hi,

 How can we programatically show the options menu for an Activity? It
 seems:

 Activity.openOptionsMenu()

 would do it, but it has no effect when I call it. I put a break point
 in onPrepareOptionsMenu() expecting it to be called sometime
 afterwards, but nothing in there either. I'm using the release windows
 Android SDK. Is there some special method of calling it?

 Sorry if this is a repeat, I thought I had posted this question
 earlier but I cannot seem to find it any long to follow up on it,

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



[android-developers] Re: disable item of list view in Alert Dialog

2008-11-04 Thread Jason Parekh
Hi Justin,

Check out ListAdapter's areAllItemsEnabled and isEnabled.

jason

On Mon, Nov 3, 2008 at 9:12 PM, Justin [EMAIL PROTECTED] wrote:


 I want to disable some items in listview which is in the Alert Dialog
 I implemet an Adapter and in getView() of Adapter I set item to
 disable
 but it is not work, how can I make this goal?

 


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



[android-developers] Re: camera events

2008-11-04 Thread spackest

So if I want to capture images and send them to a website, I need to
write my own capture program, separate from the core capturing
program?  Would sure be nicer to just catch the event from a different
app.

Thanks,
Earl

On Nov 4, 1:24 am, hackbod [EMAIL PROTECTED] wrote:
 Sorry, you can't intercept what other applications are doing like
 this.

 On Nov 3, 8:58 pm, spackest [EMAIL PROTECTED] wrote:

  I run a free hosting web site which has functionality for emailing
  photos to your site and having them show up on the web.  I would like
  to write an android app that allows a user to authenticate to their
  free website, then I would like to receive an event each time a photo
  is saved.  I am hoping that I would then have enough information to
  then access the photo and send it off to the user's site.

  Just wondering how I can register to receivecameracaptureevents,
  and then get to the recently captured images.

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



[android-developers] Installing Android on different Handsets than G1?

2008-11-04 Thread MArtin Schumacher

Hi Group,

I'm living in Germany, so there is no access to the G1 right now. Also
as far as I know the G1 will come with a 2 year subscription from t-
mobile...

So my idea is to deploy the Android System on another handset. I have
a spare Samsung I600 (comparable with the Samsung BlackJack 1) lying
here. So it should be possible to install Android on it (removing the
existing windows mobile).

Am I right? Is there any possibility? What - exept building Android -
do I have to do? Which requirements do I have to keep an eye on?

Are there any hints, links etc for me?

MArtin

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



[android-developers] Re: Recorder Audio

2008-11-04 Thread mesak82

Does Sound Recorder application also save recorded audio in a raw
format?

I'm recording using Sound Recorder, the file is saved (it's on sdcard
and also showed in logcat is being stored) but if I try to open the
file from Music application, the file I recorded is not even shown in
the play list. Could that be related?

Rgrds,
Misa

On Oct 28, 10:49 pm, gs_cmans [EMAIL PROTECTED] wrote:
  But the music media in Android can't play this format?

 try save it as .3GPP and play it.

 if u are just receiving the data from recorder and storing it in raw
 format it wont play; requires other magic headers to be placed
 for .amrfile format; refer IF2 documentation

 -g

 On Sep 22, 9:50 am, ZIN [EMAIL PROTECTED] wrote:



  I saw in the properties MediaRecorder.AudioEncoder.AMR_NB, so the only
  format audio recorder type is .AMR
  But the music media in Android can't play this format?
  What can i solve this problem?- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OpenDatabase error

2008-11-04 Thread Kingorcus

db = SQLiteDatabase.openDatabase(/data/data/
com.android.providers.settings/databases/settings.db,
null,SQLiteDatabase.OPEN_READONLY);


I keep getting an exception unable to open database file

any ideas

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



[android-developers] fontspacint about drawText

2008-11-04 Thread Narwal

Hello all
i know there is a method getFontSpacing().
but which method i should use,if i want to control the fontspacing
accurately,when i use drawText.

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



[android-developers] When is View ready?

2008-11-04 Thread Grigory F.

Hi All,

im playing around with Snake-Example. I wish a new start-screen for
this, with buttons like play, highscore and so ... you know?
well, ich create new xml-layout with buttons. i do
setContentView(R.layout.start_layout);  to get it up - it works.
on onClick of play-button i do
setContentView(R.layout.snake_layout); to get the snake-screen visible
and i do start the game.
the problem is, it seems  TileView.onSizeChanged was not called, so X/
Y-counts are empy and i run in the crash.

Can anyone say me, how can i detect, what the snake-view is finished
with the draw itself?

thanks at all.


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



[android-developers] Bluetooth Availability? Timeframe?

2008-11-04 Thread USAePay

I am sure this issue has probably been talked about before but I could
not find a lot of information by searching this group as to when the
SDK will support Bluetooth for applications.

I have read that the bluetooth was locked down for security but that
it may be released in the next SDK release but I can not find a
timeframe for that release.

A lot of people have complained that Bluetooth is a very important
piece to the success of the phone and I can not agree more. For those
that argue that iPhone has the same thing have to realize that
comparing the market value of the iPhone to a phone like the G1 is
absurd. If anything the G1 NEEDS to have Bluetooth available just so
it CAN compete against the iPhone.

I hope to hear some good news about the Bluetooth, it will be a shame
if bluetooth will continue to go unsupported in the SDK. Thanks in
advance.

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



[android-developers] Re: Recorder Audio

2008-11-04 Thread mesak82

I'm using Sound Recorder application and after recording I cannot see
that audio in the playback list in Music application, but it's on the
SD card.

Sound Recorder also stores recorded audio in raw format? Is it
expected not to see the recorded file in playback lists?

Rgrds,
Misa

 if u are just receiving the data from recorder and storing it in raw
 format it wont play; requires other magic headers to be placed
 for .amrfile format;



On Oct 28, 10:49 pm, gs_cmans [EMAIL PROTECTED] wrote:
  But the music media in Android can't play this format?

 try save it as .3GPP and play it.

 if u are just receiving the data from recorder and storing it in raw
 format it wont play; requires other magic headers to be placed
 for .amrfile format; refer IF2 documentation

 -g

 On Sep 22, 9:50 am, ZIN [EMAIL PROTECTED] wrote:



  I saw in the properties MediaRecorder.AudioEncoder.AMR_NB, so the only
  format audio recorder type is .AMR
  But the music media in Android can't play this format?
  What can i solve this problem?- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to test if the screen is in HVGA-L mode

2008-11-04 Thread [EMAIL PROTECTED]

Not sure that this is the best answer, but here's what I am using:

int height =
getWindow().getWindowManager().getDefaultDisplay().getHeight();
int width =
getWindow().getWindowManager().getDefaultDisplay().getWidth();
if ( width  height ) {

On Nov 4, 7:12 am, Hw3699 [EMAIL PROTECTED] wrote:
 How to test if the screen is in HVGA-L mode?

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



[android-developers] need some inputs/help

2008-11-04 Thread som

Hi All,

First of all i must say that i am very new to android.

I am trying to develop an application which will receive an SMS alert
and notofy the user with some sound. I have written the main
SMSReceiver class as follows;

package com.android.sms;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.gsm.SmsMessage;

public class SMSReceiver extends BroadcastReceiver {

/* package */ static final String ACTION =
android.provider.Telephony.SMS_RECEIVED;

public void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals(ACTION))
{
String buf = new String();
Bundle bundle = intent.getExtras();
if (bundle != null)
{
 Object[] pdusObj = (Object[]) bundle.get(pdus);
SmsMessage[] messages = new SmsMessage[pdusObj.length];

int length = pdusObj.length;

 for (int i = 0; ilength; i++)
 {
 messages[i] = SmsMessage.createFromPdu 
((byte[]) pdusObj[i]);

 buf = messages[0].getMessageBody();

 //buf = messages[0].toString();

 if (null != buf)
 {

 Intent startActivity = new Intent();

startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity.setAction(com.myexample.START_THE_MUSIC);

context.startActivity(startActivity);


 }
 }
}

}
}
}

However, I am not able to listen to the music when I try to send a SMS
through DDMS.

I have written the com.myexample.START_THE_MUSIC as follows:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;

public class SMSAlert extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent i = getIntent();
String action = i.getAction();
if (action != null 
action.equals(com.myexample.START_THE_MUSIC))
{
//setContentView(R.layout.main);
startService(new Intent
   (com.myexample.START_AUDIO_SERVICE));
}
else
{
finish();
}
}

And the com.myexample.START_AUDIO_SERVICE as follows;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.IBinder;

public class SMSAlertPlaybackService extends Service {

MediaPlayer player;
@Override
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}

public void onStart(Intent startId, int arguments)
{
//MediaPlayer player;
super.onStart(startId, arguments);
player = MediaPlayer.create(this, R.raw.ding);
player.start();
}

public void onDestroy()
{
super.onDestroy();
player.stop();
}
}

Moreover when I am debugging it to go inside the
com.myexample.START_THE_MUSIC code, the debugger is complaining that
source code is not found.

Please help me out by giving your valuable inputs.

Thanks in advance.

Somenath Mukhopadhyay

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



[android-developers] how the library files (c, c++) are linked with framework (java files)

2008-11-04 Thread [EMAIL PROTECTED]

Hi,

How is the framework and the corresponding library files are linked
through the JNI layer? Any particular example through with i can
understand one to one mappings from java to c/c++ code?

If anybody have worked on this, please reply.

Thanks in advance.

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



[android-developers] Re: How to make a desktop widget?

2008-11-04 Thread atrus123

I have high hopes that this will be supported in SDK 1.1.

On Nov 4, 12:39 pm, Romain Guy [EMAIL PROTECTED] wrote:
 You can't :)

 On Tue, Nov 4, 2008 at 5:26 AM, blau [EMAIL PROTECTED] wrote:

  Anyone have a clue how to make a desktop widget? I haven't seen any
  created ones. I haven't been able to find the source for the google
  created ones in the android source. I have no clue how to start.

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



[android-developers] Re: Android Icon Creation Software

2008-11-04 Thread Peli

We've created our Android icons using Inkscape. http://www.inkscape.org/

Have a look at some icons here: http://www.openintents.org/en/
for OI Flashlight, OI Shopping list, OI News Reader, and OI Notepad.
(you have to scroll down a bit to see the new SDK 1.0 look icons).

Peli
www.openintents.org

On Nov 2, 4:14 pm, ScottG [EMAIL PROTECTED] wrote:
 Thanks for the insight, Pavel.  I was looking to duplicate look and
 feel of the Android home page icons not just a bunch of icon pixels.

 The folks at

 http://www.glyfx.com/index.html

 have some tools, some free icons and considerable expertise in this
 area.

 Cheers, Scott

 On Nov 1, 11:09 am, ScottG [EMAIL PROTECTED] wrote:

  What graphics package is recommend to create those nice Android icons?

  Thanks for any insight.

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



[android-developers] Re: How to make a desktop widget?

2008-11-04 Thread Romain Guy

Unfortunately, probably not. To do it correctly, there is some
extensive work to be done in the framework and this is currently not a
priority.

On Tue, Nov 4, 2008 at 9:41 AM, atrus123 [EMAIL PROTECTED] wrote:

 I have high hopes that this will be supported in SDK 1.1.

 On Nov 4, 12:39 pm, Romain Guy [EMAIL PROTECTED] wrote:
 You can't :)

 On Tue, Nov 4, 2008 at 5:26 AM, blau [EMAIL PROTECTED] wrote:

  Anyone have a clue how to make a desktop widget? I haven't seen any
  created ones. I haven't been able to find the source for the google
  created ones in the android source. I have no clue how to start.

 --
 Romain Guywww.curious-creature.org
 




-- 
Romain Guy
www.curious-creature.org

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



[android-developers] Clickable ListView item with CheckBox

2008-11-04 Thread Chris McCurdy

I have a ListView with a complex widget for displaying list items. It
has a CheckBox and several TextViews. I want to be able to handle
clicks to the CheckBox and be able to do the normal things on the list
item when anywhere that's not the CheckBox is clicked (e.g. context
menus, onListItemClick(), etc.). The problem is that when the CheckBox
is visible, it removes the ability for any other part of the item to
receive clicks, even if the CheckBox itself isn't receiving the click
events. Is there any way to prevent it from stealing the click
events from the rest of the items in the widget?


Here is the XML layout of the widget for every list item I'm using:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=horizontal android:layout_gravity=top
android:gravity=top android:id=@+id/TransactionRowPortrait

TextView android:layout_width=wrap_content
android:layout_height=wrap_content android:visibility=gone
android:id=@+id/IdText/TextViewCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content android:id=@+id/
PostedCheckBox/CheckBoxLinearLayout android:id=@+id/
LinearLayout01 android:layout_width=wrap_content
android:layout_height=fill_parent android:layout_gravity=left|
center_vertical android:layout_weight=10
android:orientation=verticalTextView android:id=@+id/PartyText
android:ellipsize=end android:gravity=top|left
android:text=Wilmington Trust Company android:layout_gravity=left|
center_vertical android:layout_height=wrap_content
android:layout_width=fill_parent android:textSize=18px
android:lines=1 android:maxLines=1/TextViewLinearLayout
android:id=@+id/LinearLayout02 android:layout_height=wrap_content
android:layout_width=fill_parentTextView
android:layout_height=wrap_content android:text=2008-10-01
android:id=@+id/DateText android:layout_gravity=left|
center_vertical android:layout_width=wrap_content
android:layout_weight=2/TextViewTextView
android:layout_width=wrap_content android:text=215.00
android:gravity=right android:id=@+id/AmountText
android:layout_height=fill_parent android:paddingRight=7px
android:singleLine=false android:maxLines=1 android:lines=1
android:layout_weight=1/TextView/LinearLayout


TextView android:layout_width=wrap_content
android:layout_height=wrap_content android:layout_weight=2
android:id=@+id/BalanceText android:text=1000.00
android:gravity=right android:visibility=gone/TextView



/LinearLayout
/LinearLayout

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



[android-developers] Re: AppMarket: does changing title/description of an app wipe out ratings and reviews?

2008-11-04 Thread atrus123

IIRC, you can change the title/desc without it wiping out ratings,
etc.

I hope Google fixes this soon.  I try and do frequent updates for my
users, and I hate seeing all their ratings/comments go away every time
I add a feature.

On Nov 3, 4:24 pm, zl25drexel [EMAIL PROTECTED] wrote:
 Hi all

 I know putting a new version upgrade will clear out ratings and
 reviews. Does anyone knows if changing title/description of an app
 will wipe out ratings and reviews?

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



[android-developers] How to make a desktop widget?

2008-11-04 Thread blau

Anyone have a clue how to make a desktop widget? I haven't seen any
created ones. I haven't been able to find the source for the google
created ones in the android source. I have no clue how to start.

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



[android-developers] Re: Orientation Sensor yaw values. Is your G1 compass bad?

2008-11-04 Thread David Given

bryan wrote:
[...]
 For example, the range of offset from magnetic north is +/- 46
 degrees. The average offset is just under 20 degrees. Depending on how
 I orient my G1, the error can go to 46 degrees off of magnetic north.
 Has anyone here experienced similar results when reading yaw from the
 sensor?

I can't comment on the G1 specifically, but magnetic compasses are
frequently scarily inaccurate if there's any metal around --- try it in
different locations (but pointing in the same direction!) to see if the
deflection varies from place to place.

(Once scuba diving I found myself swimming in almost literal circles
because I was a few metres away from an old magnetised torpedo, that was
causing a complete 180° deflection. Even unmagnetised metal has a severe
effect. Of course, if you're *not* standing on top of a lump of iron,
+/- 46° does seem like a lot.)

-- 
David Given
[EMAIL PROTECTED]


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



[android-developers] problem downloading Android from windows

2008-11-04 Thread dreamerBoy

bash-3.2$ ../myRepo/repo init -u git://android.git.kernel.org/platform/manifest
.git
Traceback (most recent call last):
  File ../myRepo/repo, line 587, in module
main(sys.argv[1:])
  File ../myRepo/repo, line 554, in main
_Init(args)
  File ../myRepo/repo, line 173, in _Init
_CheckGitVersion()
  File ../myRepo/repo, line 202, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  File /cygdrive/c/cygwin/lib/python2.5/subprocess.py, line 593, in
__init__
errread, errwrite)
  File /cygdrive/c/cygwin/lib/python2.5/subprocess.py, line 1079, in
_execute_
child
raise child_exception
OSError: [Errno 2] No such file or directory

Has anyone seen this before /|| know how to fix it?

Thanks much.

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



[android-developers] Re: How to make a desktop widget?

2008-11-04 Thread Romain Guy

You can't :)

On Tue, Nov 4, 2008 at 5:26 AM, blau [EMAIL PROTECTED] wrote:

 Anyone have a clue how to make a desktop widget? I haven't seen any
 created ones. I haven't been able to find the source for the google
 created ones in the android source. I have no clue how to start.

 




-- 
Romain Guy
www.curious-creature.org

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



[android-developers] Background activities

2008-11-04 Thread brs

What is the simplest, correct way to implement an application with
background semantics similar to the media player?  To  the user it
should appear as an activity which can be kept running in the
background and iconized to the notification bar whenever the
activity is not on top of the stack or until stopped explicitly.

I guess some of the choices would be:

a) An activity which ignores onPause/onStop and just keeps doing
whatever it is doing (simple, but I suspect not the recommended
way...)
b) Activity + in-process service
c) Activity + service with its own process

Assuming the solution involves a service, what are the choices for
sharing a fair amount of state between the activity and its service?
Can they just access shared objects (how to set that up) or does it
require an AIDL RPC interface storing everything in a database
instead?

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



[android-developers] Re: how the library files (c, c++) are linked with framework (java files)

2008-11-04 Thread Evan JIANG
Just for an example,
There`s a file FileObserver.java under
framewors/base/core/java/android
The linked jni file is
android_util_FileObserver.cpp under frameworks/base/core/jni
The path
may be not exactly right. I`m writing mail from my cell phone.
Regards,
Evan

2008/11/4, [EMAIL PROTECTED] [EMAIL PROTECTED]:

 Hi,

 How is the framework and the corresponding library files are linked
 through the JNI layer? Any particular example through with i can
 understand one to one mappings from java to c/c++ code?

 If anybody have worked on this, please reply.

 Thanks in advance.

 


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



[android-developers] Re: Background activities

2008-11-04 Thread Jean-Baptiste Queru

You're looking for a service. Unless you have a good reason not to do
so, you should put it in the same process.

JBQ

On Tue, Nov 4, 2008 at 9:50 AM, brs [EMAIL PROTECTED] wrote:

 What is the simplest, correct way to implement an application with
 background semantics similar to the media player?  To  the user it
 should appear as an activity which can be kept running in the
 background and iconized to the notification bar whenever the
 activity is not on top of the stack or until stopped explicitly.

 I guess some of the choices would be:

 a) An activity which ignores onPause/onStop and just keeps doing
 whatever it is doing (simple, but I suspect not the recommended
 way...)
 b) Activity + in-process service
 c) Activity + service with its own process

 Assuming the solution involves a service, what are the choices for
 sharing a fair amount of state between the activity and its service?
 Can they just access shared objects (how to set that up) or does it
 require an AIDL RPC interface storing everything in a database
 instead?

 Bernhard
 


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



[android-developers] Re: Exact Battery level value

2008-11-04 Thread Ian

By installing AnyCut, I was able to add a shortcut to Battery info.
This gave me a whole load of info I have not seen via any other menu option!
(Makes me wonder what other goodies are hidden away!)

IV

2008/11/4 denismo [EMAIL PROTECTED]:

 Hi,

 for tuning power consumption of my application I need to be able to
 estimate how much it consumes power in, say, 1 hour. I will then try
 different strategies and experiment with parameters in order to reduce
 power consumption. Is it possible to implement something like this on
 Android?  Is it possible to get exact battery level value as a number?

 Thanks.

 Denis
 


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



[android-developers] Re: Installing Android on different Handsets than G1?

2008-11-04 Thread Misael Lopez

I think there are several sites with information about porting android
to different hardware platforms. But you can take a look of below link
if you want to check first if your hardware is suitable to put android
on it.

http://elinux.org/Android_on_OMAP

Please take a look on Real Hardware section, it lists the features
your hardware needs to have.

2008/11/4 MArtin Schumacher [EMAIL PROTECTED]:

 Hi Group,

 I'm living in Germany, so there is no access to the G1 right now. Also
 as far as I know the G1 will come with a 2 year subscription from t-
 mobile...

 So my idea is to deploy the Android System on another handset. I have
 a spare Samsung I600 (comparable with the Samsung BlackJack 1) lying
 here. So it should be possible to install Android on it (removing the
 existing windows mobile).

 Am I right? Is there any possibility? What - exept building Android -
 do I have to do? Which requirements do I have to keep an eye on?

 Are there any hints, links etc for me?

 MArtin

 


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



[android-developers] Re: OpenDatabase error

2008-11-04 Thread Evan JIANG
I guess it`s permission problem. Why not access the settings through
the SettingsProvider? Regards Evan

2008/11/5, Kingorcus [EMAIL PROTECTED]:

 db = SQLiteDatabase.openDatabase(/data/data/
 com.android.providers.settings/databases/settings.db,
 null,SQLiteDatabase.OPEN_READONLY);


 I keep getting an exception unable to open database file

 any ideas

 


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



[android-developers] Server timeouts while attempting download android source

2008-11-04 Thread Brad A

Has anyone successfully downloaded the source?  I've tried using both
git as described herehttp://git.source.android.com/ and repo as
described herehttp://source.android.com/download/using-repo.
In all cases I get the folllowing timeout.  However I am able to ping
the server.  Are they just under a very heavy load?
 /cygdrive/c/dev/thirdparty/android
$ repo init -u git://android.git.kernel.org/platform/manifest.git
Getting repo ...
   from git://android.kernel.org/tools/repo.git
android.kernel.org[0: 204.152.191.13]: errno=Connection timed out
android.kernel.org[1: 204.152.191.45]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

 /cygdrive/c/dev/thirdparty/android
$ ping  204.152.191.13
PING 204.152.191.13 (204.152.191.13): 56 data bytes
64 bytes from 204.152.191.13: icmp_seq=0 ttl=57 time=59 ms
64 bytes from 204.152.191.13: icmp_seq=1 ttl=57 time=45 ms
64 bytes from 204.152.191.13: icmp_seq=2 ttl=57 time=45 ms
64 bytes from 204.152.191.13: icmp_seq=3 ttl=57 time=52 ms
64 bytes from 204.152.191.13: icmp_seq=4 ttl=57 time=45 ms
64 bytes from 204.152.191.13: icmp_seq=5 ttl=57 time=44 ms
64 bytes from 204.152.191.13: icmp_seq=6 ttl=57 time=45 ms
64 bytes from 204.152.191.13: icmp_seq=7 ttl=57 time=46 ms
64 bytes from 204.152.191.13: icmp_seq=8 ttl=57 time=44 ms
64 bytes from 204.152.191.13: icmp_seq=9 ttl=57 time=44 ms
64 bytes from 204.152.191.13: icmp_seq=10 ttl=57 time=44 ms
64 bytes from 204.152.191.13: icmp_seq=11 ttl=57 time=44 ms

204.152.191.13 PING Statistics
12 packets transmitted, 12 packets received, 0.0% packet loss
round-trip (ms)  min/avg/max/med = 44/46/59/45

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



[android-developers] Re: possible to lock device?

2008-11-04 Thread j

What about:
android.permission.BRICK

On Oct 19, 11:10 am, hackbod [EMAIL PROTECTED] wrote:
 Whoops, I just looked and this permission is not available to
 applications.  Sorry, it isn't possible for apps to do this.

 On Oct 18, 1:43 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:

  i added device_power but doesnt seem to do anything.

  On Oct 18, 8:01 am, e [EMAIL PROTECTED] wrote:

   im have error

   10-18 17:27:58.569: ERROR/AndroidRuntime(204): Uncaught handler:
   thread main exiting due to uncaught exception
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):
   java.lang.SecurityException: Neither user 10017 nor current process
   has android.permission.DEVICE_POWER.
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.Parcel.readException(Parcel.java:1234)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.Parcel.readException(Parcel.java:1222)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:175)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.PowerManager.goToSleep(PowerManager.java:364)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   aexp.phoneintent.MyPhoneStateListener.onCallStateChanged(MyPhoneStateListener.java:
   114)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.telephony.PhoneStateListener
   $2.handleMessage(PhoneStateListener.java:254)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.Handler.dispatchMessage(Handler.java:88)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.os.Looper.loop(Looper.java:123)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   android.app.ActivityThread.main(ActivityThread.java:3742)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   java.lang.reflect.Method.invokeNative(Native Method)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   java.lang.reflect.Method.invoke(Method.java:515)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   com.android.internal.os.ZygoteInit
   $MethodAndArgsCaller.run(ZygoteInit.java:739)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
   10-18 17:27:58.581: ERROR/AndroidRuntime(204):     at
   dalvik.system.NativeStart.main(Native Method)

   im using permission

   uses-permission android:name=android.permission.WAKE_LOCK/uses-
   permission
   uses-permission android:name=android.permission.DEVICE_POWER/uses-
   permission
   On Oct 18, 11:32 am,hackbod[EMAIL PROTECTED] wrote:

Take a look in the log and see if there is an error message about not
having a permission; I would assume that there is a permission needed
to do this.

On Oct 17, 7:59 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:

 hmm that didnt seem to work right, i ran using the debugger and it did
 infact run the method but nothing; heres what i got:

 final PowerManager pm = (PowerManager)
 getSystemService(Context.POWER_SERVICE);
 ...
 if(lock.equals(lock))
                                                 {
                                                         
 pm.goToSleep(1);
                                                 }

 On Oct 17, 2:53 am, shailesh prakash [EMAIL PROTECTED] wrote:

  Sure it does, but if your phone is stolen then it should wake up in
  password lock mode and ack should send to alternative number or mail
  with gps location and cell ID(network operator's cell).

  On Fri, Oct 17, 2008 at 11:34 AM,hackbod[EMAIL PROTECTED] wrote:

   I believe PowerManager.goToSleep() should lock the device as part 
   of
   putting it to sleep:

  http://code.google.com/android/reference/android/os/PowerManager.html...)

   On Oct 16, 9:51 pm, Mast3rpyr0 [EMAIL PROTECTED] wrote:
   hmm i wish there was a simple lockDevice() method :P
   this is the last thing i need before i want to release my app.
   it goes out for a closed beta on the 22nd.

   On Oct 17, 12:33 am, shailesh prakash [EMAIL PROTECTED] 
   wrote:

Hey Mast3rpyr0,

I did try it earlier but drop in between. I had plans to do it 
like this,
    Send SMS, broadcast receiver will listen it and open msg 
read
content match with data in SQLite database and change phone 
state
accordingly.
I implemented till the last and most tedious task, changing 
phone state.
Hope it will help you in some extent

On Fri, Oct 17, 2008 at 9:56 AM, Mast3rpyr0 [EMAIL 
PROTECTED] wrote:

 Im working on a security app that allows a user to track 
 their phone
 on a web site if they lose the phone or it is stolen. I 
 already have
 the part working where i could do this if a user selected 
 lock on the
 site but once the device gets 

[android-developers] Re: Exact Battery level value

2008-11-04 Thread Jean-Baptiste Queru

If it's not documented, you shouldn't rely on it.

JBQ

On Tue, Nov 4, 2008 at 5:23 AM, denismo [EMAIL PROTECTED] wrote:

 The answer is in Settings/BatteryInfo, thanks to Ian for pointing out
 its existence. ACTION_BATTERY_CHANGED carries various undocumented
 (thanks Google) extras, including level. Not sure what scale means
 though, but it's a good start.

 Denis

 On Nov 5, 12:12 am, denismo [EMAIL PROTECTED] wrote:
 Where can I get that AnyCut, preferably with the source code?

 Thanks.

 Denis

 On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:

  By installing AnyCut, I was able to add a shortcut to Battery info.
  This gave me a whole load of info I have not seen via any other menu 
  option!
  (Makes me wonder what other goodies are hidden away!)

  IV

  2008/11/4 denismo [EMAIL PROTECTED]:

   Hi,

   for tuning power consumption of my application I need to be able to
   estimate how much it consumes power in, say, 1 hour. I will then try
   different strategies and experiment with parameters in order to reduce
   power consumption. Is it possible to implement something like this on
   Android?  Is it possible to get exact battery level value as a number?

   Thanks.

   Denis


 


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



[android-developers] NinePatchDrawable - how to use?

2008-11-04 Thread Ludwig
Is there any example out there on how to use a NinePatchDrawable
programmatically?
I need to draw a text label inside one -- essentially for a map-pin with
variable length text in it.

Any usage examples out there (of whatever kind), from the online doc it is
just a complete mystery to me how to use it.

Ludwig

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



[android-developers] Re: Sending email

2008-11-04 Thread Justin (Google Employee)

Yes, you should be able to install the Email program's APK on the
emulator. You could download the Android source and compile Email and
then install on the emulator. Alternately I know there is a project
that has forked (but will hopefully merge back their changes) the
email client and there is a binary distribution you can get from
http://code.google.com/p/k9mail/ . I haven't tried it, but this should
install on the emulator. Please let us know your results if you try
this.

Cheers,
Justin
Android Team @ Google

On Nov 4, 6:24 am, john [EMAIL PROTECTED] wrote:
 Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
 pretty absent minded at times.

 On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:

  I'm assuming you meant to say it only works on the phone, not the
  emulator :)

  On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:

   Unfortunately yes, this only seems to work on the emulator. We had to
   break down and buy a G1 (as well as a two-year plan) so we could
   realistically get our software tested and released. It would be
   interesting, though, to see if you could install theemailprogram on
   the emulator. If you do, you might want to post it to help some people
   out.

   Good luck!

   On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
   John - I'm assuming this only works on the real device and not the
   emulator?

   I'm trying

   Intent sendIntent = new
   Intent(Intent.ACTION_SEND);
   sendIntent.putExtra(Intent.EXTRA_TEXT,
   emailtext);
   sendIntent.putExtra(Intent.EXTRA_SUBJECT,
   Subject);
   sendIntent.setType(message/rfc822);

   startActivity(Intent.createChooser(sendIntent, Title:));

   and am getting No Applications can perform this action which is the
   same when you select theemailaddress in the contact list of the
   emulator. Prob because there is notemailclient in the emulator
   right?

   Justin - Is it possible to have access to the .apk for the mail
   programs that come with the G1 so we can install them on the
   emulator?

   Thanks

   On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

   Hey, that did it! I set the the mime type to 'message/rfc822' and it
   worked right away. Brings up the default mail application with the
   fields that I specified populated.

   I had been trying to send it with a mime of text/plain and text/
   html.
   I thought that by specifying anEXTRA_EMAILit would fire the right
   broadcast receivers, but I guess the mime type is what counts.

   Thanks again!

   On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

   John,

   Take a look athttp://code.google.com/android/reference/android/
   content/Intent.html,
   there are several e-mail related fields you probably want to set.
   For a
   mime type try 'message/rfc822' or 'message/rfc2822'. I haven't
   tried this
   myself, so let me know how it works.

   Cheers,
   Justin
   Android Team @ Google

   Original Message Follows:
   
   From: john [EMAIL PROTECTED]
   Subject: [android-developers]Sendingemail
   Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

   Hello!

   Thanks in advance for trying to help me out. It doesn't seem like
   anyone has found a solution to this problem yet, so hopefully we
   can
   figure this out and help a lot of people.

   I'm trying to get my application to send anemail, but i can't
   seem to
   find any solutions. Here's what I'm trying:

   I've got an Intent (called sender in this example) set to
   Intent.ACTION_SEND, with variousemailextras.

   When I try startActivity(Intent.createChooser(sender, Select send
   method.));
   I get No application can handle this request

   And when I try sendBroadcast(Intent.createChooser(sender, Select
   send
   method.));
  Nothing happens at all.

   Is there something I need to put in my manifest file, or am I doing
   this completely wrong?

   Any help anyone can offer would be greatly appreciated. Happy
   coding!

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



[android-developers] Re: Android on device GPS locate not working - code included

2008-11-04 Thread Amir

Thanks, I'm still having issues, but now I do see the GPS 'icon' as
turned on when the application is running.  The issue though is that I
don't get anything on the map through our online site...no longitude
and latitude, or anything else.

Here's the revised code I'm using:

package org.gw.service;

import android.content.Context;
import android.location.Location;
import android.location.LocationManager;

public class LocationService extends AService {
 LocationManager lm = null;
 Location loc = null;
 public int excute() {
 getDataMap().put(Command, LOCATION);

 if (isOk()) {
  lm = (LocationManager)
getContext().getSystemService(Context.LOCATION_SERVICE);
  loc = lm.getLastKnownLocation(gps);
  if(loc == null)
   loc = lm.getLastKnownLocation(network);
  double sLatitude = loc.getLatitude();
double sLongitude = loc.getLongitude();
 String location = sLatitude+,+sLongitude;
  //location = 40.738412973944534,-73.98468017578125;
 getDataMap().put(Des, OK);
 getDataMap().put(Value, location);
 } else {
 getDataMap().put(Des, error password!!);
 }
 new ServiceClient(this).excute();

 return 0;
}
}


On Nov 2, 8:46 am, Akbur [EMAIL PROTECTED] wrote:
 Amir,

 I've developed a similar app just for kicks (so the wife can keep
 track of me) ;)

 I did the following:

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

 Location loc = lm.getLastKnownLocation(gps);
 if (loc == null)
 {
 locType = Network;
 loc = lm.getLastKnownLocation(network);
 }

 In this case if the GPS service does not have a fix or is switched
 off, the network, though not as accurate as GPS should be active and
 give you an approximate location.

 All the best,
 Akbur

 On Nov 2, 11:45 am, Guillaume Perrot [EMAIL PROTECTED] wrote:

  It can take a while to the G1 to init the gps and return a fix.
  And you must see the sky for the GPS to work.
  Your code and permissions seem correct, try using the network provider
  to test (which is faster and work in buildings unlike the GPS).
  Make sure GPS location provider is enabled on the phone settings.
  You can check your location with the standard map application.

  On Nov 2, 5:42 am, C-LIS Keiji Ariyama [EMAIL PROTECTED] wrote:

   Hi Amir,

   I had encountered a same situation. But my case is about
   getLastKnownLocation(String) cid:part1.07010905.08080...@c-lis.co.jp
   method on the emulator.
   In that time, I fixed my code below.

    Old 
   public class TestActivity extends Activity {
   private void initActivity() {
   LocationManager locman = (LocationManager) getContext()
   .getSystemService(Context.LOCATION_SERVICE);
   }}

   -

    Fixed 
   public class TestActivity extends Activity {
   LocationManager locman = null;
   private void initActivity() {
   locman = (LocationManager) getContext()
   .getSystemService(Context.LOCATION_SERVICE);
   }}

   -

   Sorry. I don't know about G1. Because I have not been having it...

   Keiji,

   Amir wrote:
I'm creating a project that allows for my location to be found using
the android device and communicating with my website as to where my
Android device is.  When I download the .apk to my phone the following
permissions are acquired:

Network communication (full)
Your location (fine (GPS), coarse (network-based) location)

As of now, on the emulator everything works fine and I can find my
location (default location on Google Maps), but on the phone the
application/device can't find location of the android phone.

please help!...below is the code I'm using for the GPS section.

- Amir



package org.gw.service;

import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;

public class LocationService extends AService {

   public int excute() {
getDataMap().put(Command, LOCATION);

if (isOk()) {

// // location.
// getDataMap().put(Des, OK);
// //get location
// getDataMap().put(Value, 100,100);
// String location = 25,121.55;
LocationManager lm = (LocationManager) getContext()
 .getSystemService(Context.LOCATION_SERVICE);

LocationListener locationListener = new GWLocationListener(this);
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
 locationListener);

} else {
getDataMap().put(Des, error password!!);
}

return 0;
   }

   private class GWLocationListener 

[android-developers] Re: delete my app on G1

2008-11-04 Thread Ian

Without causing offence, its actually a very cool feature that most
people either have found out for them selfs, or read about.
(The ability to pick-up and move/drag/drop desktop icons)

IV

2008/11/3 Ric Higgins [EMAIL PROTECTED]:
 Thank you for that! How would I have learned that unless u told me? Much
 appreciated!

 On Nov 3, 2008 1:53 PM, Kipling Inscore [EMAIL PROTECTED] wrote:


 If you mean removing the desktop icon, hold the icon until your phone
 vibrates and the application pane tab turns into a trash bin, then
 drag the icon to the trash bin.

 On Mon, Nov 3, 2008 at 1:41 PM, ric [EMAIL PROTECTED] wrote:   I
 have removed applications ...

 


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



[android-developers] Re: My new issue...How can I select a song from playlist available in phone (or) Emulator ...

2008-11-04 Thread yasmin afrose
Hi,,,

No body is there aa to save me from this issue :(

On Tue, Nov 4, 2008 at 11:44 AM, yasmin afrose [EMAIL PROTECTED]wrote:

 Hi All,

 Greetings!!!

 I've played .mp3 songs using MediaPlayer in Android 1.0.

 *My code was*:

 1:* PrankActivity.java*
 --

 package com.aspire.android.prankapp;
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.KeyEvent;
 public class *PrankActivity* extends Activity {
 /** Called when the activity is first created. */
 @Override
/* public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 }*/
 public void onCreate(Bundle icicle)
 {
 super.onCreate(icicle);
 Intent i = getIntent();
 String action = i.getAction();
 if (action != null 
 action.equals(com.aspire.android.prankapp.WAKE_UP))
 {
 setContentView(R.layout.splash);
 //We'll need to start the music service here
  startService(new Intent
   (com.aspire.android.prankapp.START_AUDIO_SERVICE));
 }
 else
 finish();
 }
 public boolean onKeyDown(int keyCode, KeyEvent event)
 {
 stopService(new Intent(
 com.aspire.android.prankapp.START_AUDIO_SERVICE));
 finish();
 return true;
 }
 }

 2 .* PrankSMSReceiver.java*

 *

 package
 *com.aspire.android.prankapp;

 *

 import
 *android.content.BroadcastReceiver;*

 import
 *android.content.Context;*

 import
 *android.content.Intent;*

 import
 **android*.os.Bundle;*

 import
 *android.telephony.gsm.SmsMessage;*

 import
 *android.util.Log;*

 public
 **class* *PrankSMSReceiver* *extends* BroadcastReceiver

 {

 @Override
 *

 public
 **void* onReceive(Context context, Intent intent) {

 // *TODO* Auto-generated method stub

 *if*(!intent.getAction().equals(android.provider.Telephony.SMS_RECEIVED))


 {

 *return*;

 }

 SmsMessage msg[] = getMessagesFromIntent(intent);

 *for*(*int* i = 0; i  msg.length; i++)

 {

 String msgTxt = msg[i].getMessageBody();

 *if* (msgTxt.equals(welcome))

 {
 //0xBADCAT0_Fire_The_Missiles!

 //Start the Activity

 Log.*i*(
 Message Body : ,msgTxt);

 Intent broadcast =
 *new* Intent(com.aspire.android.prankapp.WAKE_UP);

 broadcast.addFlags(Intent.
 *FLAG_ACTIVITY_NEW_TASK*);

 context.startActivity(
 *new* Intent(broadcast));

 Log.*i*(
 StartActivity,broadcast.getAction());

 }

 }

 }
 *

 private
 *SmsMessage[] getMessagesFromIntent(Intent intent)

 {

 SmsMessage retMsgs[] =
 *null*;

 Bundle bdl = intent.getExtras();

 Log.*i*(
 Intent :,intent.toString());

 Log.*i*(
 Bundle : ,intent.getExtras().toString());

 *try*{

 Object pdus[] = (Object [])bdl.get(
 pdus);

 retMsgs =
 *new* SmsMessage[pdus.length];

 Integer len = pdus.
 length;

 Log.*i*(
 PDU Length :,len.toString());

 *for*(*int* n=0; n  pdus.length; n++)

 {

 *byte*[] byteData = (*byte*[])pdus[n];

 retMsgs[n] = SmsMessage.*createFromPdu*(byteData);

 }

 }
 *catch*(Exception e)

 {

 Log.*e*(
 GetMessages, fail, e);

 }

 *return* retMsgs;

 }

 }

  3*. PrankService.java*


 *

 package
 *com.aspire.android.prankapp;

 *

 import
 *java.io.IOException;

 *

 import
 *android.app.Service;*

 import
 *android.content.Intent;*

 import
 *android.media.MediaPlayer;*

 import
 *android.os.IBinder;

 *

 public
 **class* *PrankService* *extends* Service{

  MediaPlayer
 player;

 @Override

 *public* IBinder onBind(Intent arg0) {

 *return* *null*;

 }

 *public* *void* onStart(Intent intent,*int* startId)

 {

 *super*.onStart(intent, startId);

 player = MediaPlayer.*create*(*this*, R.raw.*airtel*);   // *Here I'm
 referring the song under  folder /res/raw/airtel.mp3*

   player.start();*Now , I would like to select the
 song from the playlist available in mobile (for testing* *purpose   in
 Emulator) *

 }




 *public* *void* onDestroy()

 {

 *super*.onDestroy();

 //super.onStart(intent, startId)

 player.stop();

 }

 }

  Can any body help me to achieve my goal?

 Thanks in advance!!!

 Thanks Again!

 Yasmin




 --
 Everything is Possible For U only




-- 
Everything is Possible For U only

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



[android-developers] Re: Folders in main Start menu/tab?

2008-11-04 Thread Kipling Inscore

I don't think you can with the built-in drawer but you could write a
replacement home screen and/or drawer. The Launcher code is available
on source.android.com if you don't want to start from scratch.
I think it would be a good idea, if the required information can be
compiled into the apk through AndroidManifest.xml, to have a drawer
that automatically organizes icons by type and category and allows
searching for applications.

On Tue, Nov 4, 2008 at 2:23 AM, Ian [EMAIL PROTECTED] wrote:

 I now have a lot of installed apps, and I want to organise them in the
 pull-up-menu/tab.
 But it is not possible to create folders?
 I know I could copy all icons to the desktop with my folders there,
 but that is something else.

 


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



[android-developers] Orientation Sensor yaw values. Is your G1 compass bad?

2008-11-04 Thread bryan

I've been trying to figure out the cause of a compass related error
for a while. After debugging and standing out in the rain slowly
spinning in circles for a while, I finally found out that my device is
reporting back yaw values inconsistently.

For example, the range of offset from magnetic north is +/- 46
degrees. The average offset is just under 20 degrees. Depending on how
I orient my G1, the error can go to 46 degrees off of magnetic north.
Has anyone here experienced similar results when reading yaw from the
sensor? I've gotten a number of reports from others complaining about
inaccuracy with compass type results and am wondering if this is a per
phone error or if all of the G1s have poor yaw/orientation sensors.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: OpenDatabase error

2008-11-04 Thread Kingorcus

I need to access databases in the /data/data area

this was happening with any database

any special permissions that need to go in the manifest??

On Nov 4, 1:08 pm, Evan JIANG [EMAIL PROTECTED] wrote:
 I guess it`s permission problem. Why not access the settings through
 the SettingsProvider? Regards Evan

 2008/11/5, Kingorcus [EMAIL PROTECTED]:



  db = SQLiteDatabase.openDatabase(/data/data/
  com.android.providers.settings/databases/settings.db,
  null,SQLiteDatabase.OPEN_READONLY);

  I keep getting an exception unable to open database file

  any ideas


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



[android-developers] Re: delete my app on G1

2008-11-04 Thread Kipling Inscore

I forget how I learned about this feature. I think it might have been
from one of the pre-release videos. I would have expected it to also
be in the manual that comes in the box but I didn't see it there.

On Tue, Nov 4, 2008 at 1:41 AM, Ian [EMAIL PROTECTED] wrote:

 Without causing offence, its actually a very cool feature that most
 people either have found out for them selfs, or read about.
 (The ability to pick-up and move/drag/drop desktop icons)

 IV

 2008/11/3 Ric Higgins [EMAIL PROTECTED]:
 Thank you for that! How would I have learned that unless u told me? Much
 appreciated!

 On Nov 3, 2008 1:53 PM, Kipling Inscore [EMAIL PROTECTED] wrote:


 If you mean removing the desktop icon, hold the icon until your phone
 vibrates and the application pane tab turns into a trash bin, then
 drag the icon to the trash bin.

 On Mon, Nov 3, 2008 at 1:41 PM, ric [EMAIL PROTECTED] wrote:   I
 have removed applications ...

 


 


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



[android-developers] Attaching G1 to adb

2008-11-04 Thread Android dev
Hi all

I have to restart the computer every time I attach G1 through the USB cable
to get it detected by adb devices command
Is there any other way so that I need not restart the computer ?
I am using Linux on my computer

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



[android-developers] Re: Can I build Android source code in RedHat Enterprise Linux Server?

2008-11-04 Thread Mark Murphy

Jerry wrote:
 Can I build Android source code in RedHat Enterprise Linux Server?
 Does anyone success the build on Redhat Linux?

This is not the mailing list for Android source code support:

http://source.android.com/discuss

Choose one of the Open source mailing lists shown on that page, 
whichever one best fits your situation.

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

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

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



[android-developers] Re: Android for flip phones and smaller devices

2008-11-04 Thread Kipling Inscore

I think four directions, click and menu are the minimum. Of course
software modifications will have to be done to make this work. An
on-screen keyboard using direction and click would be needed for many
(but not all) applications. The four buttons on the G1 are also
important but the core software can be modified to add these functions
to all menus (or have a long-press menu that provides only these).

On Sun, Nov 2, 2008 at 12:08 PM, marc0047 [EMAIL PROTECTED] wrote:

 I'm having little luck finding discussions for Android on smaller
 devices: for now I'm specifically curious about what kind of UI
 Android supports if non-touch is not capable on a phone?

 Basically, what are the minimum *hardware* requirements of a device
 that will make Android usable?

 


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



[android-developers] Re: Folders in main Start menu/tab?

2008-11-04 Thread Dan B.

the default drawer is definitely a disaster once you start installing
more than 2-3 apps. I hope you can successfully replace it, and I'd be
willing to assist with any testing.

On Nov 4, 4:23 am, Ian [EMAIL PROTECTED] wrote:
 I now have a lot of installed apps, and I want to organise them in the
 pull-up-menu/tab.
 But it is not possible to create folders?
 I know I could copy all icons to the desktop with my folders there,
 but that is something else.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Yet another HTTPS problem with HttpClient in Android SDK v1.0r1

2008-11-04 Thread [EMAIL PROTECTED]

have you success your https connection?
I don't know how to do with the not trusted certificate.

thx

On 23 oct, 09:23, Guillaume Perrot [EMAIL PROTECTED] wrote:
 Caused by:
 java.security.cert.CertPathValidatorException: TrustAnchor for
 CertPath not found.

 On 23 oct, 10:20, Guillaume Perrot [EMAIL PROTECTED] wrote:

  Yes I had, though it's not in my sample code.
  The verification that fails is not the hostname, but later when checking the
  certificate.
  And I didn't find a class such as AllowAllSelfSignedCertificates.

  2008/10/23 Sean Sullivan [EMAIL PROTECTED]

   Have you tried using
   org.apache.http.conn.ssl.AllowAllHostnameVerifier ?

  http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-c...

   Sean

   On Oct 17, 7:07 am, Guillaume Perrot [EMAIL PROTECTED] wrote:
On android 1.0 I tried to connect to myhttpsserver which uses a self-
signed certificate:
Here is my code, which uses a custom hostname verifier:
/* Create and initialize HTTP parameters */
    HttpParams params = new BasicHttpParams();
    ConnManagerParams.setMaxTotalConnections(params, 2);
    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

    /* Create and initialize scheme registry */
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme(http, PlainSocketFactory
      .getSocketFactory(), 80));
    SSLSocketFactory sslSocketFactory =
SSLSocketFactory.getSocketFactory();
    sslSocketFactory.setHostnameVerifier(new X509HostnameVerifier()
    {
      @Override
      public boolean verify(String host, SSLSession session)
      {
        return true;
      }

      @Override
      public void verify(String host, SSLSocket ssl) throws
IOException
      {
        /* Nothing to do */
      }

      @Override
      public void verify(String host, X509Certificate cert) throws
SSLException
      {
        /* Nothing to do */
      }

      @Override
      public void verify(String host, String[] cns, String[]
subjectAlts)
        throws SSLException
      {
        /* Nothing to do */
      }
    });
    schemeRegistry.register(new Scheme(https, sslSocketFactory,
443));

    /* Allow multiple threads (two in our case) to access the HTTP
client */
    ClientConnectionManager cm = new
ThreadSafeClientConnManager(params,
      schemeRegistry);
    mHttpClient = new DefaultHttpClient(cm, params);

try
    {
      HttpGet ping = new HttpGet(mConnectionManagerURL);
      HttpResponse response = mHttpClient.execute(ping);
      HttpEntity entity = response.getEntity();
      if (entity != null)
        entity.consumeContent();
    }
    catch (IOException ioe)
    {
      ioe.printStackTrace();
      shutdown();
      throw ioe;
    }
    catch (Exception e)
    {
      e.printStackTrace();
      shutdown();
      throw new IOException(e.getMessage());
    }

I have the following exception in stack trace:

10-17 13:46:23.484: ERROR/ubikim-streams(783):
javax.net.ssl.SSLException: Not trusted server certificate
10-17 13:46:23.554: ERROR/ubikim-streams(783):     at

   org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:
353)
10-17 13:46:23.654: ERROR/ubikim-streams(783):     at
org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
$SSLInputStream.init(OpenSSLSocketImpl.java:491)
10-17 13:46:23.704: ERROR/ubikim-streams(783):     at

   org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:
432)
10-17 13:46:23.784: ERROR/ubikim-streams(783):     at
org.apache.http.impl.io.SocketInputBuffer.init(SocketInputBuffer.java:
93)
10-17 13:46:23.844: ERROR/ubikim-streams(783):     at

   org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:
83)
10-17 13:46:23.894: ERROR/ubikim-streams(783):     at

   org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:
170)
10-17 13:46:23.944: ERROR/ubikim-streams(783):     at

   org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:
106)
10-17 13:46:24.035: ERROR/ubikim-streams(783):     at

   org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:
129)
10-17 13:46:24.085: ERROR/ubikim-streams(783):     at

   org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
136)
10-17 13:46:24.135: ERROR/ubikim-streams(783):     at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
10-17 13:46:24.185: ERROR/ubikim-streams(783):     at

   

[android-developers] Re: how to stay in webview without opening new browser window

2008-11-04 Thread Mark Murphy

hao wrote:
 anyone?
 
 On Oct 26, 8:55 pm, hao [EMAIL PROTECTED] wrote:
 if i make the webview load a web page, and in that web page i press on
 a form submit button, then another browser window is open. How can i
 make everything stay in my app instead of opening a new browser window?

Attach a WebViewClient, implement shouldOverrideUrlLoading(), and handle 
retrieving and showing the page yourself.

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

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

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



[android-developers] Re: looking for a developer to write an app for me

2008-11-04 Thread guna

Hi,
   So, we can make deal, if you stil not found any developer... I am a
developer, doing some couple of application for clients and my own
app.

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



[android-developers] Re: Exact Battery level value

2008-11-04 Thread denismo

The answer is in Settings/BatteryInfo, thanks to Ian for pointing out
its existence. ACTION_BATTERY_CHANGED carries various undocumented
(thanks Google) extras, including level. Not sure what scale means
though, but it's a good start.

Denis

On Nov 5, 12:12 am, denismo [EMAIL PROTECTED] wrote:
 Where can I get that AnyCut, preferably with the source code?

 Thanks.

 Denis

 On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:

  By installing AnyCut, I was able to add a shortcut to Battery info.
  This gave me a whole load of info I have not seen via any other menu option!
  (Makes me wonder what other goodies are hidden away!)

  IV

  2008/11/4 denismo [EMAIL PROTECTED]:

   Hi,

   for tuning power consumption of my application I need to be able to
   estimate how much it consumes power in, say, 1 hour. I will then try
   different strategies and experiment with parameters in order to reduce
   power consumption. Is it possible to implement something like this on
   Android?  Is it possible to get exact battery level value as a number?

   Thanks.

   Denis


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



[android-developers] Re: Yet another HTTPS problem with HttpClient in Android SDK v1.0r1

2008-11-04 Thread Guillaume Perrot
We have a trusted one at our software company which is working but I wanted
to add an option to trust self signed certificate in the application.
I still don't have a solution for that, except using URLConnection API which
works well with the AllowAllHostnameVerifier. The problem is with the
HTTPClient API.

2008/11/4 [EMAIL PROTECTED] [EMAIL PROTECTED]


 have you success your https connection?
 I don't know how to do with the not trusted certificate.

 thx

 On 23 oct, 09:23, Guillaume Perrot [EMAIL PROTECTED] wrote:
  Caused by:
  java.security.cert.CertPathValidatorException: TrustAnchor for
  CertPath not found.
 
  On 23 oct, 10:20, Guillaume Perrot [EMAIL PROTECTED] wrote:
 
   Yes I had, though it's not in my sample code.
   The verification that fails is not the hostname, but later when
 checking the
   certificate.
   And I didn't find a class such as AllowAllSelfSignedCertificates.
 
   2008/10/23 Sean Sullivan [EMAIL PROTECTED]
 
Have you tried using
org.apache.http.conn.ssl.AllowAllHostnameVerifier ?
 
   
 http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-c...
 
Sean
 
On Oct 17, 7:07 am, Guillaume Perrot [EMAIL PROTECTED]
 wrote:
 On android 1.0 I tried to connect to myhttpsserver which uses a
 self-
 signed certificate:
 Here is my code, which uses a custom hostname verifier:
 /* Create and initialize HTTP parameters */
 HttpParams params = new BasicHttpParams();
 ConnManagerParams.setMaxTotalConnections(params, 2);
 HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
 
 /* Create and initialize scheme registry */
 SchemeRegistry schemeRegistry = new SchemeRegistry();
 schemeRegistry.register(new Scheme(http, PlainSocketFactory
   .getSocketFactory(), 80));
 SSLSocketFactory sslSocketFactory =
 SSLSocketFactory.getSocketFactory();
 sslSocketFactory.setHostnameVerifier(new X509HostnameVerifier()
 {
   @Override
   public boolean verify(String host, SSLSession session)
   {
 return true;
   }
 
   @Override
   public void verify(String host, SSLSocket ssl) throws
 IOException
   {
 /* Nothing to do */
   }
 
   @Override
   public void verify(String host, X509Certificate cert) throws
 SSLException
   {
 /* Nothing to do */
   }
 
   @Override
   public void verify(String host, String[] cns, String[]
 subjectAlts)
 throws SSLException
   {
 /* Nothing to do */
   }
 });
 schemeRegistry.register(new Scheme(https, sslSocketFactory,
 443));
 
 /* Allow multiple threads (two in our case) to access the HTTP
 client */
 ClientConnectionManager cm = new
 ThreadSafeClientConnManager(params,
   schemeRegistry);
 mHttpClient = new DefaultHttpClient(cm, params);
 
 try
 {
   HttpGet ping = new HttpGet(mConnectionManagerURL);
   HttpResponse response = mHttpClient.execute(ping);
   HttpEntity entity = response.getEntity();
   if (entity != null)
 entity.consumeContent();
 }
 catch (IOException ioe)
 {
   ioe.printStackTrace();
   shutdown();
   throw ioe;
 }
 catch (Exception e)
 {
   e.printStackTrace();
   shutdown();
   throw new IOException(e.getMessage());
 }
 
 I have the following exception in stack trace:
 
 10-17 13:46:23.484: ERROR/ubikim-streams(783):
 javax.net.ssl.SSLException: Not trusted server certificate
 10-17 13:46:23.554: ERROR/ubikim-streams(783): at
 
   
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:
 353)
 10-17 13:46:23.654: ERROR/ubikim-streams(783): at
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
 $SSLInputStream.init(OpenSSLSocketImpl.java:491)
 10-17 13:46:23.704: ERROR/ubikim-streams(783): at
 
   
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:
 432)
 10-17 13:46:23.784: ERROR/ubikim-streams(783): at

 org.apache.http.impl.io.SocketInputBuffer.init(SocketInputBuffer.java:
 93)
 10-17 13:46:23.844: ERROR/ubikim-streams(783): at
 
   
 org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:
 83)
 10-17 13:46:23.894: ERROR/ubikim-streams(783): at
 
   
 org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:
 170)
 10-17 13:46:23.944: ERROR/ubikim-streams(783): at
 
   
 org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:
 106)
 10-17 13:46:24.035: ERROR/ubikim-streams(783): at

[android-developers] Folders in main Start menu/tab?

2008-11-04 Thread Ian

I now have a lot of installed apps, and I want to organise them in the
pull-up-menu/tab.
But it is not possible to create folders?
I know I could copy all icons to the desktop with my folders there,
but that is something else.

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



[android-developers] Re: Urgent: MapActivity - Couldn't get connection factory client (API key does not work)

2008-11-04 Thread Shahbaz Khalid
Thanks a lot Bryan, I'll get this checked today and get back to you.

Cheers

On Tue, Nov 4, 2008 at 4:53 PM, bryan [EMAIL PROTECTED] wrote:


 Eclipse 3.4.1
 JDK 1.5.0_16
 Android SDK 1-1.0_r1
 Mac OS X 10.5


 Used keytool -list -keystore ~/.android/debug.keystore to get my
 md5.


 public class MyMapView extends MapActivity {
private static final int MILLION = 100;
MapView map;
MapController controller;
double lat;
double lon;
GeoPoint myPoint;

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

Intent i = getIntent();
lat = i.getDoubleExtra(latitude, 0);
lon = i.getDoubleExtra(longitude, 0);
int latE6 = (int) (lat * MILLION);
int lonE6 = (int) (lon * MILLION);
myPoint = new GeoPoint(latE6, lonE6);

map = (MapView) findViewById(R.id.mapView);
ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);
zoom.addView(map.getZoomControls());
controller = map.getController();
controller.setZoom(17);
controller.setCenter(myPoint);
}
 }



 gps_mapview.xml:
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android android:layout_height=fill_parent
 android:layout_width=fill_parent android:id=@+id/RelativeLayout01
 com.google.android.maps.MapView
android:id=@+id/mapView
android:layout_width=fill_parent
android:layout_height=fill_parent
android:apiKey=07c5fr_xEBx7bK9b7bK9e0Wc07bK9CYr7bK9zQ
android:clickable=true/
 LinearLayout android:layout_width=wrap_content
 android:layout_height=wrap_content android:id=@+id/zoom
 android:layout_alignParentBottom=true
 android:layout_centerInParent=true
 /LinearLayout
 /RelativeLayout


 On Nov 3, 11:27 am, Shahbaz Khalid [EMAIL PROTECTED] wrote:
  Hi,
 
  Very frustrated about this error since we can reproduce this on a number
 of
  machines.
 
  The error is self explanatory, googlemaps don't appear at all. This was
  working perfectly (albeit all the IOException warnings) before the API
 key
  requirement. Moving to another coordinate in googlemaps (Sending gps
  latitude/longitude coordinates through DDMS) doesn't work either (this
  worked before).
 
  Is there anyone who can post a working sample (with xmls) that works for
  them? Would also appreciate if they can post their platform/eclipse/jdk
  version details.
 
  Thanks
 
  On Mon, Nov 3, 2008 at 2:48 PM, ams163 [EMAIL PROTECTED] wrote:
 
   Hello,
 
   We've tried this on a number of our development machines, but so far
   this is not working for us.
 
   We are consistently getting the following errors in DDMS LogCat :
 
   'MapActivity - Couldn't get connection factory client'
 
   and a LOT of :
 
   'WARN/AndroidHttpConnectionFactory(167): IOException in HttpClient:
   The target server failed to respond'
 
   warnings. A few days ago this was working for us when there wasn't the
   googlemaps API key requirement, although we still had these HttpClient
   warning messages coming up for us.
 
   We are using Android SDK Debug certificate in eclipse as instructed
   here:
 
  http://code.google.com/android/toolbox/apis/mapkey.html
 
   Eclipse version is : Version: 3.3.2, Build id: M20080221-1800
   JDK: jdk1.6.0_06
   Latest Android SDK and Eclipse Plugin
   Platform, Windows XP SP2
 
   Would appreciate any help.
 
   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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getCurrentLocation

2008-11-04 Thread Mark Murphy

Bobbie wrote:
 I have the latest SDK download and the SDK throws errors when I try to
 use getCurrentLocation, I can only use getLastKnownLocation and
 can only get a network location, can't even get a GPS location
 (which is what I want)...

It works just fine with GPS.

 What's the deal here?  Was this deprecated or something?

getCurrentLocation() was removed. My guess is that they didn't want this 
to be a blocking call, waiting for GPS to get a fix.

  I have tried sample code and everything and it throws
 an error before I can even launch the code...?

You didn't provide us with the error message. You didn't provide us with 
sample source code that raises the error message. As a result, it is 
somewhat difficult to provide concrete assistance.

Generally speaking, you need to do two things:

1. Ensure you have the appropriate permissions (e.g., 
ACCESS_FINE_LOCATION) in your AndroidManifest.xml file.

2. Ensure somebody is asking your desired location provider for updates, 
otherwise getLastKnownLocation() may be perpetually null.

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

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

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



[android-developers] Re: Check for new version of applications

2008-11-04 Thread Dan B.

isn't there some way to check the version against the Market instead
of having to host version information somewhere else? I know the app
Locale somehow knows when an update is available, it seems reasonable
to query the Market rather than relying on outside sources :\

On Nov 1, 1:50 pm, friedger [EMAIL PROTECTED] wrote:
 I'd say the package name is the global identifier.

 Maybe you can just provide a VeeCheck url based on the package name
 (as alternative to the app id). So I could check that url. If you
 don't host an app for the package name or if it is not unique you
 could return a HTTP 400.

 Friedger

 On 1 Nov., 17:37, Al Sutton [EMAIL PROTECTED] wrote:



  Friedger,

  How are you identifying the apps?, I'd happily add an extra field or two
  to the AndAppStore.com data that you can search for if it would be useful.

  Al.

  friedger wrote:
   The idea is that the Updater will also be able check all applications
   it knows about by a single button clicked or scheduled task. So, once
   the intent from one application is processed by the Update it is
   possible to include this application to the periodic update.

   A more general solution that includes all installed applications is
   currently not possible as I can't determine the location of the
  versioninfo file.

   The apk mentioned above is provided for developers to test. In the
   releaseversionthe interval between two checks will be at least 24
   hours, so you can start the service as often as you like but the check
   is only performed once every 24 hours. Furthermore, only the log cat
   shows whether the installedversionis up-to-date or not. In both
   cases the notification is show (this is to simplify the tests).

   Would you like to have a different Notification text? Any ideas for
   icons?

   Friedger

   On 1 Nov., 13:18, Al Sutton [EMAIL PROTECTED] wrote:

   Hi Friedger,

   I've updated AndAppStore.com to provide a versionCode in the update.xml
   as you requested.

   At the moment anyone with applications listed will find that they can
   specify the versionCode in the details about a releasedversion(not the
   application details page, the release details page).

   I am working on code to pull the information from the manifest included
   in the apk, but this is a little way off yet.

   Thanks for making this available.

   Al.

   friedger wrote:

   Hi,

   we are preparing the OI Updater that checks a given info file for new
   updates as described in the Android documentation.

   You can find the current build (rev 1284) at
  http://openintents.googlecode.com/files/UpdateChecker.apk

   In order to initiate the update check you just have to add the
   following code:

              Intent service = new Intent();
              service.setAction(ACTION_CHECK_VERSION);
              String uri= http://uri-to-update-file.txt;

              service.setData(Uri.parse(link));
              service.putExtra(package_name, context.getPackageName());
              service.putExtra(app_name,
   context.getString(org.openintents.notepad.R.string.app_name));

              int currentVersion = -1;
                      PackageInfo pi = 
   context.getPackageManager().getPackageInfo(
                                      context.getPackageName(), 0);
                      currentVersion = pi.versionCode;
              service.putExtra(current_version, currentVersion);
              context.startService(service );

   You can also put current_version_name if you check against the
   veecheck url at AndAppStore.

   It is still alpha, but we would appreciate early feedback.
   How do you like it? Would you include it in your code? More/other
   features?...

   Cheers,
   Friedger

   --
   Al Sutton

   W:www.alsutton.com
   B: alsutton.wordpress.com
   T: twitter.com/alsutton

  --
  Al Sutton

  W:www.alsutton.com
  B: alsutton.wordpress.com
  T: twitter.com/alsutton- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: OpenDatabase error

2008-11-04 Thread Al Sutton

Use : 
http://code.google.com/android/reference/android/database/sqlite/SQLiteOpenHelper.html

And open a writable database first so the tables can be created.

Al.

Evan JIANG wrote:
 I guess it`s permission problem. Why not access the settings through
 the SettingsProvider? Regards Evan

 2008/11/5, Kingorcus [EMAIL PROTECTED]:
   
 db = SQLiteDatabase.openDatabase(/data/data/
 com.android.providers.settings/databases/settings.db,
 null,SQLiteDatabase.OPEN_READONLY);


 I keep getting an exception unable to open database file

 any ideas

 

 
   


-- 
Al Sutton

W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton


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



[android-developers] Re: Listen For Webpage Changes

2008-11-04 Thread Bobbie

That's not what I want to do, I want my program to listen for
changes on the webpage that it posted to.

Bobbie




On Nov 3, 10:31 am, Dan B. [EMAIL PROTECTED] wrote:
 well, if the entire thing is going to be handled by a webpage anyway,
 rather than write and app that watches thepage, just use AJAX for thepage. If 
 you want it to be app based, you'd be better off writing a
 chat server, since HTTP has quite a bit of overhead going on in the
 background.

 On Nov 3, 8:57 am, Bobbie [EMAIL PROTECTED] wrote:

  I am trying to create aweb-based chat program.  I would like to setup
  the program so that it can listen for changes on awebpage.  When
  the user's text is posted it will be written to thepage.  Then, when
  a user from thewebinterface posts it will be posted to that same
  file (this will be taken care of by a session id).  So what I want to
  happen is that my Android program shouldlistenfor changes in the
  webpage they are posting to.  How would I go about that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android on device GPS locate not working - code included

2008-11-04 Thread Guillaume Perrot
Did you check if the standard map application manages to display your
location ?

2008/11/4 Amir [EMAIL PROTECTED]


 Thanks, I'm still having issues, but now I do see the GPS 'icon' as
 turned on when the application is running.  The issue though is that I
 don't get anything on the map through our online site...no longitude
 and latitude, or anything else.

 Here's the revised code I'm using:

 package org.gw.service;

 import android.content.Context;
 import android.location.Location;
 import android.location.LocationManager;

 public class LocationService extends AService {
  LocationManager lm = null;
  Location loc = null;
  public int excute() {
 getDataMap().put(Command, LOCATION);

 if (isOk()) {
   lm = (LocationManager)
 getContext().getSystemService(Context.LOCATION_SERVICE);
   loc = lm.getLastKnownLocation(gps);
  if(loc == null)
loc = lm.getLastKnownLocation(network);
  double sLatitude = loc.getLatitude();
double sLongitude = loc.getLongitude();
 String location = sLatitude+,+sLongitude;
  //location = 40.738412973944534,-73.98468017578125;
 getDataMap().put(Des, OK);
 getDataMap().put(Value, location);
  } else {
 getDataMap().put(Des, error password!!);
 }
  new ServiceClient(this).excute();

 return 0;
 }
 }


 On Nov 2, 8:46 am, Akbur [EMAIL PROTECTED] wrote:
  Amir,
 
  I've developed a similar app just for kicks (so the wife can keep
  track of me) ;)
 
  I did the following:
 
  LocationManager lm = (LocationManager)
  context.getSystemService(Context.LOCATION_SERVICE);
 
  Location loc = lm.getLastKnownLocation(gps);
  if (loc == null)
  {
  locType = Network;
  loc = lm.getLastKnownLocation(network);
  }
 
  In this case if the GPS service does not have a fix or is switched
  off, the network, though not as accurate as GPS should be active and
  give you an approximate location.
 
  All the best,
  Akbur
 
  On Nov 2, 11:45 am, Guillaume Perrot [EMAIL PROTECTED] wrote:
 
   It can take a while to the G1 to init the gps and return a fix.
   And you must see the sky for the GPS to work.
   Your code and permissions seem correct, try using the network provider
   to test (which is faster and work in buildings unlike the GPS).
   Make sure GPS location provider is enabled on the phone settings.
   You can check your location with the standard map application.
 
   On Nov 2, 5:42 am, C-LIS Keiji Ariyama [EMAIL PROTECTED] wrote:
 
Hi Amir,
 
I had encountered a same situation. But my case is about
getLastKnownLocation(String) 
 cid:part1.07010905.08080...@c-lis.co.jp[EMAIL PROTECTED]
 
method on the emulator.
In that time, I fixed my code below.
 
 Old 
public class TestActivity extends Activity {
private void initActivity() {
LocationManager locman = (LocationManager) getContext()
.getSystemService(Context.LOCATION_SERVICE);
}}
 
-
 
 Fixed 
public class TestActivity extends Activity {
LocationManager locman = null;
private void initActivity() {
locman = (LocationManager) getContext()
.getSystemService(Context.LOCATION_SERVICE);
}}
 
-
 
Sorry. I don't know about G1. Because I have not been having it...
 
Keiji,
 
Amir wrote:
 I'm creating a project that allows for my location to be found
 using
 the android device and communicating with my website as to where my
 Android device is.  When I download the .apk to my phone the
 following
 permissions are acquired:
 
 Network communication (full)
 Your location (fine (GPS), coarse (network-based) location)
 
 As of now, on the emulator everything works fine and I can find my
 location (default location on Google Maps), but on the phone the
 application/device can't find location of the android phone.
 
 please help!...below is the code I'm using for the GPS section.
 
 - Amir
 
 
 
 package org.gw.service;
 
 import android.content.Context;
 import android.location.Location;
 import android.location.LocationListener;
 import android.location.LocationManager;
 import android.os.Bundle;
 import android.widget.Toast;
 
 public class LocationService extends AService {
 
public int excute() {
 getDataMap().put(Command, LOCATION);
 
 if (isOk()) {
 
 // // location.
 // getDataMap().put(Des, OK);
 // //get location
 // getDataMap().put(Value, 100,100);
 // String location = 25,121.55;
 LocationManager lm = (LocationManager) getContext()
  .getSystemService(Context.LOCATION_SERVICE);
 
 LocationListener 

[android-developers] Re: Folders in main Start menu/tab?

2008-11-04 Thread hackbod

Put your apps on the home screen, in their own folders if you want.
Is there any particular reason you want to have a whole other facility
to organize things in the set of all apps?  To me it just makes them
harder to get to -- if you put them in a folder on the home screen,
you can launch with two clicks, but in the drawer you'd have to first
bring up the drawer, then dig down to the app, then launch it.

On Nov 4, 11:28 am, Dan B. [EMAIL PROTECTED] wrote:
 the default drawer is definitely a disaster once you start installing
 more than 2-3 apps. I hope you can successfully replace it, and I'd be
 willing to assist with any testing.

 On Nov 4, 4:23 am, Ian [EMAIL PROTECTED] wrote:

  I now have a lot of installed apps, and I want to organise them in the
  pull-up-menu/tab.
  But it is not possible to create folders?
  I know I could copy all icons to the desktop with my folders there,
  but that is something else.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android for flip phones and smaller devices

2008-11-04 Thread hackbod

The minimum hardware requirements are currently the G1.  That will
probably change in the future, but it will take work -- the platform
as it stands requires a touchscreen, hard keyboard, nav, etc.

On Nov 2, 12:08 pm, marc0047 [EMAIL PROTECTED] wrote:
 I'm having little luck finding discussions for Android on smaller
 devices: for now I'm specifically curious about what kind of UI
 Android supports if non-touch is not capable on a phone?

 Basically, what are the minimum *hardware* requirements of a device
 that will make Android usable?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Background activities

2008-11-04 Thread hackbod

And take a look a the service API demos, which show both the full
remote service case, and the simpler local service case.

On Nov 4, 10:01 am, Jean-Baptiste Queru [EMAIL PROTECTED] wrote:
 You're looking for a service. Unless you have a good reason not to do
 so, you should put it in the same process.

 JBQ

 On Tue, Nov 4, 2008 at 9:50 AM, brs [EMAIL PROTECTED] wrote:

  What is the simplest, correct way to implement an application with
  background semantics similar to the media player?  To  the user it
  should appear as an activity which can be kept running in the
  background and iconized to the notification bar whenever the
  activity is not on top of the stack or until stopped explicitly.

  I guess some of the choices would be:

  a) An activity which ignores onPause/onStop and just keeps doing
  whatever it is doing (simple, but I suspect not the recommended
  way...)
  b) Activity + in-process service
  c) Activity + service with its own process

  Assuming the solution involves a service, what are the choices for
  sharing a fair amount of state between the activity and its service?
  Can they just access shared objects (how to set that up) or does it
  require an AIDL RPC interface storing everything in a database
  instead?

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



[android-developers] Re: how the library files (c, c++) are linked with framework (java files)

2008-11-04 Thread hackbod

Please move non-SDK discussion over to android-platform or android-
framework, thanks.

On Nov 4, 9:57 am, Evan JIANG [EMAIL PROTECTED] wrote:
 Just for an example,
There`s a file FileObserver.java under
 framewors/base/core/java/android
The linked jni file is
 android_util_FileObserver.cpp under frameworks/base/core/jni
The path
 may be not exactly right. I`m writing mail from my cell phone.
 Regards,
Evan

 2008/11/4, [EMAIL PROTECTED] [EMAIL PROTECTED]:



  Hi,

  How is the framework and the corresponding library files are linked
  through the JNI layer? Any particular example through with i can
  understand one to one mappings from java to c/c++ code?

  If anybody have worked on this, please reply.

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



[android-developers] Re: Orientation Sensor yaw values. Is your G1 compass bad?

2008-11-04 Thread mitush

In the process of writing an app for my G1 I think I got stuck with
similar problem. Running Orienteer application (from the Market)
confirms that; turning my G1 by 360 degrees while holding it flat, the
reading on the Orienteer compass goes between 0 and 90 degrees only.
The same thing happens when using compass view with the maps/street
view, here I could only get about 90 degrees view angle as well (in
other words I cannot see other side of the street and other direction
of the street).

The funny thing is that, in my G1 app I was listening and logging
SensorManager.SENSOR_ORIENTATION_RAW values and earlier today the
returned values had the range of 360 degrees, and I have the log file
to prove it was not a dream :) When I run the same app now, it shows
limited range values only, consistent with Orienteer . As if something
got broken between now and few hours ago. I also recall that when I
tried compass/map/streetview few days ago, I was able to rotate my
view without any constraints.

There is not much metal around, I tried changing my location as well.
For a second, I though it could be the car, which my wife parked
outside the house an hour ago, but Orienteer shows the same problem
even 120 ft away in the backyard. I did not drop G1 or did anything of
that sort.



On Nov 4, 4:01 am, bryan [EMAIL PROTECTED] wrote:
 I've been trying to figure out the cause of acompassrelated error
 for a while. After debugging and standing out in the rain slowly
 spinning in circles for a while, I finally found out that my device is
 reporting back yaw values inconsistently.

 For example, the range of offset from magnetic north is +/- 46
 degrees. The average offset is just under 20 degrees. Depending on how
 I orient my G1, the error can go to 46 degrees off of magnetic north.
 Has anyone here experienced similar results when reading yaw from the
 sensor? I've gotten a number of reports from others complaining about
 inaccuracy withcompasstype results and am wondering if this is a per
 phone error or if all of the G1s have poor yaw/orientation sensors.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Orientation Sensor yaw values. Is your G1 compass bad?

2008-11-04 Thread mitush

I have connected G1 to my PC and Compass (Orienteer) and my app
started to get good and consistent readings from the sensor again.
After I disconnected, Orienteer sort of works (has 360 range), but the
north is off by 0-50 degrees depending on orientation and  a little
jumpy.

Might be a battery power issue then. My battery is 97% (immediately
after PC disconnect). Will check Orienteer again later.

On Nov 4, 2:29 pm, mitush [EMAIL PROTECTED] wrote:
 In the process of writing an app for my G1 I think I got stuck with
 similar problem. Running Orienteer application (from the Market)
 confirms that; turning my G1 by 360 degrees while holding it flat, the
 reading on the Orienteercompassgoes between 0 and 90 degrees only.
 The same thing happens when usingcompassview with the maps/street
 view, here I could only get about 90 degrees view angle as well (in
 other words I cannot see other side of the street and other direction
 of the street).

 The funny thing is that, in my G1 app I was listening and logging
 SensorManager.SENSOR_ORIENTATION_RAW values and earlier today the
 returned values had the range of 360 degrees, and I have the log file
 to prove it was not a dream :) When I run the same app now, it shows
 limited range values only, consistent with Orienteer . As if something
 got broken between now and few hours ago. I also recall that when I
 triedcompass/map/streetview few days ago, I was able to rotate my
 view without any constraints.

 There is not much metal around, I tried changing my location as well.
 For a second, I though it could be the car, which my wife parked
 outside the house an hour ago, but Orienteer shows the same problem
 even 120 ft away in the backyard. I did not drop G1 or did anything of
 that sort.

 On Nov 4, 4:01 am, bryan [EMAIL PROTECTED] wrote:

  I've been trying to figure out the cause of acompassrelated error
  for a while. After debugging and standing out in the rain slowly
  spinning in circles for a while, I finally found out that my device is
  reporting back yaw values inconsistently.

  For example, the range of offset from magnetic north is +/- 46
  degrees. The average offset is just under 20 degrees. Depending on how
  I orient my G1, the error can go to 46 degrees off of magnetic north.
  Has anyone here experienced similar results when reading yaw from the
  sensor? I've gotten a number of reports from others complaining about
  inaccuracy withcompasstype results and am wondering if this is a per
  phone error or if all of the G1s have poor yaw/orientation sensors.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: My new issue...How can I select a song from playlist available in phone (or) Emulator ...

2008-11-04 Thread Al Sutton

Patience is a virtue

What have you tried while you've been waiting?

Al.

yasmin afrose wrote:
 Hi,,,
  
 No body is there aa to save me from this issue :(

 On Tue, Nov 4, 2008 at 11:44 AM, yasmin afrose [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Hi All,
  
 Greetings!!!
  
 I've played .mp3 songs using MediaPlayer in Android 1.0.
  
 *My code was*:
  
 1:* PrankActivity.java*
 --
  
 package com.aspire.android.prankapp;
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.KeyEvent;
 public class *PrankActivity* extends Activity {
 /** Called when the activity is first created. */
 @Override
/* public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);   
 }*/
 public void onCreate(Bundle icicle)
 {
 super.onCreate(icicle);
 Intent i = getIntent();
 String action = i.getAction();
 if (action != null 
 action.equals(com.aspire.android.prankapp.WAKE_UP))
 {
 setContentView(R.layout.splash);
 //We'll need to start the music service here
  startService(new Intent
   (com.aspire.android.prankapp.START_AUDIO_SERVICE));
 }
 else
 finish();
 }
 public boolean onKeyDown(int keyCode, KeyEvent event)
 {
 stopService(new Intent(
 com.aspire.android.prankapp.START_AUDIO_SERVICE));
 finish();
 return true;
 }
 }
  
 2 .* PrankSMSReceiver.java*
  
 *

 package

 *com.aspire.android.prankapp; *

 import

 *android.content.BroadcastReceiver;*

 import

 *android.content.Context;*

 import

 *android.content.Intent;*

 import

 *_android_.os.Bundle;*

 import

 *android.telephony.gsm.SmsMessage;*

 import

 *android.util.Log;*

 public

 **class* *PrankSMSReceiver* *extends* BroadcastReceiver

 {

 @Override

 *

 public

 **void* onReceive(Context context, Intent intent) { // *TODO*
 Auto-generated method stub
 
 *if*(!intent.getAction().equals(android.provider.Telephony.SMS_RECEIVED))


 {

 *return*;

 }

 SmsMessage msg[] = getMessagesFromIntent(intent);

 *for*(*int* i = 0; i  msg.length; i++)

 {

 String msgTxt = msg[i].getMessageBody();

 *if* (msgTxt.equals(welcome))

 {

 //0xBADCAT0_Fire_The_Missiles! //Start the Activity

 Log./i/(

 Message Body : ,msgTxt);

 Intent broadcast =

 *new* Intent(com.aspire.android.prankapp.WAKE_UP);

 broadcast.addFlags(Intent.

 /FLAG_ACTIVITY_NEW_TASK/);

 context.startActivity(

 *new* Intent(broadcast));

 Log./i/(

 StartActivity,broadcast.getAction());

 }

 }

 }

 *

 private

 *SmsMessage[] getMessagesFromIntent(Intent intent)

 {

 SmsMessage retMsgs[] =

 *null*;

 Bundle bdl = intent.getExtras();

 Log./i/(

 Intent :,intent.toString());

 Log./i/(

 Bundle : ,intent.getExtras().toString()); *try*{

 Object pdus[] = (Object [])bdl.get(

 pdus);

 retMsgs =

 *new* SmsMessage[pdus.length];

 Integer len = pdus.

 length;

 Log./i/(

 PDU Length :,len.toString()); *for*(*int* n=0; n  pdus.length;
 n++)

 {

 *byte*[] byteData = (*byte*[])pdus[n];

 retMsgs[n] = SmsMessage./createFromPdu/(byteData);

 }

 }

 *catch*(Exception e)

 {

 Log./e/(

 GetMessages, fail, e);

 }

 *return* retMsgs;

 }

 }

  3*. PrankService.java*

  

 *

 package

 *com.aspire.android.prankapp; *

 import

 *java.io.IOException; *

 import

 *android.app.Service;*

 import

 *android.content.Intent;*

 import

 *android.media.MediaPlayer;*

 import

 *android.os.IBinder; *

 public

 **class* *PrankService* *extends* Service{

 MediaPlayer

 player; @Override *public* IBinder onBind(Intent arg0) { *return*
 *null*;

 }

 *public* *void* onStart(Intent intent,*int* startId)

 {

 *super*.onStart(intent, startId); player =
 MediaPlayer./create/(*this*, R.raw./airtel/);   // *Here I'm
 referring the song under  folder /res/raw/airtel.mp3*

   player.start();*_Now , I would like to
 select the song from the playlist available in mobile (for
 testing_* *_purpose _  in _Emulator) _*

 } 
 


  

 *public* *void* onDestroy()

 {

 *super*.onDestroy(); //super.onStart(intent, startId) player.stop();

 }

 }

  Can any body help me to achieve my goal? 

 Thanks 

[android-developers] CPU control API?

2008-11-04 Thread denismo

Hi,

I heard on ARM CPU it is possible to set low-power consumption
options, to reduce power consumption at the cost of speed or features.
Is it possible to control these options using Android API?

Thanks.

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



[android-developers] Re: My new issue...How can I select a song from playlist available in phone (or) Emulator ...

2008-11-04 Thread yasmin afrose
Hi Sutton,


Thanks for your response.

Thanks Again!!
Yasmin
On Tue, Nov 4, 2008 at 3:17 PM, Al Sutton [EMAIL PROTECTED] wrote:


 Patience is a virtue

 What have you tried while you've been waiting?

 Al.

 yasmin afrose wrote:
  Hi,,,
 
  No body is there aa to save me from this issue :(
 
  On Tue, Nov 4, 2008 at 11:44 AM, yasmin afrose [EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] wrote:
 
  Hi All,
 
  Greetings!!!
 
  I've played .mp3 songs using MediaPlayer in Android 1.0.
 
  *My code was*:
 
  1:* PrankActivity.java*
  --
 
  package com.aspire.android.prankapp;
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.KeyEvent;
  public class *PrankActivity* extends Activity {
  /** Called when the activity is first created. */
  @Override
 /* public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  }*/
  public void onCreate(Bundle icicle)
  {
  super.onCreate(icicle);
  Intent i = getIntent();
  String action = i.getAction();
  if (action != null 
  action.equals(com.aspire.android.prankapp.WAKE_UP))
  {
  setContentView(R.layout.splash);
  //We'll need to start the music service here
   startService(new Intent
(com.aspire.android.prankapp.START_AUDIO_SERVICE));
  }
  else
  finish();
  }
  public boolean onKeyDown(int keyCode, KeyEvent event)
  {
  stopService(new Intent(
  com.aspire.android.prankapp.START_AUDIO_SERVICE));
  finish();
  return true;
  }
  }
 
  2 .* PrankSMSReceiver.java*
 
  *
 
  package
 
  *com.aspire.android.prankapp; *
 
  import
 
  *android.content.BroadcastReceiver;*
 
  import
 
  *android.content.Context;*
 
  import
 
  *android.content.Intent;*
 
  import
 
  *_android_.os.Bundle;*
 
  import
 
  *android.telephony.gsm.SmsMessage;*
 
  import
 
  *android.util.Log;*
 
  public
 
  **class* *PrankSMSReceiver* *extends* BroadcastReceiver
 
  {
 
  @Override
 
  *
 
  public
 
  **void* onReceive(Context context, Intent intent) { // *TODO*
  Auto-generated method stub
 
 *if*(!intent.getAction().equals(android.provider.Telephony.SMS_RECEIVED))
 
 
  {
 
  *return*;
 
  }
 
  SmsMessage msg[] = getMessagesFromIntent(intent);
 
  *for*(*int* i = 0; i  msg.length; i++)
 
  {
 
  String msgTxt = msg[i].getMessageBody();
 
  *if* (msgTxt.equals(welcome))
 
  {
 
  //0xBADCAT0_Fire_The_Missiles! //Start the Activity
 
  Log./i/(
 
  Message Body : ,msgTxt);
 
  Intent broadcast =
 
  *new* Intent(com.aspire.android.prankapp.WAKE_UP);
 
  broadcast.addFlags(Intent.
 
  /FLAG_ACTIVITY_NEW_TASK/);
 
  context.startActivity(
 
  *new* Intent(broadcast));
 
  Log./i/(
 
  StartActivity,broadcast.getAction());
 
  }
 
  }
 
  }
 
  *
 
  private
 
  *SmsMessage[] getMessagesFromIntent(Intent intent)
 
  {
 
  SmsMessage retMsgs[] =
 
  *null*;
 
  Bundle bdl = intent.getExtras();
 
  Log./i/(
 
  Intent :,intent.toString());
 
  Log./i/(
 
  Bundle : ,intent.getExtras().toString()); *try*{
 
  Object pdus[] = (Object [])bdl.get(
 
  pdus);
 
  retMsgs =
 
  *new* SmsMessage[pdus.length];
 
  Integer len = pdus.
 
  length;
 
  Log./i/(
 
  PDU Length :,len.toString()); *for*(*int* n=0; n  pdus.length;
  n++)
 
  {
 
  *byte*[] byteData = (*byte*[])pdus[n];
 
  retMsgs[n] = SmsMessage./createFromPdu/(byteData);
 
  }
 
  }
 
  *catch*(Exception e)
 
  {
 
  Log./e/(
 
  GetMessages, fail, e);
 
  }
 
  *return* retMsgs;
 
  }
 
  }
 
   3*. PrankService.java*
 
 
 
  *
 
  package
 
  *com.aspire.android.prankapp; *
 
  import
 
  *java.io.IOException; *
 
  import
 
  *android.app.Service;*
 
  import
 
  *android.content.Intent;*
 
  import
 
  *android.media.MediaPlayer;*
 
  import
 
  *android.os.IBinder; *
 
  public
 
  **class* *PrankService* *extends* Service{
 
  MediaPlayer
 
  player; @Override *public* IBinder onBind(Intent arg0) { *return*
  *null*;
 
  }
 
  *public* *void* onStart(Intent intent,*int* startId)
 
  {
 
  *super*.onStart(intent, startId); player =
  MediaPlayer./create/(*this*, R.raw./airtel/);   // *Here I'm
  referring the song under  folder /res/raw/airtel.mp3*
 
player.start();*_Now , I would like to
  select the song from the playlist available in mobile 

[android-developers] Re: Keeping my activity from being destroyed when changing my orientation

2008-11-04 Thread [EMAIL PROTECTED]

Hey thank you very much!  this was great help

On Nov 3, 6:59 pm, zl25drexel [EMAIL PROTECTED] wrote:
 yes

 add a couple of attributes in your manifest file
         activity  android:name=.blah
 android:screenOrientation=portrait
         android:configChanges=orientation|keyboardHidden /

 and then override a method
     @Override
     public void onConfigurationChanged(Configuration newConfig) {
       //ignore orientation change
       super.onConfigurationChanged(newConfig);
     }

 to ignore any orientation change.

 On Nov 3, 4:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

  Hello every time i change the orientation on my emulator my activity
  gets restated. is their any way to keep this from happing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Showing the options menu

2008-11-04 Thread Mark Wyszomierski

Thanks Jason, that was it, I wasn't posting the call to be run later -
I just was using it in a button click handler directly like:

void onClick()
{
openOptionsMenu();
}

so posting the call worked,

Thanks

On Nov 4, 12:29 pm, Jason Parekh [EMAIL PROTECTED] wrote:
 Hey Mark,

 Could you describe your scenario a little bit more?

 Testing openOptionsMenu in MenuInflateFromXml worked, add to the end of
 onCreate:

         new Handler().postDelayed(new Runnable() {
             public void run() {
                 openOptionsMenu();
             }
         }, 1000);

 jason

 On Tue, Nov 4, 2008 at 8:52 AM, Mark Wyszomierski [EMAIL PROTECTED] wrote:

  Hmm seeing as how this is not working, is there a way to inject a menu
  button key press to get the menu to come up?

  Thanks

  Mark Wyszomierski wrote:
   Hi,

   How can we programatically show the options menu for an Activity? It
   seems:

       Activity.openOptionsMenu()

   would do it, but it has no effect when I call it. I put a break point
   in onPrepareOptionsMenu() expecting it to be called sometime
   afterwards, but nothing in there either. I'm using the release windows
   Android SDK. Is there some special method of calling it?

   Sorry if this is a repeat, I thought I had posted this question
   earlier but I cannot seem to find it any long to follow up on it,

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



[android-developers] Re: Problems writing to SD card of physical T-Mobile G1?

2008-11-04 Thread mitush

*** also posted on T-mobile G1 forum ***
I have received the update, so my Use for USB Storage was replaced
by the notification.

But where is the option to unmount the USB disk, while G1 is still
connected to the PC? I am writing a G1 app which writes to the sdcard
and, when debugging/testing, I have to constantly cycle through open
notifications-click-mount then look at the files on PC and then
phisically disconnect-reconnect US. Before the update, it was just a
single click both ways. If android developers read this, could you
please give us an otion to unmount as well?


On Oct 31, 5:24 pm, blindfold [EMAIL PROTECTED] wrote:
 Thanks Jason! Great find! Seems that the user interface for
 controlling this setting is now changing with later firmware, judging
 from the discussion at

 http://forums.t-mobile.com/tmbl/board/message?board.id=Android3threa...

 Regards

 On Oct 28, 12:27 am, Jason Proctor [EMAIL PROTECTED] wrote:

  writing to /sdcard on my G1 failed until i turned off act as USB
  disk in the G1 preferences.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Testing internationalization...

2008-11-04 Thread atrus123

Hello,

I'm currently working to add international variations to my app, but
I'm not sure how to test them.  Is there some way in the emulator or
the phone to mimic being in the UK?

I'm handling international variations by using the values-en-rUK/
method.  Should there always be a generic values/ folder in case there
is a user outside those countries or will that always trump the
others?

Also, is there a schedule as to when the G1 will be released in
countries other than the US and the UK?

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



[android-developers] Camera preview on G1 only works in landscape ?

2008-11-04 Thread jarkman

I'm using camera preview on the G1, using code from CameraPreview in
ApiDemos.

I'm seeing the preview image appear stretched  rotated unless my
screen orientation is set to 'landscape' in the manifest.

I can reproduce the same effect by changing the manifest for ApiDemos,
setting the screen orientation for .graphics.CameraPreview to
portrait.

I'd love to know if this is a bug in the Camera class, or if there is
some way I can work around this behaviour in my code, perhaps by
telling the Camera or SurfaceHolder something about orientation.

Thanks!

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



[android-developers] Re: Folders in main Start menu/tab?

2008-11-04 Thread Dan B.

that's exactly the problem with the drawer, you have to dig... the
market is just as huge a mess... it needs organization

On Nov 4, 2:21 pm, hackbod [EMAIL PROTECTED] wrote:
 Put your apps on the home screen, in their own folders if you want.
 Is there any particular reason you want to have a whole other facility
 to organize things in the set of all apps?  To me it just makes them
 harder to get to -- if you put them in a folder on the home screen,
 you can launch with two clicks, but in the drawer you'd have to first
 bring up the drawer, then dig down to the app, then launch it.

 On Nov 4, 11:28 am, Dan B. [EMAIL PROTECTED] wrote:



  the default drawer is definitely a disaster once you start installing
  more than 2-3 apps. I hope you can successfully replace it, and I'd be
  willing to assist with any testing.

  On Nov 4, 4:23 am, Ian [EMAIL PROTECTED] wrote:

   I now have a lot of installed apps, and I want to organise them in the
   pull-up-menu/tab.
   But it is not possible to create folders?
   I know I could copy all icons to the desktop with my folders there,
   but that is something else.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Reviews in android market

2008-11-04 Thread Eric Mill

It would be neat to make an unofficial website that uses that API to
make an identical looking and functioning frontend.  Now I just need
to know the API...maybe I can Wireshark my G1's packets...

-- Eric

On Nov 3, 2:25 am, Al Sutton [EMAIL PROTECTED] wrote:
 My guess would be that the market app is displaying the data from an API
 call to a server, so unless you know how to get call the API and
 interpret the data you're not going to have any joy.

 Al.



 Shane Isbell wrote:

  On Sun, Nov 2, 2008 at 4:14 PM, Eric Mill [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:

      I share Nate's interest -- I have a G1, but I'd like to just browse
      the Market in Firefox for a while sometimes.  Where's the endpoint,
      and what user agent string do I have to spoof? :)

  For all we know, the Android Market could only be accessible through a
  private IP inside of T-Mobile's network. That's what I would do if I
  were them.

  Shane

 --
 Al Sutton

 W:www.alsutton.com
 B: alsutton.wordpress.com
 T: twitter.com/alsutton
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Orientation Sensor yaw values. Is your G1 compass bad?

2008-11-04 Thread jarkman

On Nov 4, 10:01 am, bryan [EMAIL PROTECTED] wrote:

 Has anyone here experienced similar results when reading yaw from the
 sensor? I've gotten a number of reports from others complaining about
 inaccuracy with compass type results and am wondering if this is a per
 phone error or if all of the G1s have poor yaw/orientation sensors.

I haven't seen systematic yaw errors, but with my G1 the compass
values are extremely jittery. The other orientation values are also
jittery, but not quite as bad as the compass.

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



[android-developers] Not able to scroll in WebView

2008-11-04 Thread vel

In webview after loading data i want to scroll to the bottom of the
page.
I tried using pageDown( true ) method it flickers goes down and then
comes up
please guide me how to scroll down in  a web view
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Nullpointer ......Stack overflow, expanding

2008-11-04 Thread for android
I have created a complex view layout.Whn i see the layout(in eclipse)it
appears fine .When i see the log statements also I get the statements till
the last line in the onCreate without any issues .

But at run time i get this error which is Nullpointer.What does this error
really indicate??

11-04 14:28:11.044: INFO/dalvikvm(176): Stack overflow, expanding
(0x41049200 to 0x41049000)
11-04 14:28:11.054: INFO/dalvikvm(176): Shrank stack (to 0x41049200,
curFrame is 0x4104ad4c)
11-04 14:28:11.076: DEBUG/AndroidRuntime(176): Shutting down VM
11-04 14:28:11.076: WARN/dalvikvm(176): threadid=3: thread exiting with
uncaught exception (group=0x40010e28)
11-04 14:28:11.082: ERROR/AndroidRuntime(176): Uncaught handler: thread main
exiting due to uncaught exception
11-04 14:28:11.134: ERROR/AndroidRuntime(176):
java.lang.NullPointerException
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.view.ViewRoot.draw(ViewRoot.java:992)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.view.ViewRoot.performTraversals(ViewRoot.java:829)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.os.Handler.dispatchMessage(Handler.java:88)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.os.Looper.loop(Looper.java:123)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
android.app.ActivityThread.main(ActivityThread.java:3742)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
java.lang.reflect.Method.invokeNative(Native Method)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
java.lang.reflect.Method.invoke(Method.java:515)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
11-04 14:28:11.134: ERROR/AndroidRuntime(176): at
dalvik.system.NativeStart.main(Native Method)

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



[android-developers] Re: Question about View, Canvas, and Drawable.. --Basics

2008-11-04 Thread joshbeck



I'll go ahead and add this too:

I wrote two programs last night:
   -One added a Drawable to an ImageView Layout.
   -The other used onDraw and invalidate to repeatedly render out
a canvas.

Under what circumstances is the Drawable beneficial is my question I
guess.

Thanks again,
Josh

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



[android-developers] Re: Exact Battery level value

2008-11-04 Thread denismo

Where can I get that AnyCut, preferably with the source code?

Thanks.

Denis

On Nov 4, 11:04 pm, Ian [EMAIL PROTECTED] wrote:
 By installing AnyCut, I was able to add a shortcut to Battery info.
 This gave me a whole load of info I have not seen via any other menu option!
 (Makes me wonder what other goodies are hidden away!)

 IV

 2008/11/4 denismo [EMAIL PROTECTED]:



  Hi,

  for tuning power consumption of my application I need to be able to
  estimate how much it consumes power in, say, 1 hour. I will then try
  different strategies and experiment with parameters in order to reduce
  power consumption. Is it possible to implement something like this on
  Android?  Is it possible to get exact battery level value as a number?

  Thanks.

  Denis


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



[android-developers] Contacts List Fail To Save To Phone

2008-11-04 Thread ric

Does anyone have any idea why my contacts will not save.. on my phone.
I repeatedly add contacts only to find them no-where in the phones
contact list. thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



  1   2   >