[android-developers] Re: MediaRecorder on G1

2008-11-09 Thread Grigory Fishilevich

Hi g1ster,

 Thanks Grigory. I turned on logcat, it showed I entered into an
 infinite loop repeating:
 Know how to interpret it?

its fine. recording is in progress.

 I use the mPath as /internal/audio/media/tst.gpp for my G1 phone.
 May be I should use something else?

try sdcard. for example /sdcard/test.3gpp. you need a sdcard-image for this.
do you know how? if not, take a look at
http://code.google.com/android/reference/emulator.html#sdcard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Comment spam in android market :(

2008-11-09 Thread ryaninc

I wholeheartedly agree. The comments are invaluable for determining
how well an application works, but it's almost to the point where the
comments are worthless because there's so much spam and completely off-
topic discussion.

While I don't like comment moderation as a whole, there should be
automatic filtering at the very least. Maybe Google could implement a
filter that would delete comments with swear words, or even just turn
them into asterisks.

There really needs to be a solution to this, it's really getting
bad. :-(

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Land Navigation Application development

2008-11-09 Thread Sam M

I'm a US Army Officer Cadet, not a developer.  However, I've seen
things like the Radar application and know that you can do amazing
things with GPS functionality.

Part of our training in the Army requires us to do land navigation,
where we use 8 digit grid coordinates (e.g. EG12345678) to navigate
between two points using a distance (e.g. 1650 meters) and direction
in degrees (e.g. 273*).

It would be incredibly useful is someone could develop an application
in which I could enter a distance and direction (e.g 1650 meters at
273*) that would give me the range remaining and notify me when I'm
drifting off azimuth (ideally establishing a tolerance that notifies
me when my azimuth variation would result in my being more than 15
meters from my target destination).  Perhaps the application could
even generate and store the map location that's specified by the
distance and direction and automatically recalculate a new distance
and direction in the event that I become lost or disoriented or need
to navigate to a new waypoint.

Please let me know if you could develop such an application!  I know
that thousands of cadets and soldiers would find this application
incredibly useful!

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



[android-developers] Re: install test app on g1

2008-11-09 Thread ∷∮心雨轩∮∷

我也想知道如何解决这个问题!

On 10月30日, 上午9时13分, mahadevan v [EMAIL PROTECTED] wrote:
 You need to sign your app. Please see:

 http://code.google.com/android/devel/sign-publish.html

 On Oct 29, 6:33 pm, mitush [EMAIL PROTECTED] wrote:

  I went through creating the Hello, Android application using Eclipse
  Ganymede/ADT (on Ubuntu 8.04) as described 
  inhttp://code.google.com/android/intro/hello-android.html. It works both
  in emulator, if my production G1 is not connected, and on the G1
  itself, if it is connected (thanks 
  tohttp://code.google.com/android/intro/develop-and-debug.html#developin...).

  I would like to install and run my test app on G1 without it being
  connected to my Linux box. How can I do that? I have tried 'adb
  install ~/hello_android.apk' and it fails as follows
  131 KB/s (6739 bytes in 0.050s)
  pkg: /data/local/tmp/hello_android.apk
  Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

  (and I did set my 'debuggable' flag to true in the app manifesto and
  enabled USB debugging in G1)

  Could somebody please help?



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



[android-developers] LocationManager

2008-11-09 Thread dave.marsden

I'm trying to get some basic location code working, I've started from
the standard hello world type app, and have changed it to print the
current location. with the following code.

package com.android.tracker;

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

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.widget.TextView;

public class AndroidTracker extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   TextView tv = new TextView(this);
   LocationManager lm =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);

   Location loc = lm.getLastKnownLocation(GPS);
   String pos = loc.toString();
   tv.setText(pos);
   setContentView(tv);
   }
}


However the getLastKnownLocation is returning null in the emulator.
Can anybody tell me what I'm doing wrong?

Thanks

Dave.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] bindService and call of onServiceConnected

2008-11-09 Thread Christoph

Hi

I am a little confused about when ServiceConnection.onServiceConnected
is actually called. After debugging I realised that it happens after the
UI is built. When I call bindService() it returns an immediate true,
but the onServiceConnected() method isn't even called by then. So I
cannot call methods from the stub in onResume or onStart()?

So, service is still NULL, for example in an onResume() method:

onResume() {
 sc = new ServiceConnection() {
  @Override
  public void onServiceConnected(ComponentName name, IBinder binder) {
   service = [whatever].Stub.asInterface(binder);
  }
  @Override
  public void onServiceDisconnected(ComponentName name, IBinder binder)
  {
   service = null;
  }
 };
 boolean bound = bindService(bla,bla,bla);

 if(bound  service!=null) {
   //gets never called, service is still null while bound is true
 }

}

onPause() {
 unbindService(sc);
}

After onResume(), when the Activity is already displayed,
onServiceConnection() gets eventually called. But I cannot get any
information from the service before then, as described above in
onResume().

Furthermore, I observed that an unbindService() does not call
onServiceDisconnected. So, if the Activity was stopped and not
destroyed, the service variable is not null. If it was destroyed, it is
only null because it is newly created.

Can someone reproduce this behaviour? By the way, the service was
already started in onCreate().

Regards
Christoph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Why a custom view doen't visible?

2008-11-09 Thread zigang

Hi,i am a newer of android world. I hava a question like this:
I write my custom view as MyView extends View,but it doesn't visible
in screen,is there someone meets the same question?
code like this:
public class MyView extends View {
public MyView(Context c){
super(c);
}
public MyView(Context c,AttributeSet  attr){
super(c,attr);
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
setMeasuredDimension(160, 160);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint paint=new Paint();
paint.setTextSize(30);
paint.setColor(0xff);
canvas.drawText(This is a test word, 1,20, paint);
}
}

xml file like this:
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

com.test.MyView
android:id=@+id/hi
android:layout_width=fill_parent
android:layout_height=warp_content
/
/LinearLayout

Thanks for you help!

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



[android-developers] Handle tap on MyLocationOverlay current GPS position

2008-11-09 Thread Stu

Hi there.

I'm having trouble handling a tap on my current location in a
MyLocationOverlay. There seem to be functions specifically for this,
but I can't seem to handle it correctly.

My class look like this:

public class MyApp extends MapActivity implements LocationListener {

and when I try to override the dispatchTap() method I get told that it
must override a superclass. I'm assuming it's something to do with the
fact that my class has no link with MyLocationOverlay. I tried adding
it to the list of implements, but MyLocationOverlay is appanrently not
an interface, or something.

Can anyone tell me how I should go about handling a click on the
current location using a MyLocationOverlay, or not using one if it has
to be done a different way?

Thanks and regards,
Stuart.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] help

2008-11-09 Thread the dark tangent

Hey how y'all doin I'm new on apps for the android I'm tryin to
make cuz I wanna discuss da we can't let the iphone beat the g1 up is
bout a new app tha can play any type of video on the web like in the
sd card cuz the video players freeze and if u go some website da u can
download videos da goes straigh to tha app to play it so whoever want
to join to help me to developed this app welcome

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] LocationManager

2008-11-09 Thread dave.marsden

I'm trying to get some basic location based stuff working in the
Android Emulator. using the following code.

package com.android.tracker;

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

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.widget.TextView;

public class AndroidTracker extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   TextView tv = new TextView(this);
   LocationManager lm =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);

   Location loc = lm.getLastKnownLocation(GPS);
   String pos = loc.toString();
   tv.setText(pos);
   setContentView(tv);
   }
}

However getLastKnownLocation is returning NULL, can anybody explain
what I'm doing wrong please?

Thanks

Dave

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 large .apk file to Android

2008-11-09 Thread Jon_Roland

Let's consider particular apps we want to be able to install. Here is
my short list:
1. Garmin Navigator, currently only for Windows, with functions that
are presently not supported on the Maps app that comes with the G1. On
my T-Mobile Wing it installs, with data, on the SD card. It doesn't
have much RAM, so how is it done on that platform? What would it take
to duplicate it on the G1 (leaving aside the port from Windows to
Linux).?
2. A decent word processor + spreadsheet app. Preferably
openoffice.org, although that is huge. I could get along with Kword
and Kspread for a while, or even a good text editor like Kate.
3. An Exchange equivalent, perhaps OpenExchange.
4. A package manager, like Synaptic.
5. A good web editor, such as Quanta Plus.
6. An FTP tool, like gFTP.
7. A terminal console with shell access.
8. A PDF viewer.
9. An accounting app, like Gnucash.
10. A task manager/planner linked to calendar, email, etc.
11. A scientifuic calculator comparable to the TI-89.
12. An encryption manager, PGP.

Given the limited RAM and system memory, it would seem that that
should be largely confined to the launchers and their icons, with
everything else residing on the SD.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Odd XML Upload question

2008-11-09 Thread Alvin Yates

Figured out my problem with HTTP MIME and got it running.  New issue
has naturally arisen.

I'm trying to get a multipart form using MultipartEntity, which is
working fine for the signing up process we do in our app.  However,
uploading XML files is proving problematic as the content headers just
don't look right.

Is there a way to specify an entity while still maintaining control of
setting the content type and specifying base64 encoding for a
particular part?  The documentation on the libraries is sparse, and
there isn't too much to go on by way of code examples.

On a more abstract level, is this a normal method of information
transport?  I'm fairly novice to client-server apps, but I was under
the impression you either go fully XML or fully HTTP for client-server
communication, but not a mixture of both.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: WPA support

2008-11-09 Thread hyc

On Oct 23, 5:31 pm, hyc [EMAIL PROTECTED] wrote:
 So I just got a shiny new G1 yesterday. Much to my disappointment I
 found that its wifi menu only supports WPA-PSK, while I need WPA-EAP/
 PEAP support. I see from the recent source code release that the
 freeware wpa_supplicant is underneath all this, and that project
 supports EAP etc. so why is that functionality missing from the UI?

 Next question is, what would it take to fix this and enable the
 support in the UI?

Now that I have root shell access on my phone, I've been able to
install
my own CA certs and add my EAP/PEAP network definitions to my
wpa_supplicant.conf.
However, while wpa_supplicant reports successful authentication, it
seems
that the tiwlan0 driver fails to record the session keys. The
subsequent
invocation of dhcpcd always fails after timing out. So it appears that
there's some device driver work needed here.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Synchronization

2008-11-09 Thread Emery

Found the solution: runOnUiThread

On Nov 8, 9:02 pm, Michael [EMAIL PROTECTED] wrote:
 You could also do a lazy update like they do in the API Demos in the
 sample code included with the SDK, see List13.

 One thing I've got in my own code is having a thread update the data
 in the List which the ListView is linked to, and posting to a handler
 each time an item is updated, running adapter.notifyDataSetChanged().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Why a custom view doen't visible?

2008-11-09 Thread Christine

Why do you override onMeasure and onPaint? It's easier to set
properties of your view in the xml file.

And content should be wrapped, not warped :-)

On Nov 8, 6:35 pm, zigang [EMAIL PROTECTED] wrote:
 Hi,i am a newer of android world. I hava a question like this:
 I write my custom view as MyView extends View,but it doesn't visible
 in screen,is there someone meets the same question?
 code like this:
 public class MyView extends View {
 public MyView(Context c){
                 super(c);
         }
         public MyView(Context c,AttributeSet  attr){
                 super(c,attr);
         }

         @Override
         protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
 {
                 setMeasuredDimension(160, 160);
         }
         @Override
         protected void onDraw(Canvas canvas) {
                 super.onDraw(canvas);
                 Paint paint=new Paint();
                 paint.setTextSize(30);
                 paint.setColor(0xff);
                 canvas.drawText(This is a test word, 1,20, paint);
         }

 }

 xml file like this:
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     
     com.test.MyView
     android:id=@+id/hi
         android:layout_width=fill_parent
         android:layout_height=warp_content
         /
 /LinearLayout

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



[android-developers] Re: Web App

2008-11-09 Thread Wei-Meng Lee

Hi Jamie:
You might want to checkout this article: 
http://www.devx.com/wireless/Article/39810

Wei-Meng Lee
http://www.learn2develop.net/

On Nov 8, 9:53 pm, Jamie [EMAIL PROTECTED] wrote:
 Fellow Android Devs,

 Im new to android!!  wondering where I might start (after the intro
 tutorials), to develop an app that pulls info. from the web for the
 user.  It may be via rss, web page, etc.  Which part of the API does
 this work?? 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: ImageView automatic sizing

2008-11-09 Thread Alvin Yates

My suggestion is draw to size, manually, outside of the app.

Basically, the XML will only rarely do what you want, and it will
require some arcane parameter twiddling to even get close to what you
want.  The stretching/shrinking done by the OS is sketchy at best in
my experience.  I have personally never had size declaration work
either, but I was also using image buttons.

On Nov 8, 2:24 pm, David Given [EMAIL PROTECTED] wrote:
 I have a layout problem with ImageView.

 I'm trying to display an image, with a border drawn round it, at the
 largest possible size that will fit in an area without changing the
 aspect ratio. I'm doing this with a simple ImageView, with the border
 drawn using a Drawable attached to android:background.

 According to the specs, setting android:adjustViewBounds=true is
 supposed to cause the ImageView to resize itself to match the size of
 the image it's displaying (after scaling). However, I'm finding that
 this doesn't seem to make any difference. I finding that I either have
 the ImageView expanding to fill all the available area (which means the
 border's not drawn in the right place), or shrinking down to the image's
 natural size (which means it's floating in the middle of lots of empty
 space), regardless of whether it's set or not. Which one I get depends
 on whether the ImageView's size is fill_parent or wrap_content.

 My XML looks like:

 LinearLayout ...
   ...
   ImageView
         android:id=@+id/bigcover
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:layout_gravity=center
         android:adjustViewBounds=true
         android:scaleType=fitCenter
         android:background=@drawable/imageframe
         android:src=@drawable/actuallythisissetprogrammatically
   /
   ...
 /

 I would have *thought* that what I want to make this work is (a) set the
 size to fill_parent (to make the maximum size available to the
 ImageView) and then set adjustViewBounds (to cause the ImageView to
 resize itself to match the image). The LinearLayout will then float the
 ImageView in the middle of the cell.

 Unfortunately this doesn't work. Any suggestions? Am I going to have to
 resort to code?

 --
 ┌─── dg@cowlark.com ─http://www.cowlark.com─
 │
 │ ⍎'⎕',∊N⍴⊂S←'←⎕←(3=T)⋎M⋏2=T←⊃+/(V⌽⊂M),(V⊝M),(V,⌽V)⌽(V,V←1⎺1)⊝⊂M)'
 │ --- Conway's Game Of Life, in one line of APL

  signature.asc
  1KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 come PICK doesn't seem to work on Contacts.CONTENT_URI?

2008-11-09 Thread Grigory Fishilevich

Hi Satya,

On Sun, Nov 9, 2008 at 2:09 PM, Satya Komatineni
[EMAIL PROTECTED] wrote:
 I have used the following code
 public static void invokePick(Activity activity)
 {
 Intent pickIntent = new Intent(Intent.ACTION_PICK);
 pickIntent.setData(Contacts.CONTENT_URI);
 activity.startActivityForResult(pickIntent, 1);
 }
 I get an exception that no activity found matching this criteria.
 Satya

look at this:

Intent i= new Intent(Intent.ACTION_PICK,People.CONTENT_URI);
startActivityForResult(i,PICK_CONTACT_FROM_LIST);

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: LocationListener onLocationChanged

2008-11-09 Thread Christine

use getLastKnownLocation as your first location.

On Nov 9, 4:55 am, Nickname [EMAIL PROTECTED] wrote:
 Please allow me to ask a question related with onLocationChanged
 event:

 How does everybody make the mock gps provider send onLocationChanged
 events automatically instead of manually by clicking on the Send
 button in the DDMS Device Control view?

 My app needs the event from the very beginning of its execution.
 Manual clicking on the Send button cannot catch the timing of my
 app.

 On Nov 8, 3:26 pm, Christine [EMAIL PROTECTED] wrote:

  I was wondering, does an onLocationChanged event happen when the
  location device gets turned on? That is, if you're in SF, you turn off
  gps, you take a plain to Amsterdam, then you turn on gps, does the
  device generate an onLocationChanged event? Or does that happen when
  you've changed location after turning on the gps?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Applying design to an application

2008-11-09 Thread Christine

I suggest you play around with the sdk a bit, so you get a feeling of
what it does. Screen orientation is handled by Android, if you put the
right xml files in the right directories. Once you know how all this
works, you can create your own Theme based on what your designer
designed. It's all fairly easy.

On Nov 8, 8:51 pm, hodg [EMAIL PROTECTED] wrote:
 I was hoping someone could help get a bit familiar with certain
 aspects of developing applications for Android, specifically in the
 areas of applying a design to an application.

 My application is an Android UI for already existing backend system.
 The existing application has a Web UI already in place.  We want to
 keep the same look and feel that the website has on the Android
 application.  My questions are as follows:

 -       My UI designer has created a sample treatment for what the Android
 application should look like.  My designer can cut up the design into
 individual images so that they can be placed on the canvas.  I am
 hoping to have these images placed as the background for text boxes,
 buttons, and other widgets.  What is the best way to achieve this?

 -       Because there is a landscape and portrait mode, what is the best way
 to handle the different resolutions?  Is there some way to instruct
 the application to use different images depending on the modes?  Is
 there an event I can listen for so that I can programmatically change
 the images for the mode the application is in?

 What is the supported image format for doing things like this (i.e.
 png, jpg, gif)?

 My background is in web and desktop applications, so I realize that my
 questions might be partial to those environments.  If Android has a
 completely different way to achieve these results then pointing me to
 that documentation is sufficient for now.

 Any suggestions are greatly appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Odd XML Upload question

2008-11-09 Thread Christine

In a StringBody or FileBody, you can't set the mime type (content
type). You have to extend the class and override mime type setters and
getters.
Same for MultipartEntity, you have to override the generateContentType
method and provide your own contentType. The problem here is that you
can't seem to override the setter so you have to hard code the content
type in the getter. I guess you have to override multiple times if you
need multiple content types. I'm told that all this will be fixed in
furure releases of httpmime.

 On a more abstract level, is this a normal method of information
 transport?  I'm fairly novice to client-server apps, but I was under
 the impression you either go fully XML or fully HTTP for client-server
 communication, but not a mixture of both.

I'm not sure what you mean by this. There's three levels of
communication - actually, there's many more. At the low level, things
are handled by httpClient. You handle httpClient. Then the content of
what httpClient gets you is - or rather can be - xml, which you handle
by DOM or other xml tools.
If you want to know what's happening between your program and the
server, I recommend using wireshark or a similar tool.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] loading multiple thumbnail images: Java API vs. WebKit

2008-11-09 Thread jacek

Let's say I need to download and display 10 small thumbnail JPG images
quickly.
One way to do that is to concat together an HTML doc with several img
src=...jpg/ elements
and load the document into WebView. The underlying C++ written WebKit
is really fast in loading all the images
in parallel, allocating memory for them, caching and displaying them.

I have not yet figured out a way to do it as quickly in Android's Java
using eg. ImageViews.
I tried multiple threads (not sure how many does it make sense to
run)...
Is it the case that programming this task in Java will always be
slower than WebKit?
-- because of less efficient threading, memory allocation, internal
image representations?
For obvious reasons I would prefer to use Android's native widgets to
generating HTML for WebView.
What are your experiences, ideas on this issue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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-09 Thread brs

Thanks, I think I got everything I need from

http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html
and
http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html

The approach of creating a Binder to pass the service instance through
to the binding activity is easily missed and might deserve some more
pointing out in comments and the surrounding documentation. I would
imagine that using an activity plus a tightly coupled local service in
such a way to create an application which looks to the user like an
activity which can be put into the background would be a pretty common
usage pattern.

Bernhard

On Nov 4, 3:24 pm, hackbod [EMAIL PROTECTED] wrote:
 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: bindService and call of onServiceConnected

2008-11-09 Thread Don Park

On Nov 8, 1:29 pm, Christoph [EMAIL PROTECTED] wrote:
 After onResume(), when the Activity is already displayed,
 onServiceConnection() gets eventually called. But I cannot get any
 information from the service before then, as described above in
 onResume().

Right. No point in even trying to run code in onResum that has a
dependency on the service
.I suggest reorganizing the code so that your activity is the listener
rather than the inline
class you posted.

   public void onResume() {
   boolean result = bindService(pigeon_service, this, 0); // 0 =
do not auto-start
   }
   public void onPause() {
   unbindService(this);
   }
   public void onServiceConnected(ComponentName className, IBinder
service) {
  service = SomethingService.Stub.asInterface(service);
  run_code_that_depends_on_the_service();
   }

Don
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 sync Overlay.draw() with screen refresh cycle?

2008-11-09 Thread JP

Hmm, thanks (on a Sunday no less) - I guess I'll have to double check
my drawing routines

On Nov 9, 10:46 am, Romain Guy [EMAIL PROTECTED] wrote:
 Drawing on Android is always synced with the screen refreshes.

 On Sun, Nov 9, 2008 at 10:30 AM, JP [EMAIL PROTECTED] wrote:

  The regular screen refresh cycle seems to hit my overridden
  Overlay.draw() mid-execution on occassion; apparent they are not
  synchronized... nothing new compared to other platforms.
  There are typically ways to sync the execution of a drawing method
  with the screen refresh cycles, but I could not find anything like
  this in the documentation or in the forum - anybody got any tips?
  JP

 --
 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: Problem with orientation changes in subactivity

2008-11-09 Thread Christine

I think Romain's solution is the way to go. In every Activity, you
have to check if it's the first time you're there, or maybe you've
been restarted. In the apidemo examples you see that they test if the
input Bundle is null. Depending on that, they start anew or use data
from the Bundle to resume the activity.

On Nov 9, 9:04 pm, Jose Luis Huertas Fernández
[EMAIL PROTECTED] wrote:
 That does the trick also!

 Maybe it is a peculiar flow, but I don't find a better way to do it :(

 The activity A needs the result from B before doing anything. I could launch
 B first and from there launch A passing the results, but B is an activity
 that can be invoked from multiple places and if I include the where to go
 next logic into it then it would be very difficult to reuse... don't you
 think?

 Thanks ;)

 Jose Luis.

 On Sun, Nov 9, 2008 at 8:47 PM, Romain Guy [EMAIL PROTECTED] wrote:

  You can do something very simple: when your Activity is killed to be
  restarted, you will get a non-null Bundle instance in onCreate().
  Start B only when the Bundle is null.

  (I also find it weird that you start a sub-activity from onCreate(),
  it is a rather peculiar flow.)

  On Sun, Nov 9, 2008 at 11:36 AM, qvark
  [EMAIL PROTECTED] wrote:

   Hi,

   I have an activity A that the first thing it does is launching a
   subactivity B to get a result. So, in the onCreate() method of A, I
   have something like this:

   Intent intentB= new Intent(this, B.class);
   startActivityForResult(intentB, B_RC);

   This usually works fine, but if I change the orientation when I'm
   inside activity B, then when I close it activity A is recreated, so B
   is launched again.

   I tried modifying the invocation to B testing if a result has not been
   returned previously:

   if (!resultFromB) {
    Intent intentB= new Intent(this, B.class);
    startActivityForResult(intentB, B_RC);
   }

   protected void onActivityResult(int requestCode, int resultCode,
   Intent data) {
    if (requestCode == B_RC)
    resultFromB = true;
   }

   But it doesn't work because the activity A is created again BEFORE the
   onActivityResult method is called.

   I have seen something similar in the API demos (RedirectMain.java and
   RedirectGetter.java) and they solve it passing the result with a
   SharedPreferences object, instead of using the standard mechanisms.
   This seems to avoid the problem but I don't like it very much

   Any of you have found a better solution?

   Thanks,

   Jose Luis.

  --
  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] Re: simulate key press

2008-11-09 Thread Yorgen Valune
i think u should try the monkey util...
doest anyone with a real device tested the monkey ???





From: sandeepskumar [EMAIL PROTECTED]
To: Android Developers android-developers@googlegroups.com
Sent: Sunday, November 2, 2008 12:45:30 PM
Subject: [android-developers] simulate key press


Hi Team,
              I have got a android application which launces
ACTION_DIAL activity using startActivity function.Now i got to
simulate dialing  a number say(100).How do i do this..?
Can i use sendkey function to simulate keypress.?

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: Using an autocomplete filled with information from a database query

2008-11-09 Thread Juan David Trujillo C.

I finally found how to do it!!!

Jope this is useful for someone:

In the main class:
 mAcReason = ((AutoCompleteTextView)
findViewById(R.id.ac_registerevent_reason));
ContactListAdapter adapter = new ContactListAdapter(this, mCursor);
this.mAcReason.setAdapter(adapter);

public static class ContactListAdapter extends CursorAdapter
implements Filterable {

public ContactListAdapter(Context context, Cursor c) {
super(context, c);
Log.d(exp, *** A VER EHJEE
*);
mDb = new Database(context);
mDb.open();
Log.d(exp, *** A VER PUES 100
*);
}

@Override
public View newView(Context context, Cursor cursor,
ViewGroup
parent) {
final LayoutInflater inflater =
LayoutInflater.from(context);
final TextView view = (TextView) inflater.inflate(
android.R.layout.simple_dropdown_item_1line, parent,
false);
Log.d(exp, *** A VER 100
*);
view.setText(cursor.getString(2));
Log.d(exp, *** A VER PUES 150
*);
return view;
}

@Override
public void bindView(View view, Context context,
Cursor cursor) {
Log.d(exp, *** A VER 200
*);
((TextView)
view).setText(cursor.getString(2));
}

@Override
public String convertToString(Cursor cursor) {
Log.d(exp, *** A VER 300
*);
return cursor.getString(2);
}

 @Override
public Cursor runQueryOnBackgroundThread(CharSequence
constraint) {
if (getFilterQueryProvider() != null) {
Log.d(exp+constraint, *** A
VER PUES
800 *);
return
getFilterQueryProvider().runQuery(constraint);
}

StringBuilder buffer = null;
String[] args = null;
/*if (constraint != null) {
buffer = new StringBuilder();
buffer.append(UPPER();
Log.d(exp, *** A VER 400
*);
buffer.append(Database.KEY_REASON);
Log.d(exp, *** A VER PUES
900
*);
buffer.append() GLOB ?);
args = new String[]
{ constraint.toString().toUpperCase() + * };
//args = g;
Log.d(exp+constraint, *** A
VER
PUES 800 *);
}*/
Log.d(exp, *** A VER 500
*);
String where = ;
if (constraint != null) where =
constraint.toString();
Log.d(exp+where, *** A VER 500
*);
Cursor cur = mDb.fetchCustomEvents(expense,
reason
like ' + where + %');
Log.d(TOTAL=+cur.getCount(),
*** A VER
500 *);
return cur;
}

private Database mDb;
}

private static final String[] PEOPLE_PROJECTION = new String[]
{
Database.KEY_REASON,
Database.KEY_VALUE,
Database.KEY_TAX
};

On Nov 6, 9:48 pm, Juan David Trujillo C. [EMAIL PROTECTED]
wrote:
 Hi all!!

 I want to create an autocomplete that gets its information from a
 database query.  I have a database method that returns the Cursor
 (with name, value and date fields) I need, but I dont know how to
 actually fill it, so it works as expected as the Contacts API 
 demo:http://code.google.com/android/samples/ApiDemos/src/com/example/andro...

 I want the autocomplete to show the name field from the database
 query.

 I read the following thread, but still haven't been able to figure it
 out.

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

 I have to use the methods:
 runQueryOnBackgroundThread, convertToString, among others and extend
 extends SimpleCursorAdapter, but I still don't know how to actually
 use it.

 Appreciate any help provided!!!

 Best regards,

 Juan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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

[android-developers] Android Language Switcher

2008-11-09 Thread NuuNeoI

Hi,

Just for information. I just finished hacking the android core to add
my local language display and input (Thai).

Here are the pictures.

- Typing in English: 
http://farm4.static.flickr.com/3252/3015085799_7192835c90.jpg
- Language Switcher ( by press Alt+Shift+X ):
http://farm4.static.flickr.com/3061/3015085801_ce488de23c.jpg
- Now Typing in Thai : 
http://farm4.static.flickr.com/3296/3015085809_2fd1099d45.jpg

It works quite great in Emulator but I still didn't test it on real
device yet since it's the hacking thing.

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



[android-developers] Re: Trouble with SoundPool

2008-11-09 Thread Robert Green

Yeah there's something you need to know about SoundPool:  Init well
before playing - that is, you need to know way ahead of time what
sounds you will be using because it doesn't work well to play
immediately after initializing.  I think they attempt to initialize
asynchronously or something because I had problems when I tried to
load and play back to back like you're trying there.

When I use SoundPool, I load everything upon creation of the instance
of the game then trigger the plays whenever I need them.  Here's my
current code for SoundPoolSoundManager:

public class SoundPoolSoundManager implements SoundManager {
private static final String TAG = SoundPoolSoundManager;

public static final int SOUND_1 = 1;

private boolean enabled = true;
private Context context;
private SoundPool soundPool;
private HashMapInteger, Integer soundPoolMap;

public SoundPoolSoundManager(Context context) {
this.context = context;
}

public void reInit() {
init();
}

public void init() {
if (enabled) {
Log.d(TAG, Initializing new SoundPool);
//re-init sound pool to work around bugs
release();
soundPool = new SoundPool(SOUNDPOOL_STREAMS,
AudioManager.STREAM_MUSIC, 100);
soundPoolMap = new HashMapInteger, Integer();
soundPoolMap.put(SOUND_1, soundPool.load(context, 
R.raw.sound1,
1));
Log.d(TAG, SoundPool initialized);
}
}

public void release() {
if (soundPool != null) {
Log.d(TAG, Closing SoundPool);
soundPool.release();
soundPool = null;
Log.d(TAG, SoundPool closed);
return;
}
}

public void playSound(int sound) {
if (soundPool != null) {
Log.d(TAG, Playing Sound  + sound);
AudioManager mgr = (AudioManager)
context.getSystemService(Context.AUDIO_SERVICE);
int streamVolume = 
mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
Integer soundId = soundPoolMap.get(sound);
if (soundId != null) {
soundPool.play(soundPoolMap.get(sound), 
streamVolume,
streamVolume, 1, 0, 1f);
}
}
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}

On Nov 9, 4:28 am, g1bb [EMAIL PROTECTED] wrote:
 Hello,

 I posted this on the AndDev forums as well, and I'm somewhat of a
 novice to Java.

 I've tried the following code after seeing the snippet 
 athttp://www.anddev.org/using_soundpool_instead_of_mediaplayer-t3115.html,
 and I can't seem to get this to work. Here's what I have:

 public class OneShotAlarm extends BroadcastReceiver
 {
      private SoundPool soundPool;
       private HashMapInteger, Integer soundPoolMap;

     @Override
     public void onReceive(Context context, Intent intent)
     {
       soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);
          soundPoolMap = new HashMapInteger, Integer();
          soundPoolMap.put(1, soundPool.load(context, R.raw.sound1,
 1));

         AudioManager mgr = (AudioManager)
 context.getSystemService(Context.AUDIO_SERVICE);
         int streamVolume =
 mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
         soundPool.play(soundPoolMap.get(1), streamVolume,
 streamVolume, 1, 0, 1f);
     }

 }

 You'll notice I replaced instaces of 'getContext()' with 'Context', as
 'getContext()' doesn't seem to be available from where I have this
 code.

 Here is my LogCat that's being returned, and no sound is being played:
 11-08 19:25:23.679: DEBUG/dalvikvm(1822): Trying to load lib /system/
 lib/libsoundpool.so 0x0
 11-08 19:25:23.759: DEBUG/dalvikvm(1822): Added shared lib /system/lib/
 libsoundpool.so 0x0
 11-08 19:25:23.819: WARN/SoundPool(1822): sample 1 not READY

 Any ideas on this? I've been pulling my hair out all day messing with
 MediaPlayer, then I came across SoundPool and it looked like it would
 be a great alternative.

 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] Ksoap probleme!!! rejected Lorg/ksoap2/transport/ServiceConnectionMidp;

2008-11-09 Thread Cattivik

I would use Ksoap2 in my android application but I have this problem:

11-09 20:58:44.078: WARN/dalvikvm(197): VFY:  rejected Lorg/ksoap2/
transport/ServiceConnectionMidp;.init (Ljava/lang/String;)V
11-09 20:58:44.088: WARN/dalvikvm(197): Verifier rejected class Lorg/
ksoap2/transport/ServiceConnectionMidp;

(I use SDK 1.0 r1)

Can you give me some help?
(example, link...)

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] Network traffic monitoring

2008-11-09 Thread alexdonnini

Hello,

Where are network traffic logs, and other networking related
information stored on an Adriod based device? Which directories, and
files should I look for? I am writing a small application to allow
tracking and retrieval of system information including processes,
threads, and networking events and traffic. I have had no problem in
retrieving and processing process and thread information but I can't
seem to find networking event information.

I looked in /dev where I found a number of files and directories which
I thought would be relevant but could not retrieve any information. I
used the code below. The result, so far, has always been a file not
found exception.

I would appreciate any help in locating the files where networking
related information (including events and traffic) should be located.

Thanks.

Alex Donnini

 FileReader fstream = null;
 try
 {
 fstream = new FileReader(/dev/cpu_dma_latency);
 }
 catch (FileNotFoundException e)
 {
e.printStackTrace();
 }

 try
 {
 BufferedReader in = new BufferedReader(fstream, 500);
 String line = null;
 while ((line = in.readLine()) != null)
 {
 netTrafficDev.add(line);
 }
 }
 catch (Exception e)
 {
e.printStackTrace();
 }

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Problem with orientation changes in subactivity

2008-11-09 Thread Jose Luis Huertas Fernández
That does the trick also!

Maybe it is a peculiar flow, but I don't find a better way to do it :(

The activity A needs the result from B before doing anything. I could launch
B first and from there launch A passing the results, but B is an activity
that can be invoked from multiple places and if I include the where to go
next logic into it then it would be very difficult to reuse... don't you
think?

Thanks ;)

Jose Luis.

On Sun, Nov 9, 2008 at 8:47 PM, Romain Guy [EMAIL PROTECTED] wrote:


 You can do something very simple: when your Activity is killed to be
 restarted, you will get a non-null Bundle instance in onCreate().
 Start B only when the Bundle is null.

 (I also find it weird that you start a sub-activity from onCreate(),
 it is a rather peculiar flow.)

 On Sun, Nov 9, 2008 at 11:36 AM, qvark
 [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I have an activity A that the first thing it does is launching a
  subactivity B to get a result. So, in the onCreate() method of A, I
  have something like this:
 
  Intent intentB= new Intent(this, B.class);
  startActivityForResult(intentB, B_RC);
 
  This usually works fine, but if I change the orientation when I'm
  inside activity B, then when I close it activity A is recreated, so B
  is launched again.
 
  I tried modifying the invocation to B testing if a result has not been
  returned previously:
 
  if (!resultFromB) {
   Intent intentB= new Intent(this, B.class);
   startActivityForResult(intentB, B_RC);
  }
 
  protected void onActivityResult(int requestCode, int resultCode,
  Intent data) {
   if (requestCode == B_RC)
   resultFromB = true;
  }
 
  But it doesn't work because the activity A is created again BEFORE the
  onActivityResult method is called.
 
  I have seen something similar in the API demos (RedirectMain.java and
  RedirectGetter.java) and they solve it passing the result with a
  SharedPreferences object, instead of using the standard mechanisms.
  This seems to avoid the problem but I don't like it very much
 
  Any of you have found a better solution?
 
  Thanks,
 
  Jose Luis.
  
 



 --
 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] Re: clock on the statusbar is not updating

2008-11-09 Thread Anroid_hvw

My app is dependant on a visual updated clock - I presume the actual
phone would not have this problem ?

Maybe someone at Google can fix the emulator please ?

On Sep 25, 5:32 pm, oxonom [EMAIL PROTECTED] wrote:
 Is there a known problem that the clock on the statusbar is not
 updated?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Odd XML Upload question

2008-11-09 Thread Alvin Yates

As it turns out, I was using the wrong names for my values.  Go me.

 Same for MultipartEntity, you have to override the generateContentType
 method and provide your own contentType. The problem here is that you
 can't seem to override the setter so you have to hard code the content
 type in the getter. I guess you have to override multiple times if you
 need multiple content types. I'm told that all this will be fixed in
 furure releases of httpmime.

Fixed in that you won't need to override multiple time, or fixed in
that the Body will have settable types?  Any word on that whole
getContentLength() being fixed?  I'm working around it with searching
for the appropriate response header at the moment, but it seems silly
to have to do so.

 I'm not sure what you mean by this. There's three levels of
 communication - actually, there's many more. At the low level, things
 are handled by httpClient. You handle httpClient. Then the content of
 what httpClient gets you is - or rather can be - xml, which you handle
 by DOM or other xml tools.
 If you want to know what's happening between your program and the
 server, I recommend using wireshark or a similar tool.


I mean in a general sense.

My undergrad experience with XML was focused on opening a port, and
waiting for a pure XML stream to be parsed by (at the time) SAX.  A
POST request, to me, would be a simple webform, some binary files to
be uploaded, etc.  What I'm sending is a multipart form where one of
the content bodies is actually parsable XML.  It just seems... kinda
weird to me, you know? :)

Semi-related note: I ended up having to use tcpdump to figure out what
I was sending to the server in the first place, because there doesn't
seem to be an easy way to get the plaintext of what I'm sending via
httpmime, only what I receive.


On Nov 9, 7:37 am, Christine [EMAIL PROTECTED] wrote:
 In a StringBody or FileBody, you can't set the mime type (content
 type). You have to extend the class and override mime type setters and
 getters.
 Same for MultipartEntity, you have to override the generateContentType
 method and provide your own contentType. The problem here is that you
 can't seem to override the setter so you have to hard code the content
 type in the getter. I guess you have to override multiple times if you
 need multiple content types. I'm told that all this will be fixed in
 furure releases of httpmime.

  On a more abstract level, is this a normal method of information
  transport?  I'm fairly novice to client-server apps, but I was under
  the impression you either go fully XML or fully HTTP for client-server
  communication, but not a mixture of both.

 I'm not sure what you mean by this. There's three levels of
 communication - actually, there's many more. At the low level, things
 are handled by httpClient. You handle httpClient. Then the content of
 what httpClient gets you is - or rather can be - xml, which you handle
 by DOM or other xml tools.
 If you want to know what's happening between your program and the
 server, I recommend using wireshark or a similar tool.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Cannot create new Android Projects

2008-11-09 Thread bw

I had the same problem and got around it by running eclipse with the -
clean flag and creating a new workspace.

-Ben

Based on:
http://www.eclipsezone.com/eclipse/forums/t61566.html

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



[android-developers] Re: MediaRecorder on G1

2008-11-09 Thread g1ster

Toke awhile to get the sdcard mounted. Once that was done, all seem to
working as programmed! Thanks Grigory!!!

One more questions: what do you use to view the content in the .iso
image (sdcard)?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Applying design to an application

2008-11-09 Thread hodg

Thanks for the response Christine.  I have been playing around with
the sdk and searching around online.  Working with the controls is
straight forward, and I agree that playing around has been a stress
free process.  I know that I can get the design in there just fine,
but I guess I was looking for some general best practices.
Additionally, I want to make sure that I am doing things the right
way, not just the way I am used to.

So if I can ask a more direct question.  As a web developer, typically
I would approach this problem by having a designer chop up a design
into different segments (slices).  Using each of those slices, I would
apply them to layout controls and backgrounds for various widgets.
For instance, custom buttons would have their background set to an
image.  Text Edit controls would have their entire row set using the
background, etc ...

Is this the correct aproach to take?
Should I use TableRow controls and set the background of those
controls?


Thanks again!

Michael

On Nov 9, 10:24 am, Christine [EMAIL PROTECTED] wrote:
 I suggest you play around with the sdk a bit, so you get a feeling of
 what it does. Screen orientation is handled by Android, if you put the
 right xml files in the right directories. Once you know how all this
 works, you can create your own Theme based on what your designer
 designed. It's all fairly easy.

 On Nov 8, 8:51 pm, hodg [EMAIL PROTECTED] wrote:



  I was hoping someone could help get a bit familiar with certain
  aspects of developing applications for Android, specifically in the
  areas of applying a design to an application.

  My application is an Android UI for already existing backend system.
  The existing application has a Web UI already in place.  We want to
  keep the same look and feel that the website has on the Android
  application.  My questions are as follows:

  -       My UI designer has created a sample treatment for what the Android
  application should look like.  My designer can cut up the design into
  individual images so that they can be placed on the canvas.  I am
  hoping to have these images placed as the background for text boxes,
  buttons, and other widgets.  What is the best way to achieve this?

  -       Because there is a landscape and portrait mode, what is the best way
  to handle the different resolutions?  Is there some way to instruct
  the application to use different images depending on the modes?  Is
  there an event I can listen for so that I can programmatically change
  the images for the mode the application is in?

  What is the supported image format for doing things like this (i.e.
  png, jpg, gif)?

  My background is in web and desktop applications, so I realize that my
  questions might be partial to those environments.  If Android has a
  completely different way to achieve these results then pointing me to
  that documentation is sufficient for now.

  Any suggestions are greatly appreciated.- 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 do I update my activity on receiving intent in BroadcastReceiver

2008-11-09 Thread Juan David Trujillo C.

Here's how to do it:

public class AlarmFired extends BroadcastReceiver {

private String type;
private int position;
private String reason;
private String value;
private String rbTax;
private static final int uniqueId = (int)System.currentTimeMillis();

@Override
public void onReceive(Context context, Intent intent)
{
Log.d(exp, **BUENO JD1 **);
Bundle extras = intent.getExtras();

if (extras != null) {
Log.d(exp, **BUENO JD1+ 
**);
position = extras.getInt(position);
type = extras.getString(type);
value = extras.getString(value);
reason = extras.getString(reason);
showNotification(context);
//setNextAlarm(context);
Log.d(exp, **BUENO JD4
**);
} else {
Log.d(exp, **BUENO2
**);
}
}

private void showNotification(Context context) {
Log.d(exp, **BUENO JD100
**);
NotificationManager mgr =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Log.d(exp, **BUENO JD5a
**);
int icon = (type.equalsIgnoreCase(expense)) ?
R.drawable.ico_statusbar_expense : R.drawable.ico_statusbar_income;
Log.d(exp, **BUENO JD5b
**);
Notification note = new Notification(icon, Wallet Manager,
System.currentTimeMillis());
Log.d(exp, **BUENO JD6 **);
Intent intent = new Intent(context, RescheduleAlarm.class);
intent.putExtra(notificationId, uniqueId);
intent.putExtra(position, position);  // Spinner 
position defining
repetition
intent.putExtra(reason, reason);
intent.putExtra(value, value);
intent.putExtra(rbTax, rbTax);
intent.putExtra(type, type);
PendingIntent i = PendingIntent.getActivity(context, 0, intent,
0);
Log.d(exp, **BUENO JD5d**);
note.setLatestEventInfo(context, Notification Title, This is 
the
notification message, i);
Log.d(exp, **BUENO JD5e**);
note.vibrate = new long[] { 100, 250, 100, 500};
Log.d(exp, **BUENO JD6e **);
Log.d(exp, **BUENO JD7a **);
mgr.notify(uniqueId, note);
Log.d(exp, **BUENO JD7 **);
}

public void setNextAlarm(Context context) {

Intent intent = new Intent(context, AlarmFired.class);
intent.putExtra(position, position);  // Spinner 
position defining
repetition
intent.putExtra(reason, reason);
intent.putExtra(value, value);
intent.putExtra(rbTax, rbTax);
intent.putExtra(type, type);
PendingIntent sender = PendingIntent.getBroadcast(context, 0,
intent, 0);
AlarmManager am =
(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
long nextAlarm = getNextAlarmMillis(position);
//am.set(AlarmManager.RTC_WAKEUP, nextAlarm, sender);
 Calendar calendar = Calendar.getInstance();
 calendar.setTimeInMillis(System.currentTimeMillis());
 calendar.add(Calendar.SECOND, 20);
 am.set(AlarmManager.RTC_WAKEUP,  calendar.getTimeInMillis(),
sender);
}

On Nov 1, 1:23 pm, Juan David Trujillo C. [EMAIL PROTECTED]
wrote:
 Hi Megha!

 I'm having a similar problem.  I want to be able to create a
 notification and schedule an alarm from a BroadcastReceiver class.  Do
 I have to make my BroadcastReceiver an inner class of an
 Activity or is it just using a regular class that extends
 BroadcastReceiver? Is it possible to launch other intents from a
 BroadcastReceiver to trigger logic in an activity?

 On Oct 21, 2:48 am, Megha Joshi [EMAIL PROTECTED] wrote:

  One of the options is to make your BroadcastReceiver an inner class of your
  Activity. It also makes sense to make BroadCasterReceiver as  Activity's
  inner class if its just going to update your Activity's UI.

  2008/10/20 Abraham [EMAIL PROTECTED]

   HI ,

   I'm trying the understand how an application can receive intent in
   BroadcastReceiver  how it can inform the Activity abt the information
   received in the intent.

   For this purpose I have created an activity which has a TextView. In
   OnCreate of the 

[android-developers] Re: MapActivity / MapView causes application to crash at startup

2008-11-09 Thread bw

Also had to add

uses-permission android:name=android.permission.INTERNET /

above my application tag.

(Source:
http://groups.google.com/group/android-developers/browse_thread/thread/74b47e1e11067865/9d7f0badbc0bbfc5?lnk=gstq=MapView#9d7f0badbc0bbfc5)

Is there some place where this is all documented?
I think this info should be in the javadocs for the MapView class!

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



[android-developers] Re: Program Finished - Now What?

2008-11-09 Thread CM

Dumb question but umm, how do I get or download the keytool?  When
type in keytool in the command line, I get key is not recognized as
an internal or external command, operable program or batch file

I have read somewhere that keytool and jarsigner come with the jdk,
but if I already have it, would I still get that error message in the
command prompt?

Many Thanks

On Oct 15, 5:23 am, Ewan Grantham [EMAIL PROTECTED] wrote:
 Thanks! That's what I was looking for!

 On Wed, Oct 15, 2008 at 4:06 AM, legerb [EMAIL PROTECTED] wrote:

  Use keytool and jarsigner, they come with the jdk.
 http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html
 http://java.sun.com/j2se/1.3/docs/tooldocs/win32/jarsigner.html

  eventually this is what worked for me:
  keytool -genkey -keystore refArchive/myKeyStore -alias somealias
  jarsigner -keystore refArchive/myKeyStore -signedjar refArchive/
  testapks.apk refArchive/testapk.apk somealias

  On Oct 14, 2:48 pm, Ewan Grantham [EMAIL PROTECTED] wrote:
   OK, appreciate the suggestions on how to list in alternate marketplaces.
  The
   one thing stopping me, is that what I was also looking for was a decent
   step-by-step on how to sign my app. I gather I can change a setting in
   Eclipse to do the release build, but then I still need to do something
   with keysign. Can anyone explain that part of the process, please?

   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] question about open source

2008-11-09 Thread anu

Hi,

I was wondering that since the Android SDK has become open source,
shouldn't we be able to access the tools like monkey tool etc, and
also view the code for the apis?

how should I go about looking this up?

Thanks,
Anu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] generating ui clicks from code

2008-11-09 Thread anu

Hi,

I am trying to automate key presses and UI clicks through code. I know
that the monkey tool does this but only pseudo-random clicks are
generated. I would like to be able to control which object is clicked
at what time.

Thanks,
Anu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] no callback to onItemClick() on clicking my ListView

2008-11-09 Thread Nickname

One of my ListView's has a Button view on every item's LinearLayout.

I just found that clicking on any item of the ListView does not
callback its onItemClick(), which is set thru
ListView.setOnItemClickListener().

If I remove the Button view from item layout, callback is ok then.

Can anybody advise me how I get the callback on the ListView with
Button?

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: Executing ON Target

2008-11-09 Thread 心蓝
U must sign it in android market!
2008/11/10 sudheer [EMAIL PROTECTED]


 Hello All
 I have an application developed using emulator. I want to run this
 application on G1 now. how should I go about it?
 is there any thing that I need to change apart from the instructions I
 see in sdk reference documents?
 Please advise.

 Best Regards,
 Sudheer

 



-- 
Welcome to my site about GPhone:
http://51gphone.cn
I am a GFans!!欢迎你来到我的GPhone网站!!http://51gphone.cn

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Fwd: Send DTMF

2008-11-09 Thread Rimma Sukhovsky
Intent mIntent = new Intent(Intent.ACTION_CALL, Uri.parse(tel: +
phoneNumber + ; + dtmfSequence));

On Thu, Nov 6, 2008 at 12:09 PM, [EMAIL PROTECTED] [EMAIL PROTECTED]wrote:


 Hi,

 How do you do this ?
 (adding the DTMF sequence to the dialed number)

 Thanks.

 On Oct 23, 4:13 pm, legerb [EMAIL PROTECTED] wrote:
  I'm adding the DTMF sequence to the dialed number. This seems to work,
  but when the call is established I'm getting a confirmation dialog
  asking Send the following tones?.
  Is it possible to prevent this dialog from being shown? May be some
  additional permissions? Though I didn't find any relevant...
  Or is there a way to detect the dialog on screen in order to simulate
  a key stroke?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Land Navigation Application development

2008-11-09 Thread Sam M

Sure they could.  In fact, the Army already uses such navigation
systems in active duty.  I, however, am a mere officer cadet with a
sweet new G1 that I'm trying to use to make my life easier.  Most of
our equipment is outdated, second hand, or borrowed.  We're definitely
not getting advanced GPS navigation systems from USACC.  So if I can
find a way to use my G1 in STX lanes and LandNav, then that would be
great!

On Nov 9, 8:24 pm, Eric Mill [EMAIL PROTECTED] wrote:
 If you think many in the army would find it useful, I bet you could
 find someone or some office who could hire someone to do it.

 -- Eric

 On Nov 8, 1:15 pm, Sam M [EMAIL PROTECTED] wrote:

  I'm a US Army Officer Cadet, not a developer.  However, I've seen
  things like the Radar application and know that you can do amazing
  things with GPS functionality.

  Part of our training in the Army requires us to do land navigation,
  where we use 8 digit grid coordinates (e.g. EG12345678) to navigate
  between two points using a distance (e.g. 1650 meters) and direction
  in degrees (e.g. 273*).

  It would be incredibly useful is someone could develop an application
  in which I could enter a distance and direction (e.g 1650 meters at
  273*) that would give me the range remaining and notify me when I'm
  drifting off azimuth (ideally establishing a tolerance that notifies
  me when my azimuth variation would result in my being more than 15
  meters from my target destination).  Perhaps the application could
  even generate and store the map location that's specified by the
  distance and direction and automatically recalculate a new distance
  and direction in the event that I become lost or disoriented or need
  to navigate to a new waypoint.

  Please let me know if you could develop such an application!  I know
  that thousands of cadets and soldiers would find this application
  incredibly useful!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Problem with overriding standard

2008-11-09 Thread [EMAIL PROTECTED]

I'm trying to extend Button class to get OnClick listener (Going to
create wrapper for click listener)

public class ExtendedButton extends Button {

public ExtendedButton(Context context) {
super(context);
}

public ExtendedButton(Context context, AttributeSet attrs) {
super(context, attrs);
}

public ExtendedButton(Context context, AttributeSet attrs, int
defStyle) {
super(context, attrs, defStyle);
}

OnClickListener getOnClickListener(){
return this.mOnClickListener;
}

}

But compiler in eclipse don't allow to do it.

error: mOnClickListener connot be resolved or is not a field.


View source code:
/**
  * Listener used to dispatch click events.
  * This field should be made private, so it is hidden from the SDK.
  * [EMAIL PROTECTED]
 */
protected OnClickListener mOnClickListener;

So I should have full access to this field from my class.
I can get access to this fields with reflection but standard java
inheritance mechanism don't work.

Can anybody explain this problem?

Why java source code don't redistributed with sdk?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: LocationListener onLocationChanged

2008-11-09 Thread Nickname


Thanks, it works!

On Nov 9, 7:20 am, Christine [EMAIL PROTECTED] wrote:
 use getLastKnownLocation as your first location.

 On Nov 9, 4:55 am, Nickname [EMAIL PROTECTED] wrote:

  Please allow me to ask a question related with onLocationChanged
  event:

  How does everybody make the mock gps provider send onLocationChanged
  events automatically instead of manually by clicking on the Send
  button in the DDMS Device Control view?

  My app needs the event from the very beginning of its execution.
  Manual clicking on the Send button cannot catch the timing of my
  app.

  On Nov 8, 3:26 pm, Christine [EMAIL PROTECTED] wrote:

   I was wondering, does an onLocationChanged event happen when the
   location device gets turned on? That is, if you're in SF, you turn off
   gps, you take a plain to Amsterdam, then you turn on gps, does the
   device generate an onLocationChanged event? Or does that happen when
   you've changed location after turning on the gps?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Land Navigation Application development

2008-11-09 Thread Eric Mill

If you think many in the army would find it useful, I bet you could
find someone or some office who could hire someone to do it.

-- Eric

On Nov 8, 1:15 pm, Sam M [EMAIL PROTECTED] wrote:
 I'm a US Army Officer Cadet, not a developer.  However, I've seen
 things like the Radar application and know that you can do amazing
 things with GPS functionality.

 Part of our training in the Army requires us to do land navigation,
 where we use 8 digit grid coordinates (e.g. EG12345678) to navigate
 between two points using a distance (e.g. 1650 meters) and direction
 in degrees (e.g. 273*).

 It would be incredibly useful is someone could develop an application
 in which I could enter a distance and direction (e.g 1650 meters at
 273*) that would give me the range remaining and notify me when I'm
 drifting off azimuth (ideally establishing a tolerance that notifies
 me when my azimuth variation would result in my being more than 15
 meters from my target destination).  Perhaps the application could
 even generate and store the map location that's specified by the
 distance and direction and automatically recalculate a new distance
 and direction in the event that I become lost or disoriented or need
 to navigate to a new waypoint.

 Please let me know if you could develop such an application!  I know
 that thousands of cadets and soldiers would find this application
 incredibly useful!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Executing ON Target

2008-11-09 Thread sudheer

Hello All
I have an application developed using emulator. I want to run this
application on G1 now. how should I go about it?
is there any thing that I need to change apart from the instructions I
see in sdk reference documents?
Please advise.

Best Regards,
Sudheer

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 open the keyboard in emulator?

2008-11-09 Thread Anonymous Anonymous
Great !

That works

Thanks Shadow


On Sat, Nov 8, 2008 at 7:33 PM, Android Shadow [EMAIL PROTECTED] wrote:


 Hi firewallbreak,

 I think I find the answer.

 the emulator can only support sms input when the phone lying down.
 you can use CTRL + F11 or num pad 7 to do it.

 B.R.
 Shadow


 On Nov 8, 12:39 pm, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
  Hi All,
 
  Am also facing the same problem, how to make the keyboard working for
  composing an sms?
 
  Thanks
  steve
 
  On Nov 7, 12:28 pm, Android Shadow [EMAIL PROTECTED] wrote:
 
   Hi all,
 
   when I trying to use the short message feature in emulator, I found I
   cannot input anything.
 
   openkeyboardto compose message is shown on the display. It looks
   like thekeyboardhas not been enabled.
 
   Could you help me to know how to enable thekeyboard?
 
   Thanks
 
   B.R.
   Shadow
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: R.java is never, ever, ever, ever, ever regenerated

2008-11-09 Thread jenglert

wes, steve,

Hmm, thanks for the replies but neither suggested workarounds are
regenerating the R.java file.  Think I'm going to resort to using the
command line tools.

Thanks,
Jesse


On Nov 9, 5:08 am, wescorp [EMAIL PROTECTED] wrote:
 One thing I've done to cause a complete rebuild is to
 put in (or take out) an extra blank line in the the
 AndroidManifest.xml file.

 Cheers,
 Wes

 On Nov 9, 4:44 am, songs [EMAIL PROTECTED] wrote:

  The couple if times I've run into this, I've gotten things right again
  by playing around with a combination of turning off Build
  Automatically, hitting clean, touching an xml and a Java file so it
  gets picked up to be built, and building the project again.

  -Steve

  On Nov 8, 6:00 pm, jenglert [EMAIL PROTECTED] wrote:

   I am having the same problem and this proposed workaround doesnot
   work.

   J

   On Oct 22, 10:10 am, Robert Green [EMAIL PROTECTED] wrote:

I've had issues with mine as well and what I've ended up doing is
closing eclipse, deleting the file from the FS, firing up eclipse
again, re-creating a blankR.java, then importing one resource and it
magically kicks back in and repopulates the whole thing.

I think it's a little buggy and they should probably try to iron that
out.

On Oct 22, 12:27 pm, misbell [EMAIL PROTECTED] wrote:

 I have tried everything, including the laughable suggestion of
 restarting Eclipse, which of course didn't work.

 There is nothing wrong with my manifest file.

 The app worked perfectly until I changed it.

 Then I changed added a new PNG and changed the name in the main.xml
 file.

 After that nothing worked because theR,javafile wasnotupdated.

 Build Automatically is turned on.

 using Eclipse Ganymede. Runs every demo Android app perfectly.

 I mean, you have got to be kidding me. There is NO WAY to just press a
 button, issue a command andregeneratetheR.javafile?

 LOL LOL LOL What a waste of my freaking morning. What a complete and
 utter waste of several hours of my time. I am laughing because I am so
 pi$$ed off I can't even think of something sarcastic enough to say.

 Three months of smooth iPhone development and now I am stuck having to
 work with this gimrackety piece of junk.

 Ok, now that I've ranted, any solutions?

 M
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: MapActivity / MapView causes application to crash at startup

2008-11-09 Thread bw

Got it..

This is not a standard package in the Android library. In order to
use it, you must add the following XML element, as a child of the
application  element, in your AndroidManifest.xml file:

uses-library android:name=com.google.android.maps /


From:

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

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



[android-developers] Re: Android Language Switcher

2008-11-09 Thread Dan B.

actually, no hacking needed, just follow these steps:

1) install the USB drivers if you're on Windows (found on this forum)
2) turn on debugging on the phone
3) set the phone to allow unsigned applications
4) install the apk file using the adb application found in the tools
folder of the SDK

then you'll be ready to go

On Nov 9, 2:58 pm, NuuNeoI [EMAIL PROTECTED] wrote:
 Hi,

 Just for information. I just finished hacking the android core to add
 my local language display and input (Thai).

 Here are the pictures.

 - Typing in 
 English:http://farm4.static.flickr.com/3252/3015085799_7192835c90.jpg
 - Language Switcher ( by press Alt+Shift+X 
 ):http://farm4.static.flickr.com/3061/3015085801_ce488de23c.jpg
 - Now Typing in Thai 
 :http://farm4.static.flickr.com/3296/3015085809_2fd1099d45.jpg

 It works quite great in Emulator but I still didn't test it on real
 device yet since it's the hacking thing.

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



[android-developers] Re: Android Language Switcher

2008-11-09 Thread NuuNeoI

I confirm that it's the hacking thing. :)

Actually no apk file in this project. I edit the Android source code.
So the file I have to change is /system/lib/libsgl.so and many files
in system folder.

Today I will get the G1, I will try it. ^_^

On Nov 10, 10:37 am, Dan B. [EMAIL PROTECTED] wrote:
 actually, no hacking needed, just follow these steps:

 1) install the USB drivers if you're on Windows (found on this forum)
 2) turn on debugging on the phone
 3) set the phone to allow unsigned applications
 4) install the apk file using the adb application found in the tools
 folder of the SDK

 then you'll be ready to go

 On Nov 9, 2:58 pm, NuuNeoI [EMAIL PROTECTED] wrote:

  Hi,

  Just for information. I just finished hacking the android core to add
  my local language display and input (Thai).

  Here are the pictures.

  - Typing in 
  English:http://farm4.static.flickr.com/3252/3015085799_7192835c90.jpg
  - Language Switcher ( by press Alt+Shift+X 
  ):http://farm4.static.flickr.com/3061/3015085801_ce488de23c.jpg
  - Now Typing in Thai 
  :http://farm4.static.flickr.com/3296/3015085809_2fd1099d45.jpg

  It works quite great in Emulator but I still didn't test it on real
  device yet since it's the hacking thing.

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



[android-developers] How to sync Overlay.draw() with screen refresh cycle?

2008-11-09 Thread JP

The regular screen refresh cycle seems to hit my overridden
Overlay.draw() mid-execution on occassion; apparent they are not
synchronized... nothing new compared to other platforms.
There are typically ways to sync the execution of a drawing method
with the screen refresh cycles, but I could not find anything like
this in the documentation or in the forum - anybody got any tips?
JP

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 sync Overlay.draw() with screen refresh cycle?

2008-11-09 Thread Romain Guy

Drawing on Android is always synced with the screen refreshes.

On Sun, Nov 9, 2008 at 10:30 AM, JP [EMAIL PROTECTED] wrote:

 The regular screen refresh cycle seems to hit my overridden
 Overlay.draw() mid-execution on occassion; apparent they are not
 synchronized... nothing new compared to other platforms.
 There are typically ways to sync the execution of a drawing method
 with the screen refresh cycles, but I could not find anything like
 this in the documentation or in the forum - anybody got any tips?
 JP

 




-- 
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] Re: MediaRecorder on G1

2008-11-09 Thread Grigory Fishilevich

Hi g1ster,

 One more questions: what do you use to view the content in the .iso
 image (sdcard)?

i use adb. run emulator, type adb shell, so you have some kind linux console
then cd /sdcard und ls .

if you wanna just play your records, MediaPlayer can do, the recordfiles
must have .3gpp   ext.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 can I launch the default Contact Application provided in SDK with my app

2008-11-09 Thread Hans

Thanks for your help.
I am not sure... therefore is it possible to just launch contacts app
and use its functionality from a personal application?
Is this issue solved? and if yes would anyone help please.

Thanks


On Nov 5, 12:58 pm, Abraham [EMAIL PROTECTED] wrote:
 To select a particular contact from thecontactslist you can do the
 following

 i= new Intent(Intent.ACTION_PICK,People.CONTENT_URI);
 startActivityForResult(i,PICK_CONTACT_FROM_LIST);

 The details abt the selection can be received in the onActivityResult()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Confused by Android testing framework

2008-11-09 Thread Diego Torres Milano

I've published a post featuring a simple way to build and run ApiDemos
tests not needing ant or maven. This method can also be used to build
and run tests for other projects as well.
See http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platf.html
Comments are gladly welcome.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Trouble with SoundPool

2008-11-09 Thread g1bb

This worked great. Thank you very much. The lack of documentation on
SoundPool is disturbting.

On Nov 9, 2:10 pm, Robert Green [EMAIL PROTECTED] wrote:
 Yeah there's something you need to know about SoundPool:  Init well
 before playing - that is, you need to know way ahead of time what
 sounds you will be using because it doesn't work well to play
 immediately after initializing.  I think they attempt to initialize
 asynchronously or something because I had problems when I tried to
 load and play back to back like you're trying there.

 When I use SoundPool, I load everything upon creation of the instance
 of the game then trigger the plays whenever I need them.  Here's my
 current code for SoundPoolSoundManager:

 public class SoundPoolSoundManager implements SoundManager {
         private static final String TAG = SoundPoolSoundManager;

         public static final int SOUND_1 = 1;

         private boolean enabled = true;
         private Context context;
         private SoundPool soundPool;
         private HashMapInteger, Integer soundPoolMap;

         public SoundPoolSoundManager(Context context) {
                 this.context = context;
         }

         public void reInit() {
                 init();
         }

         public void init() {
                 if (enabled) {
                         Log.d(TAG, Initializing new SoundPool);
                         //re-init sound pool to work around bugs
                         release();
                         soundPool = new SoundPool(SOUNDPOOL_STREAMS,
 AudioManager.STREAM_MUSIC, 100);
                         soundPoolMap = new HashMapInteger, Integer();
                         soundPoolMap.put(SOUND_1, soundPool.load(context, 
 R.raw.sound1,
 1));
                         Log.d(TAG, SoundPool initialized);
                 }
         }

         public void release() {
                 if (soundPool != null) {
                         Log.d(TAG, Closing SoundPool);
                         soundPool.release();
                         soundPool = null;
                         Log.d(TAG, SoundPool closed);
                         return;
                 }
         }

         public void playSound(int sound) {
                 if (soundPool != null) {
                         Log.d(TAG, Playing Sound  + sound);
                         AudioManager mgr = (AudioManager)
 context.getSystemService(Context.AUDIO_SERVICE);
                         int streamVolume = 
 mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
                         Integer soundId = soundPoolMap.get(sound);
                         if (soundId != null) {
                                 soundPool.play(soundPoolMap.get(sound), 
 streamVolume,
 streamVolume, 1, 0, 1f);
                         }
                 }
         }

         public void setEnabled(boolean enabled) {
                 this.enabled = enabled;
         }

 }

 On Nov 9, 4:28 am, g1bb [EMAIL PROTECTED] wrote:

  Hello,

  I posted this on the AndDev forums as well, and I'm somewhat of a
  novice to Java.

  I've tried the following code after seeing the snippet 
  athttp://www.anddev.org/using_soundpool_instead_of_mediaplayer-t3115.html,
  and I can't seem to get this to work. Here's what I have:

  public class OneShotAlarm extends BroadcastReceiver
  {
       private SoundPool soundPool;
        private HashMapInteger, Integer soundPoolMap;

      @Override
      public void onReceive(Context context, Intent intent)
      {
        soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);
           soundPoolMap = new HashMapInteger, Integer();
           soundPoolMap.put(1, soundPool.load(context, R.raw.sound1,
  1));

          AudioManager mgr = (AudioManager)
  context.getSystemService(Context.AUDIO_SERVICE);
          int streamVolume =
  mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
          soundPool.play(soundPoolMap.get(1), streamVolume,
  streamVolume, 1, 0, 1f);
      }

  }

  You'll notice I replaced instaces of 'getContext()' with 'Context', as
  'getContext()' doesn't seem to be available from where I have this
  code.

  Here is my LogCat that's being returned, and no sound is being played:
  11-08 19:25:23.679: DEBUG/dalvikvm(1822): Trying to load lib /system/
  lib/libsoundpool.so 0x0
  11-08 19:25:23.759: DEBUG/dalvikvm(1822): Added shared lib /system/lib/
  libsoundpool.so 0x0
  11-08 19:25:23.819: WARN/SoundPool(1822): sample 1 not READY

  Any ideas on this? I've been pulling my hair out all day messing with
  MediaPlayer, then I came across SoundPool and it looked like it would
  be a great alternative.

  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

[android-developers] Problem with orientation changes in subactivity

2008-11-09 Thread qvark

Hi,

I have an activity A that the first thing it does is launching a
subactivity B to get a result. So, in the onCreate() method of A, I
have something like this:

Intent intentB= new Intent(this, B.class);
startActivityForResult(intentB, B_RC);

This usually works fine, but if I change the orientation when I'm
inside activity B, then when I close it activity A is recreated, so B
is launched again.

I tried modifying the invocation to B testing if a result has not been
returned previously:

if (!resultFromB) {
  Intent intentB= new Intent(this, B.class);
  startActivityForResult(intentB, B_RC);
}

protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
 if (requestCode == B_RC)
  resultFromB = true;
}

But it doesn't work because the activity A is created again BEFORE the
onActivityResult method is called.

I have seen something similar in the API demos (RedirectMain.java and
RedirectGetter.java) and they solve it passing the result with a
SharedPreferences object, instead of using the standard mechanisms.
This seems to avoid the problem but I don't like it very much

Any of you have found a better solution?

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: Problem with orientation changes in subactivity

2008-11-09 Thread Romain Guy

You can do something very simple: when your Activity is killed to be
restarted, you will get a non-null Bundle instance in onCreate().
Start B only when the Bundle is null.

(I also find it weird that you start a sub-activity from onCreate(),
it is a rather peculiar flow.)

On Sun, Nov 9, 2008 at 11:36 AM, qvark
[EMAIL PROTECTED] wrote:

 Hi,

 I have an activity A that the first thing it does is launching a
 subactivity B to get a result. So, in the onCreate() method of A, I
 have something like this:

 Intent intentB= new Intent(this, B.class);
 startActivityForResult(intentB, B_RC);

 This usually works fine, but if I change the orientation when I'm
 inside activity B, then when I close it activity A is recreated, so B
 is launched again.

 I tried modifying the invocation to B testing if a result has not been
 returned previously:

 if (!resultFromB) {
  Intent intentB= new Intent(this, B.class);
  startActivityForResult(intentB, B_RC);
 }

 protected void onActivityResult(int requestCode, int resultCode,
 Intent data) {
  if (requestCode == B_RC)
  resultFromB = true;
 }

 But it doesn't work because the activity A is created again BEFORE the
 onActivityResult method is called.

 I have seen something similar in the API demos (RedirectMain.java and
 RedirectGetter.java) and they solve it passing the result with a
 SharedPreferences object, instead of using the standard mechanisms.
 This seems to avoid the problem but I don't like it very much

 Any of you have found a better solution?

 Thanks,

 Jose Luis.
 




-- 
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] MapActivity / MapView causes application to crash at startup

2008-11-09 Thread bw

Hi,

I'm trying to create a new application with a MapView.
When I first create a new Android project in Eclipse, I run it in the
emulator and get the expected Hello, [project name] message.
Then, I try changing Activity to MapActivity and adding a MapView
(I've tried both the xml and the code route):


public class MyMap extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

MapView mMapView = new MapView(this, my_map_api_key);
mMapView.setClickable(true);
mMapView.setEnabled(true);
mMapView.setSatellite(true);
setContentView(mMapView);

}


@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}


However, when I run this in the emulator, it immediately crashes with
the Application has stopped unexpectedly error. The debugger shows
this error:


Thread [3 main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord)
line: 2068
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord)
line: 2156
ActivityThread.access$1800(ActivityThread, ActivityThread
$ActivityRecord) line: 112
ActivityThread$H.handleMessage(Message) line: 1580
ActivityThread$H(Handler).dispatchMessage(Message) line: 88
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3742
Method.invokeNative(Object, Object[], Class, Class[], Class, int,
boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 515
ZygoteInit$MethodAndArgsCaller.run() line: 739
ZygoteInit.main(String[]) line: 497
NativeStart.main(String[]) line: not available [native method]


I know I'm making some stupid mistake.. but I can't figure it out.

-Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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
-~--~~~~--~~--~--~---