[android-developers] unable to get xml from Soap Web services .....

2009-07-14 Thread android.vinny

HI

I am consuming SOAP web service in android.

like this 


 //CALL the web service method
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.setOutputSoapObject(request);

AndroidHttpTransport androidHttpTransport = new
AndroidHttpTransport(URL);
//androidHttpTransport.setXmlVersionTag("");

try
  {

   androidHttpTransport.call(SOAP_ACTION, envelope);

  //  Log.i(TAG, "Raw request to server: \n" +
androidHttpTransport.requestDump);
   // Get the SAOP Envelope back and the extract the body
Object resultsRequestSOAP =   (Object) envelope.getResponse();


   Log.d("isizzle",resultsRequestSOAP.toString());

  }


i am getting the response in different (Unknown ) format

this is the response i got form the server ..

getRatingResponse
{
return=ContestInfo{item=anyType{name=Ankitha; totalimages=2;
rating=2.5; }; item=anyType{name=Anushka; totalimages=4; rating=9.5;
};

regarding this any body help me how to parse this response.


thanks in advance

its urgent  plzz.

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



[android-developers] Re: When Parsing the Soap response problem...

2009-07-14 Thread android.vinny

HI

Thanks For Ur Reply

But it is not a JSON Response

Is there any possiblilities og getting JSON response in Soap Web
Services 


I am consumng NUSoap Web Services

On Jul 12, 3:18 am, Christine  wrote:
> I am not familiar with KSOAP, but if that's the json response you get,
> you canparseit with xstream or any json parser.
>
> On Jul 11, 12:55 pm, "android.vinny"  wrote:
>
> > HI
>
> > I want to Consume the SOAP Web Services in Android
>
> > i downloaded KSOAP2 Library
>
> > i have done some thing like this ..
>
> > private static final String SOAP_ACTION = "getRating";
> > private static final String METHOD_NAME = "getRating";
> > private static final String NAMESPACE = "http://www.w3.org/2001/12/
> > soap-envelope";
> > private static final String URL = "http://www.galatta.com/iphone/
> > isizzle/isizzle.php";
> > private ContextWrapper context;
>
> > /** Called when the activity is first created. */
> > @Override
> > public void onCreate(Bundle icicle)
> > {
> > super.onCreate(icicle);
> > setContentView(R.layout.list);
>
> > //CALL the web service method
> > SoapObjectrequest= new SoapObject(NAMESPACE, METHOD_NAME);
> > SoapSerializationEnvelope envelope = new SoapSerializationEnvelope
> > (SoapEnvelope.VER11);
>
> > envelope.setOutputSoapObject(request);
>
> > AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport
> > (URL);
>
> > try
> > {
>
> > androidHttpTransport.call(SOAP_ACTION, envelope);
>
> > // Get the SAOP Envelope back and the extract the body
> > SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
>
> > }
>
> > i am getting the response from the server like this ..not know
> > what is this type...
>
> > getRatingResponse{return=ContestInfo{item=anyType{name=Ankitha;
> > totalimages=2; rating=2.5; }; item=anyType{name=Anushka;
> > totalimages=4; rating=9.5; }; item=anyType{name=Apsara; totalimages=1;
> > rating=0; };
>
> > how can iparsethis response.
>
> > can any body help me regarding this .
>
> > it urgent ...
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Exception when loading url with HttpURLConnection

2009-07-14 Thread Alex

String urlString = "http://bks7.books.google.com/books?
id=EBY4MAAJ&printsec=frontcover&img=1&zoom=5&sig=ACfU3U2NGdob1xFo6l1Y07qriP1eOHArDw&source=gbs_gdata";
URL url = new URL(urlString);
Bitmap bm = BitmapFactory.decodeStream(url.openStream());

Then, an exception pops up.
***
07-14 16:01:34.218: WARN/System.err(1219): java.io.IOException:
Received authentication challenge is null
07-14 16:01:34.228: WARN/System.err(1219): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal
(HttpURLConnection.java:1592)
07-14 16:01:34.238: WARN/System.err(1219): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest
(HttpURLConnection.java:1547)
07-14 16:01:34.258: WARN/System.err(1219): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLConnection.java:1055)
07-14 16:01:34.268: WARN/System.err(1219): at
java.net.URL.openStream(URL.java:674)
***

Actually, the url points to an image.
Seems it needs some kind of authentication to connect to the url.
But, I can open it with Firefox. Even in android, I can load it with
WebView.
Why can't I load the image with HttpURLConnection?

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



[android-developers] Re: Google route directions no turn by turn Legal & License

2009-07-14 Thread Lex

I am only familiar with the general Maps/Earth API Terms of Use, which
can be found here:

http://code.google.com/apis/maps/terms.html

See if you can find anything there about your issue.

On Jul 13, 2:40 pm, -lm -  wrote:
> Dear Android community,
> i've a license/legal question regarding asking Google directions to be
> drawn directly into the MapView.
> Some of you know that asking googlehttp://maps.google.com/maps/nav
> will give directions in Json + a Polyline encoded form.
>
> What i would like to know is, where is the Terms of Service regarding
> this functionality? It is for Google internal use or not?
> There's also the KML which gives similar informations.
> Please note that it is NOT for real time driving directions but a path
> to be drawn from a point to another and your position NOT refreshed in
> real time and of course it is for an app downloadable free of charge.
>
> Any help would be greately appreciated.
> Thanks,
> LM.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Connect android emulator to internet

2009-07-14 Thread Lex

See Number 3:

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

On Jul 13, 1:28 pm, renjith mp  wrote:
> Hi All,
>
> Please let me know how to connect to internet from android emulator.
> Here  the details of my development environment
>
> Eclipse:eclipse-SDK-3.4.2-win32
> Android:android-sdk-windows-1.1_r1
> Platform :Window vista.32 bit OS
> Internet:Broadband internet connection from some ISP.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Richard Schilling

For some reason, the BATTERY_CHANGED event has stopped being broadcast
by the phone.

I have my application setup properly:

1. I have a broadcast receiver setup with the filter of
"android.intent.action.BATTERY_CHANGED" in the manifest.
2. I have permission of "android.permission.DEVICE_POWER" also defined
in the manifest.

When the application first starts up, I get one BATTERY_CHANGED intent
that the phone gives me.  And, then after that, the phone doesn't
broadcast any more BATTERY_CHANGED intents as the phone is plugged in
and unplugged.

This is really weird.

Richard Schilling
Root Wireless

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



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Richard Schilling

Oh, and I do have permission "android.permission.BATTERY_STATS"
included in the manifest as well.

So. what's wrong?

Any ideas?

Thanks in advance,

Richard Schilling
Root Wireless


On Jul 14, 1:54 am, Richard Schilling 
wrote:
> For some reason, the BATTERY_CHANGED event has stopped being broadcast
> by the phone.
>
> I have my application setup properly:
>
> 1. I have a broadcast receiver setup with the filter of
> "android.intent.action.BATTERY_CHANGED" in the manifest.
> 2. I have permission of "android.permission.DEVICE_POWER" also defined
> in the manifest.
>
> When the application first starts up, I get one BATTERY_CHANGED intent
> that the phone gives me.  And, then after that, the phone doesn't
> broadcast any more BATTERY_CHANGED intents as the phone is plugged in
> and unplugged.
>
> This is really weird.
>
> Richard Schilling
> Root Wireless
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] LayerDrawable for SeekBar

2009-07-14 Thread Alfred

I want to custom the SeekBar.If I used a LayerDrawable that created
from XML as the progressDrawable of SeekBar,it worked well.But, when I
create LayerDrawable in program,it didn't work.Any one can help me?
Thanks.

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



[android-developers] Re: How to force a line break in xml layout when using list adapter?

2009-07-14 Thread Christian S.

Ok - no worries anymore. I got that sorted out. Should use
layout_below instead of layout_toRightOf. Thanks to the anddev team!

On Jul 13, 7:25 pm, "Christian S."  wrote:
> I am struggling with applying a forcedlinebreakin the xml layout
> when using a simple list adapter. The data for the list adapter is
> being pulled from an sqlite db.
>
> Here is the code:
>
>         SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
>                         R.layout.item, cursor, FROM, TO);
>         setListAdapter(adapter);
>
> It should look like this:
> ---­­
>                        Widget1 Widget 2 Widget 3 <= FORCEDLINEBREAK
> SHOULD COME HERE
> Widget3 Widget4 Widget5  W6 W7 W8 W9 W10 W11 W12
> ---­­
>                        Widget1 Widget 2 Widget 3 <= FORCEDLINEBREAK
> SHOULD COME HERE
> Widget3 Widget4 Widget5  W6 W7 W8 W9 W10 W11 W12
> ---­­
>                        Widget1 Widget 2 Widget 3 <= FORCEDLINEBREAK
> SHOULD COME HERE
> Widget3 Widget4 Widget5  W6 W7 W8 W9 W10 W11 W12
> ---­­
>          ...
> ---­­
>
> And here is the R.layout.item xml:
>
> 
>
>     xmlns:android="http://schemas.android.com/apk/res/android";
>    android:layout_width="fill_parent"
>    android:layout_height="fill_parent"
>    android:orientation="horizontal"
>    android:padding="4sp">
>           android:id="@+id/widget1"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>       android:textStyle="bold" />
>           android:id="@+id/widget2"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=" : "
>       android:textSize="15sp"
>             android:textStyle="bold"
>       android:layout_toRightOf="@id/widget1" />
>           android:id="@+id/widget3"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>             android:textStyle="bold"
>       android:layout_toRightOf="@id/widget2" />
>           android:id="@+id/widget4"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=" "
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget3" />
>           android:id="@+id/widget5"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>             android:textStyle="bold"
>       android:layout_toRightOf="@id/widget4"/>
>           android:id="@+id/widget6"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=" : "
>       android:textSize="15sp"
>             android:textStyle="bold"
>       android:layout_toRightOf="@id/widget5" />
>           android:id="@+id/widget7"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>             android:textStyle="bold"
>       android:layout_toRightOf="@id/widget6"/>
>           android:id="@+id/widget8"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=" ("
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget7" />
>           android:id="@+id/widget9"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget8"/>
>           android:id="@+id/widget10"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=" : "
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget9" />
>           android:id="@+id/widget11"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget10"/>
>           android:id="@+id/widget12"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:text=")"
>       android:textSize="15sp"
>       android:layout_toRightOf="@id/widget11" />
>
> 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~

[android-developers] Re: how to use adb tool on SAMSUNG GALAXY?

2009-07-14 Thread sasq

Have you turned on debugging from the phones settings?
(Applications -> Development -> USB debugging)


On Jul 11, 9:54 pm, da yang  wrote:
> Hi
> i got this new mobilephone this week in Germany, wanted to debug my
> program on the device. but it doesn't work, "c:\> adb devices" lists
> no device attached, though i have tried to change the
> "android_usb.inf" in order to install the usb driver from SDK.
> i added some entries as follows:
> under
> [Google.NTx86]
>
> ; HTC DREAM
> ...
>
> ; SAMSUNG GALAXY
> %USB\VID_04E8&PID_6640.
> DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640
> %USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640&MI_01
> %USB\VID_04E8&PID_6640.DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640
>
> and [Strings]:
>
> USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNG GALAXY"
> USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease="SAMSUNG GALAXY
> Composite ADB Interface"
> USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNG GALAXY Bootloader"
>
> i got only one VID and one PID through
> USBVIEW, though for HTC DREAM there are different PIDs used.
> The adb interface got installed, but adb just didn't work.
>
> later i also tried to use the device under linux, set up the device as
> in Dev guide:
>
> If you're developing on Ubuntu Linux, you need to add a rules file:
>
>    1. Login as root and create this file: /etc/udev/rules.d/51-
> android.rules.
>
>       For Gusty/Hardy, edit the file to read:
>       SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
>
>       For Dapper, edit the file to read:
>       SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
>    2. Now execute:
>       chmod a+rx /etc/udev/rules.d/51-android.rules
>
> "adb devices" listed nothing as well. : (
>
> open a terminal on the device, with "ps", i guess the adb daemon
> "adbd" is running.
> but the adb tool just doesn't work.
>
> Can someone help me?
>
> thanks da
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google route directions no turn by turn Legal & License

2009-07-14 Thread -lm -

Thanks Lex
as far as i know here's the implications of the SDK license:


8.1 Google Data APIs

8.1.1 If you use any API to retrieve data from Google, you acknowledge
that the data may be protected by intellectual property rights which
are owned by Google or those parties that provide the data (or by
other persons or companies on their behalf). Your use of any such API
may be subject to additional Terms of Service. You may not modify,
rent, lease, loan, sell, distribute or create derivative works based
on this data (either in whole or in part) unless allowed by the
relevant Terms of Service

--> This SHOULD (because of the domain of the url i'm calling. ??)
lead to the MAPS API Terms of Service which:

10.9 use the Service or Content with any products, systems, or
applications for or in connection with:
(a) real time navigation or route guidance, including but not limited
to turn-by-turn route guidance that is synchronized to the position of
a user's sensor-enabled device;

--> that is not the case because is not synchronized.

10.12 use or display the Content without a corresponding Google map

--> that is not the case since the mapview is a google map

10.8 use the Static Maps API other than in an implementation in a web
browser

--> it is not static maps so directions can be used in the mobile too.

--> In Addition using Maps add-on means another TOS: Android Maps APIs
Terms of Service

Content, not limited to map data, traffic, and directions, is provided
for
planning purposes only.  You may find that weather conditions,
construction
projects, closures, or other events may cause road conditions or
directions to
differ from the results depicted in the Content.  You should exercise
judgment
in your use of the Content.

--> directions drawn into the ANDROID map IS allowed thus.

In addition to the license granted here, you may use certain Content
according
to the terms set forth in our Permission Guidelines for Google Maps
and Google
Earth.

--> back to the Maps api TOS!

So the question is: Does the service http://maps.google.com/maps/nav
INCLUDED into the Google Maps Api TOS?

Please guys help me understand legal implications
Thanks again.

LM.





On 14 Lug, 10:29, Lex  wrote:
> I am only familiar with the general Maps/Earth API Terms of Use, which
> can be found here:
>
> http://code.google.com/apis/maps/terms.html
>
> See if you can find anything there about your issue.
>
> On Jul 13, 2:40 pm, -lm -  wrote:
>
> > Dear Android community,
> > i've a license/legal question regarding asking Googledirectionsto be
> > drawn directly into the MapView.
> > Some of you know that asking googlehttp://maps.google.com/maps/nav
> > will givedirectionsin Json + a Polyline encoded form.
>
> > What i would like to know is, where is the Terms of Service regarding
> > this functionality? It is for Google internal use or not?
> > There's also the KML which gives similar informations.
> > Please note that it is NOT for real time drivingdirectionsbut a path
> > to be drawn from a point to another and your position NOT refreshed in
> > real time and of course it is for an app downloadable free of charge.
>
> > Any help would be greately appreciated.
> > Thanks,
> > LM.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: httpclient multipart form upload

2009-07-14 Thread jottos

So, figured this out, and you were not too far from the answer.
Our router was hanging up the requests that were going outbound and
then back into our internal staging server.
No idea why, but once we understood that and pointed the app at an
external server, or used cellular connections everything works

this one was up there on the pain scale


On Jul 13, 7:46 pm, John Smith  wrote:
> 2009/7/13 jottos 
>
> > Is there any setup android requires to make a post/multipart file
> > upload work that you didn't specify in your example?
> > On Jun 26, 8:53 pm, Delta Foxtrot  wrote:
>
> Nope I copied the code from an actual application I have working, the
> difference might be the servers we're communicating with. The great thing
> about standards is there is so many to pick from :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multipart file post fails

2009-07-14 Thread jottos

Solved

Our router was hanging up the requests from the phone that were going
outbound and then back into our internal staging server. No idea why,
but once I understood that and pointed the app at an external server,
or used cellular connections everything works

Everyone please feel free to use multipart/form-data class. it works
great.

One bit of cleanup that can be done quickly on the class is to lose
the getResponse() method on the class in favor of the
conn.getResponseMethod() which is on the HttpURLConnection class.

jos


On Jul 13, 10:18 am, jottos  wrote:
> I have a class that implements a multipart file upload. The code works
> on every java client I've tried it on but does not work on Android,
> *and* it's the only HTTP request code in my Android app that doesn't
> play nice with my back end service. I've looked through the posts to
> see if other are having similar issues but so far have only found
> posts like 
> thishttp://groups.google.com/group/android-developers/msg/c4b0270153d194d9
> , which are nearly the same as mine.
> T
> The symtoms I'm seeing are that the connection responseCode is "-1" &
> no entries show up in the Apache access or error logs. It seems as if
> the request is never making it off of the android platform. The code
> gets right through the connection writes in the debugger with no
> errors, but hangs on the connection read, times out and then returns
> with -1. Behavior is same for real phone and emulator. As I mentioned,
> this code is in use elsewhere and works fine.
>
> Does anyone know of any gotchas one needs to look out for when posting
> a multipart file in Android? Anything about doing a POST or a POST w/
> data on Android?
>
> I'm including the code/class below so you can see what I'm up to.
>
> package com.abaqus.georecorder;
>
> import java.io.ByteArrayOutputStream;
> import java.io.DataInputStream;
> import java.io.DataOutputStream;
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.io.InputStream;
> import java.net.HttpURLConnection;
> import java.net.MalformedURLException;
> import java.net.URL;
> import android.util.Log;
>
> public class GeoPictureUploader
> {
>     static String serviceDomain = "http://staging.abaqus.net";;
>     static String postUrl = serviceDomain + "/geo/upl/wupload/
> pictures";
>     static String CRLF = "\r\n";
>     static String twoHyphens = "--";
>     static String boundary = "*mgd*";
>
>     private static String TAG = "PictureUploader";
>
>     private String pictureFileName = null;
>     private String name = null;
>     private String password = null;
>     private DataOutputStream dataStream = null;
>
>     enum ReturnCode { noPicture, unknown, http201, http400, http401,
> http403, http404, http500};
>
>     public GeoPictureUploader(String name, String password)
>     {
>         this.name = name;
>         this.password = password;
>     }
>
>     public static void setServiceDomain(String domainName)
>     {
>         serviceDomain = domainName;
>     }
>
>     public static String getServiceDomain()
>     {
>         return serviceDomain;
>     }
>
>     public ReturnCode uploadPicture(String pictureFileName)
>     {
>         this.pictureFileName = pictureFileName;
>         File uploadFile = new File(pictureFileName);
>
>         if (uploadFile.exists())
>             try
>             {
>                 FileInputStream fileInputStream = new FileInputStream
> (uploadFile);
>                 URL connectURL = new URL(postUrl);
>                 HttpURLConnection conn = (HttpURLConnection)
> connectURL.openConnection();
>                 conn.setDoInput(true);
>                 conn.setDoOutput(true);
>                 conn.setUseCaches(false);
>                 conn.setRequestMethod("POST");
>                 conn.setRequestProperty("User-Agent", "myGeoDiary-
> V1");
>                 conn.setRequestProperty("Connection","Keep-Alive");
>                 conn.setRequestProperty("Content-Type","multipart/form-
> data;boundary="+boundary);
>                 conn.connect();
>
>                 dataStream = new DataOutputStream(conn.getOutputStream
> ());
>
>                 writeFormField("login", name);
>                 writeFormField("password", password);
>                 writeFormField("fileName", "anyName.jpg"); // this
> field not used, but needed for validator
>                 writeFormField("data", "none"); // again, that damned
> spring validator
>                 writeFileField("photo1", pictureFileName, "image/jpg",
> fileInputStream);
>
>                 // final closing boundary line
>                 dataStream.writeBytes(twoHyphens + boundary +
> twoHyphens + CRLF);
>
>                 fileInputStream.close();
>                 dataStream.flush();
>                 dataStream.close();
>                 dataStream = null;
>
>                 String response = getResponse(conn);
>
>                 Log.e(TAG, "GeoPictureUploader.uploadPicture g

[android-developers] Re: httpclient multipart form upload

2009-07-14 Thread John Smith
2009/7/14 jottos 

>
> So, figured this out, and you were not too far from the answer.
> Our router was hanging up the requests that were going outbound and
> then back into our internal staging server.
> No idea why, but once we understood that and pointed the app at an
> external server, or used cellular connections everything works


Did you try the apache code, did it work at all, or did it fail too?

this one was up there on the pain scale
>

Aren't all corner cases that take a lot of time on the pain scale? :)

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



[android-developers] force repaint after setVisibility

2009-07-14 Thread condor

Hello I have a view containing a ListView and a keybord

By default the Keyboard is on visibility status = to GONE.

At one moment I want to show the keyboard to modify a value selected
in the list.

So I set keybord visible, and a set the selected element in top of the
shown list.

  theKeyboard.setVisibility(View.VISIBLE);
  theListView.setSelectionFromTop(position, 0);

But the refresh of the list view is done after the setSelection with
the old values for the item in top position.

How I can force to paint the new layout before to launch the
setSelection?

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



[android-developers] SurfaceViews handling, Thread, and general game design

2009-07-14 Thread ayanir

Hello,

I'm a new Android developer.
I would like to make a simple game using the SurfaceView (Canvas
drawing).

the game has a a custom Object name Box. Box can draw itself and need
to get an event when it is clicked. when it does, there is an
animation sequence coming out of the box like a "jumping clown".
I have several Boxes on the screen when each of them can be activated.
Several Boxes animation can also be presented simultaneously.

Here it gets tricky:
Since I have a "complicated" animation sequence, each Box extends
SurfaceView.
The problem is I haven't figured it out how can I handle several
SurfaceView's drawing using only one Thread (in order to present an
animation I need to use one) and also how can I get the onClick/
onThouch event from my Activity to each of my Boxes.

The LunarLanding example in the SDK uses only one Thread but also uses
only one SurfaceView which manage the animation of the game components
(there are no several game components SurfaceViews). Also, there is no
need to get onTouch event, so this example doesn't match to my case.

I have several questions about what is the right approach do code
this:
1. Should I use Box extends SurfaceView?
2. Can SurfaceView gets user events like onTouch/onClick?
3. Is there a way to add to the "main" SurfaceView another SurfaceView
(Box)?
4. If none of the above questions is positive, should I use one
SurfaceView (and one Thread) and try to map the other Boxes on the
screen for user event handling. I mean Box only paints itself but the
user event is being handled by me (not by the OS).
5. Should each Box (SurfaceView) should handle it's own Thread in case
of animation (it is not good design but it is also an option)?
6. do you have any other proposal?

I know that these are a lot of questions but I'll appreciate if you
can answer some of them.

Thanks in advance,
ayanir



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



[android-developers] Re: Is Zoom in And Zoom out is Possible for Image View In android............

2009-07-14 Thread hanged_man

you can use the default image viewer using intents (you dont have to
implement your own), i don't remember exactly how it is done but ill
send you the code in a few hours.

On Jul 14, 8:37 am, Desu Vinod Kumar  wrote:
> Hi
>
> One More thing I need to Specify 
>
> I need to zoom in and Zoom out with Touch ... not with key events 
>
> On Tue, Jul 14, 2009 at 10:50 AM, android.vinny wrote:
>
>
>
> > Hi
>
> > Is Zooming is possible to do in android for Image view .
> > I have a images in full screen view, i need to zoom in and zoom out
> > for that images present in image view .
> > Can any body give me suggestions regarding this
>
> > Thanks in advance.
>
> --
> Regards
> ---
> Desu Vinod Kumar
> vinny.s...@gmail.com
> 09916009493
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is Zoom in And Zoom out is Possible for Image View In android............

2009-07-14 Thread Desu Vinod Kumar
Hi

Thanks for giving response ..

if u send the code it will be very helpful for me



On Tue, Jul 14, 2009 at 5:09 PM, hanged_man  wrote:

>
> you can use the default image viewer using intents (you dont have to
> implement your own), i don't remember exactly how it is done but ill
> send you the code in a few hours.
>
> On Jul 14, 8:37 am, Desu Vinod Kumar  wrote:
> > Hi
> >
> > One More thing I need to Specify 
> >
> > I need to zoom in and Zoom out with Touch ... not with key events 
> >
> > On Tue, Jul 14, 2009 at 10:50 AM, android.vinny  >wrote:
> >
> >
> >
> > > Hi
> >
> > > Is Zooming is possible to do in android for Image view .
> > > I have a images in full screen view, i need to zoom in and zoom out
> > > for that images present in image view .
> > > Can any body give me suggestions regarding this
> >
> > > Thanks in advance.
> >
> > --
> > Regards
> > ---
> > Desu Vinod Kumar
> > vinny.s...@gmail.com
> > 09916009493
> >
>


-- 
Regards
---
Desu Vinod Kumar
vinny.s...@gmail.com
09176147148

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



[android-developers] Re: Problem in running the android sky widget

2009-07-14 Thread bhoj

same here even I am facing the same problem

On Jul 14, 11:07 am, n179911  wrote:
> Hi,
>
> I have download the android sky project and able to get it to compile
> it under eclipse.
>
> http://code.google.com/p/android-sky/
>
> But when i try to add a 'Forecast' Widget on emulator, it pops up a
> 'Configure forecast widget',
> then I click 'Manual search' , I entered '60005' as my zip code. Then
> I press the 'Search' Icon.
>
> Then what should I do to next? Both 'Verify on Map' and 'Save' buttons
> are disabled. I am not sure what else do i need to do to run it on
> emulator?
>
> Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Connect android emulator to internet

2009-07-14 Thread Desu Vinod Kumar
HI

U need to connect the internet in application



add these permission in android manifest file


or

u want to use internet in emulator browser.

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

go through these steps


On Mon, Jul 13, 2009 at 4:58 PM, renjith mp  wrote:

>
> Hi All,
>
> Please let me know how to connect to internet from android emulator.
> Here  the details of my development environment
>
> Eclipse:eclipse-SDK-3.4.2-win32
> Android:android-sdk-windows-1.1_r1
> Platform :Window vista.32 bit OS
> Internet:Broadband internet connection from some ISP.
>
> >
>


-- 
Regards
---
Desu Vinod Kumar
vinny.s...@gmail.com
09176147148

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



[android-developers] Re: oauth_callback is not calling the activity

2009-07-14 Thread dar

At first glance, it looks like the host parameter does not match your
oauth_callback.

On Jul 13, 7:16 pm, bo  wrote:
> I have a Twitter app and I need user of my Android application to
> authorize its use. I'm at the point where I can call Twitter app page
> in the browser from my code and successfully authorize. However, the
> callback seem not to be working, I end up with the confirmation
> message and PIN in the browser but my Android activity is never called
> (onResume is not triggered) and browser just stays open. Here's what I
> have
>
>    1. Twitter URL which starts activity in the external 
> browser:http://twitter.com/oauth/authorize?oauth_token=actualtokenhere&oauth_...
>    2. In my activity definition I have this intent-filter
>
>               
>                        android:name="android.intent.action.VIEW" />
>                        android:name="android.intent.category.DEFAULT" />
>                        android:name="android.intent.category.BROWSABLE" />
>                   
>           
>
>    3. As I stated - I get confirmation but not redirect so the Android
> app is never called back
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: List View not properly updated from AsyncTask

2009-07-14 Thread pperotti

Hi Romain,

I am actually using in List3 adapter.notifyDatasetChanged(). This do
not freeze the app but do not allow the user to scroll perfectly as in
List1. For some reason (the amount of operations probably in the
AsyncTask) the ListView is not entirely independent from the data set
affecting the user's interaction.

Any comment about why this happens ?

Pablo

On 14 jul, 02:21, Romain Guy  wrote:
> Do NOT call invalidateViews(), it calls ListView to throw everything
> away. Use Adapter.notifyDatasetChanged() instead.
>
> On Mon, Jul 13, 2009 at 10:15 PM,pperotti wrote:
>
> > Hi Everyone,
>
> > After digging with the APIs I still cannot figure out how the
> > AsyncTask properly works and why some behavior occur.
>
> > I'm trying  to achieve one contact list that can be updated from a
> > background async task very frequently. There are situations where
> > invoking UI updates from the background thread just freeze the UI as
> > you see in example #2. or make the list not to react properly to
> > finger as a regular contact list. Can anyone give me some hint on how
> > to achieve the expected behavior?
>
> > I added here the activities that form my project (sorry for the lenght
> > of the post, my idea was to share the complete problem with everyone)
>
> > Example 1: Contact list without background task. This code contains
> > the behavior of a default contact list. This code produce the expected
> > behavior in responsive for the user but do not update. This activity
> > shows the ideal response for a contact list.
>
> > package com.pp.lists;
>
> > import android.app.ListActivity;
> > import android.content.Intent;
> > import android.hardware.SensorManager;
> > import android.os.Bundle;
> > import android.view.View;
> > import android.widget.ArrayAdapter;
> > import android.widget.Button;
>
> > public class List1 extends ListActivity implements
> > View.OnClickListener {
>
> >    Button btnBack = null;
> >    SensorManager sensorManager = null;
>
> >    String[] items = { "lorem", "ipsum", "dolor", "sit", "amet",
> > "consectetuer", "adipiscing", "elit", "morbi", "vel",
> >            "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam",
> > "vel", "erat", "placerat", "ante", "porttitor",
> >            "sodales", "pellentesque", "augue", "purus", "lorem",
> > "ipsum", "dolor", "sit", "amet", "consectetuer",
> >            "adipiscing", "elit", "morbi", "vel", "ligula", "vitae",
> > "arcu", "aliquet", "mollis", "etiam", "vel",
> >            "erat", "placerat", "ante", "porttitor", "sodales",
> > "pellentesque", "augue", "purus", "lorem", "ipsum",
> >            "dolor", "sit", "amet", "consectetuer", "adipiscing",
> > "elit", "morbi", "vel", "ligula", "vitae", "arcu",
> >            "aliquet", "mollis", "etiam", "vel", "erat", "placerat",
> > "ante", "porttitor", "sodales", "pellentesque",
> >            "augue", "purus", "lorem", "ipsum", "dolor", "sit",
> > "amet", "consectetuer", "adipiscing", "elit", "morbi",
> >            "vel", "ligula", "vitae", "arcu", "aliquet", "mollis",
> > "etiam", "vel", "erat", "placerat", "ante",
> >            "porttitor", "sodales", "pellentesque", "augue",
> > "purus" };
>
> >    /** Called when the activity is first created. */
> >   �...@override
> >    public void onCreate( Bundle savedInstanceState ) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.listdemo);
> >        setListAdapter(new ArrayAdapter(this,
> > R.layout.listitem, R.id.label, items));
>
> >        btnBack = (Button) findViewById(R.id.btnBackFromList);
> >        btnBack.setOnClickListener(this);
> >    }
>
> >    public void onClick( View arg0 ) {
> >        if ( btnBack == arg0 ) {
> >            startActivity(new Intent(this, Main.class));
> >        }
> >    }
>
> >    public void onResume() {
> >        System.out.println("List1.onResume!");
> >        super.onResume();
> >    }
>
> >    public void onPause() {
> >        System.out.println("List1.onPause!");
> >        super.onPause();
> >    }
>
> > }
>
> > Example 2: This example update the contact list very frequently
> > properly but without freezing DO NOT allow the user to even scroll.
>
> > package com.pp.lists;
>
> > import android.app.ListActivity;
> > import android.content.Intent;
> > import android.os.AsyncTask;
> > import android.os.Bundle;
> > import android.os.Handler;
> > import android.view.View;
> > import android.widget.ArrayAdapter;
> > import android.widget.Button;
> > import android.widget.EditText;
> > import android.widget.ListView;
>
> > public class List2 extends ListActivity implements
> > View.OnClickListener {
>
> >    Button btnBack = null;
> >    Handler handler = new Handler();
>
> >    String[] items = { "lorem", "ipsum", "dolor", "sit", "amet",
> > "consectetuer", "adipiscing", "elit", "morbi", "vel",
> >            "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam",
> > "vel", "erat", "placerat", "ante", "porttitor",
> >            "sodales", "pellentesque", "augue

[android-developers] Re: Associate app to open email attachments

2009-07-14 Thread Mirko Nasato

On Jul 10, 7:13 pm, Alexey Krasnoriadtsev 
wrote:
> You are correct that you should use contentResolver.openInputStream
> (uri), to get the data from gmailattachments.
>
Thanks Alexey, will try that for integrating with the GMail app.

> Default Email app, is very dumb and is hardcoded to only open audio
> and imageattachments.
> (disclaimer, that was the case 6 month ago, the last time i looked at
> it).
>
That's still the case, looking at the 1.5r2 source:
com.android.email.Email uses a hard-coded array of
ACCEPTABLE_ATTACHMENT_VIEW_TYPES.

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



[android-developers] Disabling Screen Break with subsequent Preference Screens through XML.

2009-07-14 Thread Ravi

Hi,

I need to display another PreferenceScreen through xml which occupies
the full screen.

Calling addPrefrencesFromResource(id)  with different id results in
Screen Break handled by Preference Framework.


setPreferenceScreen(mPS) could be called again & it works fine but it
is through code...How do I do it through XML?

Neither inflateFromResource() not PreferenceInflater is available so,
I can't use setPreferenceScreen for XML?

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



[android-developers] Re: how to obtain a virgin map ?

2009-07-14 Thread Eden

yes thx i found it but this code needs an internet connection so if
it's impossible to connect there no map view or no ? anyway it seems
to be the best way to obtain a virgin map... i' m waiting for others
advices.

N.B : what is the proportion of android smartphones having a full time
internet connection (90% more) ?






On Jul 14, 4:48 am, John Smith  wrote:
> 2009/7/12 Eden 
>
>
>
> > Is there a way to obtain a virgin map with the Google Map Api or other
> > API (no city and country names, i want only country borders) ?
>
> The osmdroid map code and a custom tile set of world land boundaries.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to obtain a virgin map ?

2009-07-14 Thread John Smith
2009/7/14 Eden 

>
> yes thx i found it but this code needs an internet connection so if
> it's impossible to connect there no map view or no ? anyway it seems
> to be the best way to obtain a virgin map... i' m waiting for others
> advices.
>

Nope, it can cache files to sdcard or you can download prebuilt tile packs,
or make your own tile packs.

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



[android-developers] Re: List View not properly updated from AsyncTask

2009-07-14 Thread Streets Of Boston

First:
You directly modify the activity's attribute 'items' (that serves as
your data in your list-adapter) in your background thread, without any
proper synchronization with the main GUI-thread. This is bad news. It
may work for a while, but it's bound to fail at some point.

Second (and i assume that you're using notifyDataSetChanged instead of
invalidateViews now):
In your third example (and in lesser degree in the second example),
you update (sort) your list of 'items' in a tight loop (while (!
isCancelled()) {...}). I don't understand why you want to do this. If
the phone is fast, the users of your app won't see the sorting
happening. It will all be too fast. You should add a sleep-statement
to be able to show the sort-result.
Also, because it's in a tight loop, your background thread takes waaay
too many CPU cycles. Again, put in a sleep (and maybe even lower the
thread's priority).

Third:
How do you do a 'return null' on a method that is declared to return
nothing (void)?


On Jul 14, 1:15 am, pperotti  wrote:
> Hi Everyone,
>
> After digging with the APIs I still cannot figure out how the
> AsyncTask properly works and why some behavior occur.
>
> I'm trying  to achieve one contact list that can be updated from a
> background async task very frequently. There are situations where
> invoking UI updates from the background thread just freeze the UI as
> you see in example #2. or make the list not to react properly to
> finger as a regular contact list. Can anyone give me some hint on how
> to achieve the expected behavior?
>
> I added here the activities that form my project (sorry for the lenght
> of the post, my idea was to share the complete problem with everyone)
>
> Example 1: Contact list without background task. This code contains
> the behavior of a default contact list. This code produce the expected
> behavior in responsive for the user but do not update. This activity
> shows the ideal response for a contact list.
>
> package com.pp.lists;
>
> import android.app.ListActivity;
> import android.content.Intent;
> import android.hardware.SensorManager;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.ArrayAdapter;
> import android.widget.Button;
>
> public class List1 extends ListActivity implements
> View.OnClickListener {
>
>     Button btnBack = null;
>     SensorManager sensorManager = null;
>
>     String[] items = { "lorem", "ipsum", "dolor", "sit", "amet",
> "consectetuer", "adipiscing", "elit", "morbi", "vel",
>             "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam",
> "vel", "erat", "placerat", "ante", "porttitor",
>             "sodales", "pellentesque", "augue", "purus", "lorem",
> "ipsum", "dolor", "sit", "amet", "consectetuer",
>             "adipiscing", "elit", "morbi", "vel", "ligula", "vitae",
> "arcu", "aliquet", "mollis", "etiam", "vel",
>             "erat", "placerat", "ante", "porttitor", "sodales",
> "pellentesque", "augue", "purus", "lorem", "ipsum",
>             "dolor", "sit", "amet", "consectetuer", "adipiscing",
> "elit", "morbi", "vel", "ligula", "vitae", "arcu",
>             "aliquet", "mollis", "etiam", "vel", "erat", "placerat",
> "ante", "porttitor", "sodales", "pellentesque",
>             "augue", "purus", "lorem", "ipsum", "dolor", "sit",
> "amet", "consectetuer", "adipiscing", "elit", "morbi",
>             "vel", "ligula", "vitae", "arcu", "aliquet", "mollis",
> "etiam", "vel", "erat", "placerat", "ante",
>             "porttitor", "sodales", "pellentesque", "augue",
> "purus" };
>
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate( Bundle savedInstanceState ) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.listdemo);
>         setListAdapter(new ArrayAdapter(this,
> R.layout.listitem, R.id.label, items));
>
>         btnBack = (Button) findViewById(R.id.btnBackFromList);
>         btnBack.setOnClickListener(this);
>     }
>
>     public void onClick( View arg0 ) {
>         if ( btnBack == arg0 ) {
>             startActivity(new Intent(this, Main.class));
>         }
>     }
>
>     public void onResume() {
>         System.out.println("List1.onResume!");
>         super.onResume();
>     }
>
>     public void onPause() {
>         System.out.println("List1.onPause!");
>         super.onPause();
>     }
>
> }
>
> Example 2: This example update the contact list very frequently
> properly but without freezing DO NOT allow the user to even scroll.
>
> package com.pp.lists;
>
> import android.app.ListActivity;
> import android.content.Intent;
> import android.os.AsyncTask;
> import android.os.Bundle;
> import android.os.Handler;
> import android.view.View;
> import android.widget.ArrayAdapter;
> import android.widget.Button;
> import android.widget.EditText;
> import android.widget.ListView;
>
> public class List2 extends ListActivity implements
> View.OnClickListener {
>
>     Button btnBack = null;
>     Handler handler = new Ha

[android-developers] Re: How to write async socket with Android?

2009-07-14 Thread Walter

You usually need different threads to read  and write, prevent
blocking the UI thread.

On Jul 14, 12:49 am, Victor Lin  wrote:
> Well, but will the read of InputStream blocked when there is no
> incoming data?
> I mean... for example:
>
> I run the sock in specific thread, because those methods' call will
> blocked. The code might like this:
>
> /// This is the socket thread for checking data
> while not stop:
>     data = read(); // if no incoming data, we will blocked here
>
> The client program needs to check the data from sever, so it run a
> loop to read data. And how about outgoing data? Can I send out going
> data from another thread? like this.
>
> // this is called from UI thread
> void onClick() {
>     outputStream.write("hello baby!");
>
> }
>
> On 7月14日, 下午2時21分, James <030440...@163.com> wrote:
>
>
>
> > Hi Victor Lin:
> > I don't know why could your problem happen,As One socket have both
> > inputstream and outputstreams,They are responsible for read and write;
> > And as far as i call tell,Socket is not android-specified,Hope this
> > helps!
>
> > Bgs!
> > James
>
> > On Jul 14, 12:57 pm, Victor Lin  wrote:
>
> > > Hi,
>
> > > I am developing a program that needs async socket. I am new to Android
> > > and Java. As I can see in the document, to write network program, I
> > > got Socket and SocketChannel, but it seems they are all sync socket,
> > > it means, I need an extra thread to call blocking read, write... and
> > > etc. Here comes the problem, my program is a chat room, the
> > > communicate is not linear, I have no idea when the server will send a
> > > message to me, if I read in that thread to wait message from server,
> > > but the user want to send message to server, the reading function
> > > blocked forever, if there is no incoming data, then the pending
> > > outgoing message will not be sent. That's why I need async socket. So
> > > my question is: How to write async socket under Android environment?
>
> > > Thanks.
> > > Victor Lin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to obtain a virgin map ?

2009-07-14 Thread Eden

thanx John !!

i need to examine your solution, but if i use getResources
().openRawResource(R.raw.tile), i could retrieve my own tile or i'm
mistaken ?

On Jul 14, 4:07 pm, John Smith  wrote:
> 2009/7/14 Eden 
>
>
>
> > yes thx i found it but this code needs an internet connection so if
> > it's impossible to connect there no map view or no ? anyway it seems
> > to be the best way to obtain a virgin map... i' m waiting for others
> > advices.
>
> Nope, it can cache files to sdcard or you can download prebuilt tile packs,
> or make your own tile packs.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] can i connect to flash media server in android

2009-07-14 Thread zeeshan

Hi Experts,

i need to connect to flash media server to stream live video from
android.
can anybody help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OpenGL ES, How to rotate a cube?(3D Rotation)

2009-07-14 Thread quill

In the api demo, there is an example for how to rotate a cube, but it
can only rotate about X axis or Y axis, without Z-Axis Rotation.
So how to perform 3D Rotation? Any advice is 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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to obtain a virgin map ?

2009-07-14 Thread John Smith
2009/7/15 Eden 

>
> thanx John !!
>
> i need to examine your solution, but if i use getResources
> ().openRawResource(R.raw.tile), i could retrieve my own tile or i'm
> mistaken ?
>

No idea, I've never needed to only use it offline.

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



[android-developers] help with Text size

2009-07-14 Thread Sujay Krishna Suresh
Hi all,
   I have a user preference to get the text size in my
application.
It works fine when it is used with textView.setTextSize(textsize);
but when i use it with paint.setTextSize(textsize) & then
canvas.drawtext(), the size becomes t large...
Plz help me with this... is there any conversion between the 2  textsizes???


-- 
Regards,
Sujay
Gilda Radner 
- "Adopted kids are such a pain - you have to teach them how to look
like
you."

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



[android-developers] Re: OpenGL ES, How to rotate a cube?(3D Rotation)

2009-07-14 Thread Streets Of Boston

Take a careful look at the API Demo code.
And then take a look at the OpenGL ES documentation (http://
www.khronos.org/opengles/)
Having the code that shows you how to rotate around the X or Y axis,
it should not be hard to figure out how to rotate along the Z axis

On Jul 14, 11:23 am, quill  wrote:
> In the api demo, there is an example for how to rotate a cube, but it
> can only rotate about X axis or Y axis, without Z-Axis Rotation.
> So how to perform 3D Rotation? Any advice is 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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Limit content provider access

2009-07-14 Thread AndroidKing

Thanks for the reply

That doesn't really help
I want to limit the access based on the package name.
The package name will have different signature from my App.
I added android:readPermission and android:writePermission to the
content provider
but what is the use, any package can add these two permissions and
still access the content provider
I think Android is missing the access limitation...

any other way???


On Jul 14, 2:23 am, Dianne Hackborn  wrote:
> By far the easiest way is to do this based on app certificates -- just use
> android:readPermission and android:writePermission in the manifest, and
> declare the permission you are using there with  to be
> android:protectionLevel="signature".  Then only apps signed with the same
> certificate as your own will be able to get the permission, and thus able to
> read/write the provider.
>
> On Mon, Jul 13, 2009 at 6:27 PM, AndroidKing  wrote:
>
> > is there an easy way to limit my content provider access to only one
> > or more packages
> > I don't want other packages to access my data
>
> > I looked at   grantUriPermission  but its not straight forward and it
> > doesn't work
>
> > any ideas?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Home screen widgets and menu?

2009-07-14 Thread Kaj Bjurman

Hi,

I'd like to know what the prefered way is when it comes to associating
a menu with a home screen widget? I guess that it can't have an option
menu, since it isn't an activity, and that it can't have a context
menu since press-and-hold is used to move a home screen widget.

What to do? Click on my widget currently opens upp a dialog that
displays detailed information, and I would really like to have that on
click. I guess I could display a menu there instead, and then let the
user click in that menu in order to view details, but I don't like the
fact that the user in that case has to click twice.

Regards
Kaj

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



[android-developers] Re: Limit content provider access

2009-07-14 Thread Dianne Hackborn
You can limit who can get the permissions based on certificate, to control
who can get the permission, using android:protectionLevel="signature".

The package name is not secure at all -- anyone can write an app with a
particular package name, you have no idea what app it actually is based on
that.  If you really want to do this based on package name, you can
implement the security check yourself at the points of call into your
content provider (such as the query() method) -- you can use
Binder.getCallingUid() to find out who is calling you and the PackageManager
to find the package(s) associated with that.  The platform doesn't provide
any easy way to to this, though, because it is does not provide any actual
security.

On Tue, Jul 14, 2009 at 8:37 AM, AndroidKing  wrote:

>
> Thanks for the reply
>
> That doesn't really help
> I want to limit the access based on the package name.
> The package name will have different signature from my App.
> I added android:readPermission and android:writePermission to the
> content provider
> but what is the use, any package can add these two permissions and
> still access the content provider
> I think Android is missing the access limitation...
>
> any other way???
>
>
> On Jul 14, 2:23 am, Dianne Hackborn  wrote:
> > By far the easiest way is to do this based on app certificates -- just
> use
> > android:readPermission and android:writePermission in the manifest, and
> > declare the permission you are using there with  to be
> > android:protectionLevel="signature".  Then only apps signed with the same
> > certificate as your own will be able to get the permission, and thus able
> to
> > read/write the provider.
> >
> > On Mon, Jul 13, 2009 at 6:27 PM, AndroidKing 
> wrote:
> >
> > > is there an easy way to limit my content provider access to only one
> > > or more packages
> > > I don't want other packages to access my data
> >
> > > I looked at   grantUriPermission  but its not straight forward and it
> > > doesn't work
> >
> > > any ideas?
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


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

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

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



[android-developers] Re: how to use adb tool on SAMSUNG GALAXY?

2009-07-14 Thread legerb

Hey,
I just got this device too. Trying to figure out how to debug on
device too.
According this 
http://groups.google.com/group/android-beginners/browse_thread/thread/167b279683bddc8a
Samsung have their own adb.
Please update the thread if you've got any progress :)

thanks ahead!

On Jul 11, 10:54 pm, da yang  wrote:
> Hi
> i got this new mobilephone this week in Germany, wanted to debug my
> program on the device. but it doesn't work, "c:\>adbdevices" lists
> no device attached, though i have tried to change the
> "android_usb.inf" in order to install the usb driver from SDK.
> i added some entries as follows:
> under
> [Google.NTx86]
>
> ; HTC DREAM
> ...
>
> ; SAMSUNGGALAXY
> %USB\VID_04E8&PID_6640.
> DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640
> %USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640&MI_01
> %USB\VID_04E8&PID_6640.DeviceDescRelease%=androidusb.Dev, USB
> \VID_04E8&PID_6640
>
> and [Strings]:
>
> USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXY"
> USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease="SAMSUNGGALAXY
> CompositeADBInterface"
> USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXYBootloader"
>
> i got only one VID and one PID through
> USBVIEW, though for HTC DREAM there are different PIDs used.
> Theadbinterface got installed, butadbjust didn't work.
>
> later i also tried to use the device under linux, set up the device as
> in Dev guide:
>
> If you're developing on Ubuntu Linux, you need to add a rules file:
>
>    1. Login as root and create this file: /etc/udev/rules.d/51-
> android.rules.
>
>       For Gusty/Hardy, edit the file to read:
>       SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
>
>       For Dapper, edit the file to read:
>       SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
>    2. Now execute:
>       chmod a+rx /etc/udev/rules.d/51-android.rules
>
> "adbdevices" listed nothing as well. : (
>
> open a terminal on the device, with "ps", i guess theadbdaemon
> "adbd" is running.
> but theadbtool just doesn't work.
>
> Can someone help me?
>
> thanks da
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SurfaceViews handling, Thread, and general game design

2009-07-14 Thread Dianne Hackborn
I very strongly recommend that you don't use multiple surface views.  A
surface view is a very heavy-weight object, and intended for the primary
area of the window -- for example, the video part of a video player, the
playfield of a game, etc.  It is basically an overlay, and actually its own
separate full window that is simply being Z-ordered with your main window to
make it look like they are related.

I don't know what your "complicated" animation sequence is, but just having
some animation is not enough reason to use a surface view.  Worst case, you
can just create an off-screen bitmap that you draw the animation in and
update the screen by drawing that bitmap to the screen with the normal
invalidate() mechanism.  If you need the performance of a surface view, then
you should design your game so that your entire playfield is on surface
view, and you take care of drawing each of your boxes inside of that and
manage them however you want (not as their own views).

On Tue, Jul 14, 2009 at 4:27 AM, ayanir  wrote:

>
> Hello,
>
> I'm a new Android developer.
> I would like to make a simple game using the SurfaceView (Canvas
> drawing).
>
> the game has a a custom Object name Box. Box can draw itself and need
> to get an event when it is clicked. when it does, there is an
> animation sequence coming out of the box like a "jumping clown".
> I have several Boxes on the screen when each of them can be activated.
> Several Boxes animation can also be presented simultaneously.
>
> Here it gets tricky:
> Since I have a "complicated" animation sequence, each Box extends
> SurfaceView.
> The problem is I haven't figured it out how can I handle several
> SurfaceView's drawing using only one Thread (in order to present an
> animation I need to use one) and also how can I get the onClick/
> onThouch event from my Activity to each of my Boxes.
>
> The LunarLanding example in the SDK uses only one Thread but also uses
> only one SurfaceView which manage the animation of the game components
> (there are no several game components SurfaceViews). Also, there is no
> need to get onTouch event, so this example doesn't match to my case.
>
> I have several questions about what is the right approach do code
> this:
> 1. Should I use Box extends SurfaceView?
> 2. Can SurfaceView gets user events like onTouch/onClick?
> 3. Is there a way to add to the "main" SurfaceView another SurfaceView
> (Box)?
> 4. If none of the above questions is positive, should I use one
> SurfaceView (and one Thread) and try to map the other Boxes on the
> screen for user event handling. I mean Box only paints itself but the
> user event is being handled by me (not by the OS).
> 5. Should each Box (SurfaceView) should handle it's own Thread in case
> of animation (it is not good design but it is also an option)?
> 6. do you have any other proposal?
>
> I know that these are a lot of questions but I'll appreciate if you
> can answer some of them.
>
> Thanks in advance,
> ayanir
>
>
>
> >
>


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

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

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



[android-developers] Re: Unable to write text file to sdcard on physical G1 device

2009-07-14 Thread doubleminus

Isn't that what the first lines of code do?

File file1 = new File(Environment.getExternalStorageDirectory(),
file_name);

On Jul 13, 3:02 pm, Streets Of Boston  wrote:
> Simple. :-)
> The error says that the file does not exist... that means you should
> create it.
> Use File#createNewFile().
>
> On Jul 13, 5:53 pm, doubleminus  wrote:
>
>
>
> > Romain is?  I don't understand. Is there something I should be doing
> > to avoid filenotfound exception?
>
> > On Jul 13, 12:40 am, 郑伟  wrote:
>
> > > You are right...
>
> > > > Date: Sun, 12 Jul 2009 21:29:28 -0700
> > > > Subject: [android-developers] Re: Unable to write text file to sdcard 
> > > > on  physical G1 device
> > > > From: romain...@google.com
> > > > To: android-developers@googlegroups.com
>
> > > > Hi,
>
> > > > Instead of:
>
> > > > > FileOutputStream file_out = openFileOutput
> > > > > (file_name,MODE_WORLD_READABLE);
>
> > > > Just use:
>
> > > > FileOutputStream file_out = new FileOutputStream(file_name);
>
> > > > This should work.
>
> > > > On Sun, Jul 12, 2009 at 8:10 PM, doubleminus 
> > > > wrote:
>
> > > > > I need to write a fairly simple .csv file to the device's sdcard (so
> > > > > it can then be emailed via Intent). The below code does not write the
> > > > > file.
>
> > > > > File file1 = new File(Environment.getExternalStorageDirectory(),
> > > > > file_name);
> > > > > FileOutputStream file_out = openFileOutput
> > > > > (file_name,MODE_WORLD_READABLE);
> > > > > BufferedOutputStream buf = new BufferedOutputStream(file_out);
> > > > > OutputStreamWriter out_stream = new OutputStreamWriter(buf);
>
> > > > >  // write fields in first row of spreadsheet then a new line
> > > > >  for (int i = 0; i < FIELDS.length; i++)
> > > > >  {
> > > > > if (i != FIELDS.length - 1)
> > > > >out_stream.write(FIELDS[i] + ",");
> > > > > else
> > > > >out_stream.write(FIELDS[i]);
> > > > >  }
>
> > > > >  out_stream.write("\n");
>
> > > > > // more code here
>
> > > > > I flush and close out_stream. I can even seem to be able to read from
> > > > > the file on the device (printing above output, using fileinputstream,
> > > > > to an edittext.
>
> > > > > How can I get to this file on the sdcard?
>
> > > > > Thanks!
>
> > > > > double
>
> > > > --
> > > > Romain Guy
> > > > Android framework engineer
> > > > romain...@android.com
>
> > > > Note: please don't send private questions to me, as I don't have time
> > > > to provide private support.  All such questions should be posted on
> > > > public forums, where I and others can see and answer them
>
> > > _
> > > MSN 表情魔法书,改变你的对话时代!http://im.live.cn/emoticons/-Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HTC Magic

2009-07-14 Thread A R

Hi,
 I was facing the same problem. I am not an expert but what all I can
gather from various posts it seems our SPL cannot be rooted.

 Please see http://forum.xda-developers.com/showthread.php?t=529019


Haykuro quote : "T-Mobile myTouch : 1.33.0006 and 1.33.0010 is the
dreaded "perfected" SPL".
This means that it's currently not possible to run "fastboot boot
image" on these SPL's, so don't try to flash them.


Although later in one of the posts someone posted that he was able to
root Malaysian 1.33.0010, not sure how.

On Jul 12, 7:59 pm, Nima  wrote:
> Please help to unlock the device.
>
> On Jul 12, 5:46 am, Mike Wolfson  wrote:
>
> > You will need to root your device, before you can flash a new ROM.
>
> > So, yes, it appears your device is locked.
>
> > On Jul 11, 1:58 am, Nima  wrote:
>
> > > Hi,
>
> > > I have followed the instructions in  
> > > link:http://android-dls.com/wiki/index.php?title=Magic_Rooting
>
> > > but the following error is reported
>
> > > fastboot boot recovery-RAv1.0H.img
> > > downloading 'boot.img'... FAILED (remote: not allow)
>
> > > Whether any locking is there in the device
> > > Please advice
>
> > > Thanks&Regards
>
> > >  fastboot boot recovery-RAv1.0H.img
> > > < waiting for device >
> > > downloading 'boot.img'... FAILED (remote: not allow)
>
> > > On Jul 11, 7:48 am, Nima  wrote:
>
> > > > Hi,
>
> > > > Thanks a lot for your quick response.
> > > > We are not able to see the option 
> > > > "settings->applications->development->"USB Debugging" in device
>
> > > > Please advice.
>
> > > > Thanks & Regards,
>
> > > > On Jul 10, 10:33 pm, "Yusuf T. Mobile" 
> > > > wrote:
>
> > > > > As a T-Mobile employee, I discourage you in the strongest possible
> > > > > terms from rooting yourMagicand upgrading it to 1.5 at the same time
> > > > > using this 
> > > > > link:http://android-dls.com/wiki/index.php?title=Magic_Rooting
>
> > > > > Yusuf Saib
> > > > > Android
> > > > > ·T· · ·Mobile· stick together
> > > > > The views, opinions and statements in this email are those of the
> > > > > author solely in their individual capacity, and do not necessarily
> > > > > represent those of T-Mobile USA, Inc.
>
> > > > > On Jul 10, 8:22 am, Nima  wrote:
>
> > > > > > hi,
>
> > > > > > We have bought newHTCMagicwith the following specifications:
>
> > > > > > 1.Firmware version- 1.5
> > > > > > 2.Baseband Version - 62.52s.20.18U_3.22.20.17
> > > > > > 3.Kernel Version- 2.6.27-cb85e129htc-ker...@and18-2 #3
> > > > > > 4.Build number-2.16.720.2 146733 CL#38755 release-keys
>
> > > > > > Can any one please tell us  whether we can flash Android1.5 image
> > > > > > under the following 
> > > > > > linkhttp://www.htc.com/www/support/android/adp.html
>
> > > > > > Where we can get factory image forHTCMagic?
>
> > > > > > Thanks&Regards,- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Dianne Hackborn
Fwiw, you don't need that permission to get the battery state.  Other than
that, I can't really help you.  If the status bar battery indicator is
changing, then the broadcast is indeed being sent, because it is driven off
of that.

On Tue, Jul 14, 2009 at 1:56 AM, Richard Schilling <
richard.rootwirel...@gmail.com> wrote:

>
> Oh, and I do have permission "android.permission.BATTERY_STATS"
> included in the manifest as well.
>
> So. what's wrong?
>
> Any ideas?
>
> Thanks in advance,
>
> Richard Schilling
> Root Wireless
>
>
> On Jul 14, 1:54 am, Richard Schilling 
> wrote:
> > For some reason, the BATTERY_CHANGED event has stopped being broadcast
> > by the phone.
> >
> > I have my application setup properly:
> >
> > 1. I have a broadcast receiver setup with the filter of
> > "android.intent.action.BATTERY_CHANGED" in the manifest.
> > 2. I have permission of "android.permission.DEVICE_POWER" also defined
> > in the manifest.
> >
> > When the application first starts up, I get one BATTERY_CHANGED intent
> > that the phone gives me.  And, then after that, the phone doesn't
> > broadcast any more BATTERY_CHANGED intents as the phone is plugged in
> > and unplugged.
> >
> > This is really weird.
> >
> > Richard Schilling
> > Root Wireless
> >
>


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

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

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



[android-developers] Re: how to use adb tool on SAMSUNG GALAXY?

2009-07-14 Thread David Turner
You need a different version of ADB to access this phone at the moment.
A future release of the SDK will provide an ADB binary that should be able
to do that, but this is not available yet as far as I know.

You're quite on the bleeding edge, aren't you ;-)

On Tue, Jul 14, 2009 at 6:05 PM, legerb  wrote:

>
> Hey,
> I just got this device too. Trying to figure out how to debug on
> device too.
> According this
> http://groups.google.com/group/android-beginners/browse_thread/thread/167b279683bddc8a
> Samsung have their own adb.
> Please update the thread if you've got any progress :)
>
> thanks ahead!
>
> On Jul 11, 10:54 pm, da yang  wrote:
> > Hi
> > i got this new mobilephone this week in Germany, wanted to debug my
> > program on the device. but it doesn't work, "c:\>adbdevices" lists
> > no device attached, though i have tried to change the
> > "android_usb.inf" in order to install the usb driver from SDK.
> > i added some entries as follows:
> > under
> > [Google.NTx86]
> >
> > ; HTC DREAM
> > ...
> >
> > ; SAMSUNGGALAXY
> > %USB\VID_04E8&PID_6640.
> > DeviceDescRelease%=androidusb.Dev, USB
> > \VID_04E8&PID_6640
> > %USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease%=androidusb.Dev, USB
> > \VID_04E8&PID_6640&MI_01
> > %USB\VID_04E8&PID_6640.DeviceDescRelease%=androidusb.Dev, USB
> > \VID_04E8&PID_6640
> >
> > and [Strings]:
> >
> > USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXY"
> > USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease="SAMSUNGGALAXY
> > CompositeADBInterface"
> > USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXYBootloader"
> >
> > i got only one VID and one PID through
> > USBVIEW, though for HTC DREAM there are different PIDs used.
> > Theadbinterface got installed, butadbjust didn't work.
> >
> > later i also tried to use the device under linux, set up the device as
> > in Dev guide:
> >
> > If you're developing on Ubuntu Linux, you need to add a rules file:
> >
> >1. Login as root and create this file: /etc/udev/rules.d/51-
> > android.rules.
> >
> >   For Gusty/Hardy, edit the file to read:
> >   SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
> >
> >   For Dapper, edit the file to read:
> >   SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
> >2. Now execute:
> >   chmod a+rx /etc/udev/rules.d/51-android.rules
> >
> > "adbdevices" listed nothing as well. : (
> >
> > open a terminal on the device, with "ps", i guess theadbdaemon
> > "adbd" is running.
> > but theadbtool just doesn't work.
> >
> > Can someone help me?
> >
> > thanks da
> >
>

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



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Richard Schilling

That's a good point.  I will try registering the broadcast receiver
programmatically as well to see if there's a difference in behavior.

Richard Schilling
Root Wireless


On Jul 14, 9:08 am, Dianne Hackborn  wrote:
> Fwiw, you don't need that permission to get the battery state.  Other than
> that, I can't really help you.  If the status bar battery indicator is
> changing, then the broadcast is indeed being sent, because it is driven off
> of that.
>
> On Tue, Jul 14, 2009 at 1:56 AM, Richard Schilling <
>
>
>
> richard.rootwirel...@gmail.com> wrote:
>
> > Oh, and I do have permission "android.permission.BATTERY_STATS"
> > included in the manifest as well.
>
> > So. what's wrong?
>
> > Any ideas?
>
> > Thanks in advance,
>
> > Richard Schilling
> > Root Wireless
>
> > On Jul 14, 1:54 am, Richard Schilling 
> > wrote:
> > > For some reason, the BATTERY_CHANGED event has stopped being broadcast
> > > by the phone.
>
> > > I have my application setup properly:
>
> > > 1. I have a broadcast receiver setup with the filter of
> > > "android.intent.action.BATTERY_CHANGED" in the manifest.
> > > 2. I have permission of "android.permission.DEVICE_POWER" also defined
> > > in the manifest.
>
> > > When the application first starts up, I get one BATTERY_CHANGED intent
> > > that the phone gives me.  And, then after that, the phone doesn't
> > > broadcast any more BATTERY_CHANGED intents as the phone is plugged in
> > > and unplugged.
>
> > > This is really weird.
>
> > > Richard Schilling
> > > Root Wireless
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how can the contact be writen to SIM card?

2009-07-14 Thread Water E
--values.put( "name", "" );

replace as :

--values.put( "tag", "" );
Good Luck!

2009/5/14 蓝思中 

>
> Hi guys, I am trying to store a contact in the SIM card, but I found
> nothing for it in the G1 phone. Then, I assumed that it may be because G1's
> application doesn't use the API for that storage, so I tried the following
> code,
>
>ContentValues values = new ContentValues();
>>
> values.put( "name", "" );
>>
> values.put( "number", "10086" );
>>
> getContentResolver().insert( Uri.parse("content://sim/adn"), values
>> );
>>
>
> it just failed, doing nothing. What is wrong? how can I make it to SIM
> card?
> Thank you.
>
> >
>

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



[android-developers] Configuring APN's PAP authenticat ion / Habilitando la autenticación PAP para mi APN

2009-07-14 Thread Fran Sánchez

Buenos días.

Tengo la HTC Magic (con Android 1.5).
Para mi trabajo necesito configurar una APN que tenga autenticación
PAP, además necesito configurar mi propia IP y DNS.
Veo que es imposible hacerlo con mi versión actual. Mi pregunta es:
¿cambiará esto en próximas versiones? ¿Hay alguna aplicación de
terceros que lo haga?

Muchas gracias.

-

Good morning.

I'm not able to configure my HTC Magic (with Android 1.5) to make PAP
authentication (in APN settings).
In order to use my work's provider I would also need to configure my
IP and DNS (which are provided to me).

My question is: will it change in future versions? Is there any third
party app to make it?

Thank you very much.

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



[android-developers] Notepad tutorial improvements

2009-07-14 Thread Macarse

Hi,
I've been doing the notepad tutorial @
http://developer.android.com/guide/tutorials/notepad/index.html

1)
I've added a char counter on top of the body doing this:
note_edit.xml => http://pastebin.com/f5fda29fe
NoteEdit.java => http://pastebin.com/f4495e573

Questions with this:
- Are there any adapters like swing in android. I just use one method
from TextWatcher and need to override all of them.
- When testing my code mChars.setTextColor(Color.WHITE) on line 92
turns my text bold. Other colors don't do this. Bug?

2)
If I add notes without title, then I can't select them from the list
to delete them.
Which would be the best way to fix this?

Thanks for reading!

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



[android-developers] MapActivity not showing more than 1 GeoPoint

2009-07-14 Thread Bryant

Hi there,

I've been playing around with the MapActivity all day and haven't
figured out how to add more than 1 OverlayItem to the map overlays.

>From following the 
>http://developer.android.com/guide/tutorials/views/hello-mapview.html
tutorial, it says that another overlayitem can be added by writing the
following lines before the addOverlay method is called:
***
because we created our ItemizedOverlay class with an ArrayList, we can
continue adding new OverlayItems. Try adding another one. Before the
addOverlay() method is called, add these lines:

GeoPoint point2 = new GeoPoint(3541, 13946);
OverlayItem overlayitem2 = new OverlayItem(point2, "", "");
***

However, I can't get the second GeoPoint to show up on the Map in the
emulator at all. I then tried instantiating another ItemizedOverlay
and adding the second overlayItem to it, and then adding the second
overlay to the mapOverlays list and that did not work either.

Has anyone gotten this tutorial to show Tokyo successfully?

Thanks!

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



[android-developers] JNI_OnLoad (). Is it mandatory?

2009-07-14 Thread krr_android

Hi,

Is it mandatory to provide this method inisde any .so library?

JNIEXPORT jint JNICALL
JNI_OnLoad (JavaVM * vm, void * reserved)
{
return JNI_VERSION_1_6;
}

Because, I dont see this inside any of the source files of the natice
samples provided in the NDK. Then, how does it work there?

Pls clarify the necessity of this function. Thanks in advance.

Regards,

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



[android-developers] Mipmap Generation

2009-07-14 Thread Mike

I've created a simple heightmap renderer for Android, and am at the
point where I'd like to apply textures to the terrain. I've had
success with applying a simple texture but there is an unbearable
amount of texture aliasing visible, I guess because there are no
mipmaps for the texture. I could not find any way of automatically
generating mipmaps as all the usual OpenGL methods seem to be
unsupported.

Have any of you figured out how to generate mipmaps on Android? Do we
need to write our own implementation to to it?

Thanks,
Mike

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



[android-developers] Re: Camera in portrait mode

2009-07-14 Thread m

Hi Indra,

Can you give a code snippet on how you did it?
Especially the rotation of the view. I have a surfaceView that I need
to rotate.

Thanks in advance.

Best regards,
 Mikkel

On 3 Jul., 16:01, indra  wrote:
> Hi,
>
> There is no way of getting the camera preview in portrait mode ( as
> you probably already know) and its very ( very) slow to rotate the
> preview image. The only option is to run the app in landscape mode and
> rotate the view that you want to overlay onto the preview by 90
> degrees. To do this override the onDraw() method of the parent view
> (preferably a linearlayout) and rotate the canvas before calling
> super.onDraw(). Its going to take a bit of hacking.. Good luck!
>
> On Jul 2, 7:35 pm, lufo  wrote:
>
> > Hi guys, I'm facing the same problem like indra.
>
> > I need to overlay some text on the camera and I tried to rotate the
> > canvas on which the text is drawn but no result.
>
> > Can someone (indra?) tell me how/what to rotate to bypass the 
> > Cameraportraitbug ?
>
> > Thanx a lot!
>
> > On Jun 30, 7:22 pm, SebX  wrote:
>
> > > It works only if I put this:
> > >     this.setRequestedOrientation
> > > (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
> > > It's a compromise even if locking the view in landscape mode is not
> > > the first choice...
>
> > > On 29 juin, 01:34, SebX  wrote:
>
> > > > Hi,
>
> > > > First at all congratulation for Layar, it seems very impressive and I
> > > > look forward to test the application (I did not see it on the
> > > > appstore)
>
> > > > I have the same problem with my application when I'm inportraitmode
> > > > and that's very frustrating. I think we have to use the landscape mode
> > > > only because even if the bug is fixed, there will always be a problem
> > > > with the old SDK
>
> > > > Could someone post here if he find the solution, please...
>
> > > > Thanks
>
> > > > On 28 juin, 00:02, indra  wrote:
>
> > > > > Hi guys at android,
>
> > > > > Can you plase 
> > > > > fixhttp://code.google.com/p/android/issues/detail?id=1193
> > > > > When do you expect it to get fixed? I am a developer working 
> > > > > onhttp://layar.euandIhadtogo through lot of trouble to get the app
> > > > > working inportraitmode with camera preview, using a LOT of
> > > > > rotations. I have managed to get everything rotated toportraitexcept
> > > > > for the on screen inputmethod which still shows up in landscape. Do
> > > > > you have any suggestions for rotating that?
>
> > > > > Thanks,
> > > > > Indraneel

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



[android-developers] Soft keyboard Layout

2009-07-14 Thread I_Shove

Hello

Is it possible to change the layout of the softkeyboard ?

Regards

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



[android-developers] Re: How to connect to internet from android emulator browser .

2009-07-14 Thread siva c
When you dev machine is connected to internet the emulator browser should be
able access the internet...

Check the below thread for detail

http://groups.google.com/group/android-beginners/browse_thread/thread/0ababd5e40398e49/fbdd321643bf48e1

On Mon, Jul 13, 2009 at 7:43 AM, renjith mp  wrote:

>
> Hi All,
>
> Please let me know how I can connect to internet from android emulator
> browser.
> From the discussion I found that I need to do some proxy settings for
> this . What are those settings ?
> Here the details of my development environment.
>
> Eclipse. eclipse-SDK-3.4.2-win32
> Android:android-sdk-windows-1.1_r1
> OS:Windows vista 32 bit
> Internet connection: Broadband connection from some ISP
>
> >
>

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



[android-developers] Not responding

2009-07-14 Thread Siva

Hi
I am new  to android , i try to run one application i getting
error application is not responding .
   what is the problem ? I am not getting any error at the application
before running in eclipse .
   pls any one help me.

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



[android-developers] How to detect Application Inactivity ?

2009-07-14 Thread elpix1

Hi all,

My application has several Activities which the user can interact with
and open Dialog Boxes from them.
I need a way to detect when there is no user interaction with any of
the Activities and Dialog Boxes
after a certain amount of time (configurable by the user) and force a
logout of the application.
When this happens, the user will be shown a Login screen and needs to
supply a password.
This login Activity is the only one which the user can stay as long as
he wishes.

I installed an Idle Handler in the application Message Queue using
MessageQueue.addIdleHandler()
but the handler is called periodically even when no interaction
occurs.

I think I need to intercept all the system events for touch, keys and
trackball sent to any of my
Activities and Dialog Boxes to restart my inactivity timer but I
didn't find any way to do this.

Any ideas or hints on how to implement this ?
Thanks.




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



[android-developers] Content Provider Permission

2009-07-14 Thread Isis

Hi All,
 I want to delete Downloads provider data. And I have added
permission in AndroidManifest.xml,  But it doesn't work, the log gave
me a pid and an uid, I guess the problem is caused by these two ids.If
it's true, what can I do  to solve this problem.

AndroidManifest.xml as follows:
...


...

Java code as follows:
...
ContentResolver resolver = context.getContentResolver();
resolver.delete(DownLoads.URI, null, null);
...

Log as follows:
...
07-07 13:59:10.038: ERROR/ContentProvider(726):
java.lang.SecurityException: Permission Denial: writing
com.android.providers.downloads.DownloadProvider uri 
content://downloads/download
from pid=1714, uid=10085 requires
android.permission.ACCESS_DOWNLOAD_MANAGER
...


Any suggestion or best an example is 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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android GUI testing

2009-07-14 Thread AndroidAutoTest

I am investigating to improve test engine for automating android
platform.
The test engine I developed controls UI component by the absolute
coordinate of the screen, not by its control ID.
For example, if I want to click a button "A", I can send a command to
click the button by tapping the screen by the specified coordinate.

However, if the location of the button is changed due to UI change, I
have to change my script accordingly so that it taps on the right
coordinate to press the button.

Is there any other method to control the UI component by its ID or
name, not by tapping the absolute coordinate?

For example, if I can send a command to press a button "A" by its
name, the script would press the button successfully no matter where
the button is located.


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



[android-developers] EditText cursor position in pixels/dip

2009-07-14 Thread sr


I'd like to position a widget at the cursor position of an EditText
widget.
This will be a widget on top of the cursor - to move as text is
entered into the EditText widget.

Currently, I'd using a TextChangedListener and rendering the text
locally to figure the pixel position.
Painting the text just to figure the pixel width seems wasteful.
Wondering if there is a better way to do this?

The code segment of interest -

EditText entry;
entry.addTextChangedListener(new TextWatcher() {

public void afterTextChanged(Editable s) {
String s = entry.getText().toString();
TextPaint p = new TextPaint();
p.setTextSize(entry.getTextSize());
Rect r = new Rect();
p.getTextBounds(s, 0, s.length(), r);
// using r.width() to get the position of interest.
   }
}

thanks,
-sr

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



[android-developers] Re: Problems in using android to developing facebook applications .

2009-07-14 Thread Vijay

Did anyone find a solution for this problem?

Thanks.

On Jul 10, 3:19 am, Josh  wrote:
> I'm having this same problem with jaxb.  Anyone out there have any
> idea why this happens?
>
> On May 13, 3:04 am, daen  wrote:
>
>
>
> > I have no idea yet.
> > now I'm using CS to develop my android-facebook application.
> > the PC working as a server,and android phone working as client.
> > may be it will help you.
> > best
> > Daen
>
> > On May 6, 3:25 am, Mad Donde  wrote:
>
> > > I'm having the same problem here. Looks like it happens when you try
> > > to add jaxb-api-2.1.jar and stax-api-1.0-2.jar to the classpath.
> > > I found on the internet this 
> > > link,http://code.google.com/p/android/issues/detail?id=314
> > > where they fixed the error Conversion to Dalvik format failed with
> > > error 2
> > > Well, I tried anyway... Don't know if I did all right, but the problem
> > > persists.
>
> > > Any ideas?
>
> > > On Apr 20, 7:41 am, daen  wrote:
>
> > > > hi developers:
> > > > I try to use facebook-java-api to wrote my android application .
> > > > but I got some problems .
> > > > when i import all the libs in facebook-java-api,My eclipse Could not
> > > > find my apk.
>
> > > > [2009-04-20 18:24:59 - android_test_facebook]
> > > > --
> > > > [2009-04-20 18:24:59 - android_test_facebook] Android Launch!
> > > > [2009-04-20 18:24:59 - android_test_facebook] adb is running normally.
> > > > [2009-04-20 18:24:59 - android_test_facebook] Could not find
> > > > android_test_facebook.apk!
>
> > > > ---
> > > >  ---
> > > > [2009-04-20 18:24:38 - android_test_facebook] warning: Ignoring
> > > > InnerClasses attribute for an anonymous inner class that doesn't come
> > > > with an associated EnclosingMethod attribute. (This class was probably
> > > > produced by a broken compiler.)
> > > > [2009-04-20 18:24:38 - android_test_facebook]
> > > > trouble processing "javax/xml/bind/Binder.class":
> > > > [2009-04-20 18:24:38 - android_test_facebook]
> > > > Attempt to include a core VM class in something other than a core
> > > > library.
> > > > It is likely that you have attempted to include the core library from
> > > > a desktop
> > > > virtual machine into an application, which will most assuredly not
> > > > work. If
> > > > you really intend to build a core library -- which is only appropriate
> > > > as
> > > > part of creating a full virtual machine binary, as opposed to
> > > > compiling an
> > > > application -- then use the "--core-library" option to suppress this
> > > > error
> > > > message. If you go ahead and use "--core-library" but are in fact
> > > > building
> > > > an application, then please be aware that your build will still fail
> > > > at some
> > > > point; you will simply be denied the pleasure of reading this helpful
> > > > error
> > > > message.
> > > > [2009-04-20 18:24:38 - android_test_facebook] 1 error; aborting
> > > > [2009-04-20 18:24:38 - android_test_facebook] Conversion to Dalvik
> > > > format failed with error 1
>
> > > > ---
> > > >  ---
> > > > all the jars in facebook-java-api is:
> > > > -
> > > > activation-1.1.jar
> > > > commons-lang-2.2.jar
> > > > commons-logging-1.1.1.jar
> > > > facebook-java-api-2.1.0.jar
> > > > facebook-java-api-schema-2.1.0.jar
> > > > json-20070829.jar
> > > > runtime-0.4.1.3.jar
> > > > commons-codec.jar
> > > > jaxb-api-2.1.jar
> > > > jaxb-impl-2.1.9.jar
> > > > stax-api-1.0-2.jar
> > > > -
>
> > > > bset,
> > > > -daen- Hide quoted text -
>
> > > - Show quoted text -

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



[android-developers] what is android.process.acore used for?

2009-07-14 Thread Nick Hsiao

some package whether in apps or provider directory adds it self into
android.process.acore by adding
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to get and edit button in an AlertDialog

2009-07-14 Thread Chris

I had the same problem of getButton() returning null. Just reorder the
calls so that you show() the dialog before trying to access its
buttons:

AlertDialog alertDialog = builder.create();
alertDialog.show();
Button button = (Button) alertDialog.getButton(BUTTON_POSITIVE);

// edit the button size

I'm not sure if you can then edit the button size after getting a
reference to it, but this might be useful in the future.

Cheers



On Jun 8, 8:07 am, Thomas  wrote:
> Anyone can help me?
>
> Thanks
>
> Thomas
>
> On 6/4/09, Thomas  wrote:
>
> > Hi All,
>
> > I need to build a AlertDialog with a short text ("A") and an OK
> > Button. But if I use AlertDialog.Builder, the "ok" text button is not
> > shown with a short text message. I tried to recover the Button object
> > and set the layout to wrap_content. But when I try to use getButton
> > function, it returns me null.
>
> > What Do I need to recover the button correctly and set the width as
> > wrap_content?
>
> > Thanks all.
>
> > The code :
>
> > AlertDialog.Builder builder = new AlertDialog.Builder(this)
> >                                             .setPositiveButton("OK",
> > mOKListener)
> >                                             .setMessage("A")
> >                                             .setCancelable(false);
>
> > AlertDialog alertDialog = builder.create();
> > Button button = (Button) alertDialog.getButton(BUTTON_POSITIVE);
>
> > // edit the button size
>
> > alertDialog.show();
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Lock screen feature does not work

2009-07-14 Thread Jerry Wang

Hi there,

I have ever saw the similar discussion in this group, but nobody
answer. And I am very confusing about this feature. Because most of
developers do not seem to meet this problem.

The problem is when I press ENDCALL button, it does not going into
Screen Lock view. And I have download the source code of "cupcake" &
"android-1.5" & "android-1.5r2" & "android-sdk-1.5_r1" version from
Android's GitWeb. The feature of lock screen does not work on the
emulator. But it works on the offical SDK version. I don't know what
is happened.

Please give me a help!! Thanks a lot.

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



[android-developers] HttpsURLConnection getResponseMessage throws IOException, despite server response

2009-07-14 Thread Stephen Abrams

Hello,

I now have a solution to my problem, as I only needed to authenticate
via HTTPS, encrypting username and password, get the session cookie,
and use this cookie for future HTTP communication.  However, I would
like to understand why there was an IOException generated from a
getResponseMessage(), even though the response from the server was:

Received authentication challenge is null

Even though this would output to the log, the exception would be
thrown:
java.io.IOException: Received authentication challenge is null

If I remove that line, the cookies are pulled from the header with no
problem, and there is no exception.


public void onClick(View v) {
// Perform action on click
try {

URL url = new URL("https://www.mysite.com/session.xml";);

HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setDoOutput(true);
  conn.setDoInput(true);

  conn.setRequestMethod("POST");

  /* used this to force verification (from example
http://25digital.blogspot.com/2008/02/account-authentication-api-y-android.html).
This is a security problem, as host is no longer validated, though
encryption remains between server and client
   *
   * needed because of Android bug
http://groups.google.com/group/android-developers/browse_thread/thread/cd8d3ba7652fd99b
   *
   */
  conn.setHostnameVerifier(new HostnameVerifier(){
public boolean verify (String hostname, SSLSession session) {
return true;
}
});

OutputStreamWriter outputStreamWriter = new OutputStreamWriter
(conn.getOutputStream());
outputStreamWriter.write("email=" + URLEncoder.encode("userName"));
outputStreamWriter.write("&");
outputStreamWriter.write("password=" + URLEncoder.encode
("userPassword"));
outputStreamWriter.flush();
outputStreamWriter.close();

// THIS FAILS
Log.i("login", "Response message: " + conn.getResponseMessage());

String[] cookies = conn.getHeaderField("set-cookie").split(";");


} catch (Exception e) {
Log.e("login", e.getMessage());
}
}

Thank you,
Steve

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



[android-developers] File.isFile() and File.isDirectory() both return false

2009-07-14 Thread Anirudh


Hi,

I have a function to list the contents of a directory. For the
contents of the directory "/System", both isDirectoy and isFile
functions return a false value. How is this possible? Please clarify.

The code snippet for reference:

   1. public void populateContents(String dir) {
   2. Log.v(TAG, "in populateContents, dir: " + dir);
   3. File file = new File(dir);
   4. if (file.isDirectory()) {
   5. try {
   6. Log.v(TAG, "in populateContents, mCurDir: "
   7. + mCurDir.getCanonicalPath());
   8. } catch (IOException e) {
   9. // TODO Auto-generated catch block
  10. e.printStackTrace();
  11. }
  12. String[] fileList = file.list();
  13. for (int ix = 0; ix < fileList.length; ix++) {
  14. Log.v(TAG, "in populateContents, fileList[" + ix
+ "]: "
  15. + fileList[ix]);
  16. File nFile = new File(fileList[ix]);
  17. String str = "";
  18. if (nFile.isDirectory()) {
  19. Log.v(TAG, "in populateContents, fileList["
+ ix + "]: "
  20. + fileList[ix] + " is a
directory");
  21. str = "[D->]";
  22. String[] insideDir = nFile.list();
  23. if (insideDir.length > 0) {
  24. Log.v(TAG, "in populateContents, fileList
[" + ix
  25. + "]: " + fileList[ix] + " is a
directory"
  26. + " and is non-empty");
  27. str = "[D->(...)]";
  28. }
  29. } else if (nFile.isFile()) {
  30. Log.v(TAG, "in populateContents, fileList["
+ ix + "]: "
  31. + fileList[ix] + " is a file");
  32. } else {
  33. Log.v(TAG, "in populateContents, fileList["
+ ix + "]: "
  34. + fileList[ix]
  35. + " is neither a file nor a
directory");
  36. }
  37. }
  38. }
  39. }

I am getting logs in logcat like this:
V/->->FEX ( 350): in populateContents, fileList[0]: bin
V/->->FEX ( 350): in populateContents, fileList[0]: bin is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[1]: build.prop
V/->->FEX ( 350): in populateContents, fileList[1]: build.prop is
neither a file nor a directory
V/->->FEX ( 350): in populateContents, fileList[2]: etc
V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
and is non-empty
V/->->FEX ( 350): in populateContents, fileList[3]: app
V/->->FEX ( 350): in populateContents, fileList[3]: app is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[4]: usr
V/->->FEX ( 350): in populateContents, fileList[4]: usr is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[5]: fonts
V/->->FEX ( 350): in populateContents, fileList[5]: fonts is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[6]: media
V/->->FEX ( 350): in populateContents, fileList[6]: media is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[7]: sounds
V/->->FEX ( 350): in populateContents, fileList[7]: sounds is neither
a file nor a directory
V/->->FEX ( 350): in populateContents, fileList[8]: lib
V/->->FEX ( 350): in populateContents, fileList[8]: lib is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[9]: xbin
V/->->FEX ( 350): in populateContents, fileList[9]: xbin is neither a
file nor a directory
V/->->FEX ( 350): in populateContents, fileList[10]: framework
V/->->FEX ( 350): in populateContents, fileList[10]: framework is
neither a file nor a directory
V/->->FEX ( 350): in populateContents, fileList[11]: lost+found
V/->->FEX ( 350): in populateContents, fileList[11]: lost+found is
neither a file nor a directory

Regards,
Anirudh

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



[android-developers] Re: Camera in portrait mode

2009-07-14 Thread m

Hi Indra,

Is it possible that you can share any code snippet on how you do the
rotation?

Especially how do you rotate the view? I have a surfaceView that needs
to get rotated and I have not found any ways of doing it.

Best regards,
 Mikkel

On Jul 3, 4:01 pm, indra  wrote:
> Hi,
>
> There is no way of getting the camera preview in portrait mode ( as
> you probably already know) and its very ( very) slow to rotate the
> preview image. The only option is to run the app in landscape mode and
> rotate the view that you want to overlay onto the preview by 90
> degrees. To do this override the onDraw() method of the parent view
> (preferably a linearlayout) and rotate the canvas before calling
> super.onDraw(). Its going to take a bit of hacking.. Good luck!
>
> On Jul 2, 7:35 pm, lufo  wrote:
>
>
>
> > Hi guys, I'm facing the same problem like indra.
>
> > I need to overlay some text on the camera and I tried to rotate the
> > canvas on which the text is drawn but no result.
>
> > Can someone (indra?) tell me how/what to rotate to bypass the 
> > Cameraportraitbug ?
>
> > Thanx a lot!
>
> > On Jun 30, 7:22 pm, SebX  wrote:
>
> > > It works only if I put this:
> > >     this.setRequestedOrientation
> > > (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
> > > It's a compromise even if locking the view in landscape mode is not
> > > the first choice...
>
> > > On 29 juin, 01:34, SebX  wrote:
>
> > > > Hi,
>
> > > > First at all congratulation for Layar, it seems very impressive and I
> > > > look forward to test the application (I did not see it on the
> > > > appstore)
>
> > > > I have the same problem with my application when I'm inportraitmode
> > > > and that's very frustrating. I think we have to use the landscape mode
> > > > only because even if the bug is fixed, there will always be a problem
> > > > with the old SDK
>
> > > > Could someone post here if he find the solution, please...
>
> > > > Thanks
>
> > > > On 28 juin, 00:02, indra  wrote:
>
> > > > > Hi guys at android,
>
> > > > > Can you plase 
> > > > > fixhttp://code.google.com/p/android/issues/detail?id=1193
> > > > > When do you expect it to get fixed? I am a developer working 
> > > > > onhttp://layar.euandIhadtogo through lot of trouble to get the app
> > > > > working inportraitmode with camera preview, using a LOT of
> > > > > rotations. I have managed to get everything rotated toportraitexcept
> > > > > for the on screen inputmethod which still shows up in landscape. Do
> > > > > you have any suggestions for rotating that?
>
> > > > > Thanks,
> > > > > Indraneel

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



[android-developers] Re: Service won't stop when exiting application

2009-07-14 Thread Lex

Ooops that was a typo when I posted the message. ccClient and
cocarClient are supposed to be the same object. But I was indeed
passing something else.

In

public void onStop() {
super.onStop();
stopService(new Intent(this, cocarClient.getClass()));
}

cocarClient.getClass returnes ComponentName I think. I changed this
to


public void onStop() {
super.onStop();
stopService(new Intent(this, ClientService.getClass
()));
}

and it works fine! Thanks for the hint, Dianne!

On Jul 13, 6:15 pm, Dianne Hackborn  wrote:
> Are you sure you are stopping the same service?  You are passing something
> different in for the Intent component.  I would suggest defining one static
> Intent for the service, that is use for both start and stop.
>
>
>
> On Mon, Jul 13, 2009 at 3:07 AM, Lex  wrote:
>
> > Hi everyone,
>
> > this message is in addition to the posts at
>
> >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > I have a service receiving and sending data to a server in separate
> > threads each. The service lifecycle methods look like this:
>
> >@Override
> >public void onCreate() {
> >super.onCreate();
> >receiver = new ReceiveThread(this);
> >myMapView.trafficMessages = new Vector();
>
> >}
>
> >@Override
> >public void onStart(Intent intent, int startId) {
> >super.onStart(intent, startId);
> >receiver.start();
> >}
>
> >@Override
> >public void onDestroy() {
> >super.onDestroy();
> >receiver.kill(); // sets a boolean in the while loop to
> > false so
> > that run() finishes
> >heartbeat.kill(); // thread sending periodic messages to the
> > server
> > to keep the connection alive
> >stopSelf();
>
> > The activity lifecycle methods look like this:
>
> > @Override
> >public void onCreate(Bundle savedInstanceState) {
> >super.onCreate(savedInstanceState);
> >TAG = getString(R.string.application_name);
> >setContentView(R.layout.main);
> >context = getApplicationContext();
>
> >initMap();
> >initLocationManager();
> >ccClient = startService(new Intent(this,
> > ClientService.class));
> >}
>
> >@Override
> >public void onPause() {
> >super.onPause();
> >locManager.removeUpdates(locListener);
> >}
>
> >@Override
> >public void onResume() {
> >super.onResume();
>
> >  locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
> > 0, locListener);
> >}
>
> >@Override
> >public void onStop() {
> >super.onStop();
> >stopService(new Intent(this, cocarClient.getClass()));
> >}
>
> > When I press the home button, the activity onStop() method is called
> > but stopService() does not call the service onDestroy() method so the
> > threads keep running in the background.
> > Why doesn't the service shut down? What is the difference between the
> > home and back button, what is activity-service lifecycle method call
> > stack in these cases?
>
> --
> Dianne Hackborn
> AnOodroid framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: File.isFile() and File.isDirectory() both return false

2009-07-14 Thread David Turner
Maybe because your application has no permission to access the corresponding
file/directory?

On Tue, Jul 14, 2009 at 12:06 PM, Anirudh  wrote:

>
>
> Hi,
>
> I have a function to list the contents of a directory. For the
> contents of the directory "/System", both isDirectoy and isFile
> functions return a false value. How is this possible? Please clarify.
>
> The code snippet for reference:
>
>   1. public void populateContents(String dir) {
>   2. Log.v(TAG, "in populateContents, dir: " + dir);
>   3. File file = new File(dir);
>   4. if (file.isDirectory()) {
>   5. try {
>   6. Log.v(TAG, "in populateContents, mCurDir: "
>   7. + mCurDir.getCanonicalPath());
>   8. } catch (IOException e) {
>   9. // TODO Auto-generated catch block
>  10. e.printStackTrace();
>  11. }
>  12. String[] fileList = file.list();
>  13. for (int ix = 0; ix < fileList.length; ix++) {
>  14. Log.v(TAG, "in populateContents, fileList[" + ix
> + "]: "
>  15. + fileList[ix]);
>  16. File nFile = new File(fileList[ix]);
>  17. String str = "";
>  18. if (nFile.isDirectory()) {
>  19. Log.v(TAG, "in populateContents, fileList["
> + ix + "]: "
>  20. + fileList[ix] + " is a
> directory");
>  21. str = "[D->]";
>  22. String[] insideDir = nFile.list();
>  23. if (insideDir.length > 0) {
>  24. Log.v(TAG, "in populateContents, fileList
> [" + ix
>  25. + "]: " + fileList[ix] + " is a
> directory"
>  26. + " and is non-empty");
>  27. str = "[D->(...)]";
>  28. }
>  29. } else if (nFile.isFile()) {
>  30. Log.v(TAG, "in populateContents, fileList["
> + ix + "]: "
>  31. + fileList[ix] + " is a file");
>  32. } else {
>  33. Log.v(TAG, "in populateContents, fileList["
> + ix + "]: "
>  34. + fileList[ix]
>  35. + " is neither a file nor a
> directory");
>  36. }
>  37. }
>  38. }
>  39. }
>
> I am getting logs in logcat like this:
> V/->->FEX ( 350): in populateContents, fileList[0]: bin
> V/->->FEX ( 350): in populateContents, fileList[0]: bin is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[1]: build.prop
> V/->->FEX ( 350): in populateContents, fileList[1]: build.prop is
> neither a file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[2]: etc
> V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
> V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
> and is non-empty
> V/->->FEX ( 350): in populateContents, fileList[3]: app
> V/->->FEX ( 350): in populateContents, fileList[3]: app is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[4]: usr
> V/->->FEX ( 350): in populateContents, fileList[4]: usr is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[5]: fonts
> V/->->FEX ( 350): in populateContents, fileList[5]: fonts is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[6]: media
> V/->->FEX ( 350): in populateContents, fileList[6]: media is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[7]: sounds
> V/->->FEX ( 350): in populateContents, fileList[7]: sounds is neither
> a file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[8]: lib
> V/->->FEX ( 350): in populateContents, fileList[8]: lib is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[9]: xbin
> V/->->FEX ( 350): in populateContents, fileList[9]: xbin is neither a
> file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[10]: framework
> V/->->FEX ( 350): in populateContents, fileList[10]: framework is
> neither a file nor a directory
> V/->->FEX ( 350): in populateContents, fileList[11]: lost+found
> V/->->FEX ( 350): in populateContents, fileList[11]: lost+found is
> neither a file nor a directory
>
> Regards,
> Anirudh
>
> >
>

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



[android-developers] Re: File.isFile() and File.isDirectory() both return false

2009-07-14 Thread Dianne Hackborn
Also there is no such directory "/System" (with a capital S), and it looks
like this code may be using raw leaf names as top-level names it tries to
find, which also wouldn't exit.  That is, there is no "bin" dir, but there
is a "/system/bin"

On Tue, Jul 14, 2009 at 9:44 AM, David Turner  wrote:

>
> Maybe because your application has no permission to access the
> corresponding file/directory?
>
>
> On Tue, Jul 14, 2009 at 12:06 PM, Anirudh  wrote:
>
>>
>>
>> Hi,
>>
>> I have a function to list the contents of a directory. For the
>> contents of the directory "/System", both isDirectoy and isFile
>> functions return a false value. How is this possible? Please clarify.
>>
>> The code snippet for reference:
>>
>>   1. public void populateContents(String dir) {
>>   2. Log.v(TAG, "in populateContents, dir: " + dir);
>>   3. File file = new File(dir);
>>   4. if (file.isDirectory()) {
>>   5. try {
>>   6. Log.v(TAG, "in populateContents, mCurDir: "
>>   7. + mCurDir.getCanonicalPath());
>>   8. } catch (IOException e) {
>>   9. // TODO Auto-generated catch block
>>  10. e.printStackTrace();
>>  11. }
>>  12. String[] fileList = file.list();
>>  13. for (int ix = 0; ix < fileList.length; ix++) {
>>  14. Log.v(TAG, "in populateContents, fileList[" + ix
>> + "]: "
>>  15. + fileList[ix]);
>>  16. File nFile = new File(fileList[ix]);
>>  17. String str = "";
>>  18. if (nFile.isDirectory()) {
>>  19. Log.v(TAG, "in populateContents, fileList["
>> + ix + "]: "
>>  20. + fileList[ix] + " is a
>> directory");
>>  21. str = "[D->]";
>>  22. String[] insideDir = nFile.list();
>>  23. if (insideDir.length > 0) {
>>  24. Log.v(TAG, "in populateContents, fileList
>> [" + ix
>>  25. + "]: " + fileList[ix] + " is a
>> directory"
>>  26. + " and is non-empty");
>>  27. str = "[D->(...)]";
>>  28. }
>>  29. } else if (nFile.isFile()) {
>>  30. Log.v(TAG, "in populateContents, fileList["
>> + ix + "]: "
>>  31. + fileList[ix] + " is a file");
>>  32. } else {
>>  33. Log.v(TAG, "in populateContents, fileList["
>> + ix + "]: "
>>  34. + fileList[ix]
>>  35. + " is neither a file nor a
>> directory");
>>  36. }
>>  37. }
>>  38. }
>>  39. }
>>
>> I am getting logs in logcat like this:
>> V/->->FEX ( 350): in populateContents, fileList[0]: bin
>> V/->->FEX ( 350): in populateContents, fileList[0]: bin is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[1]: build.prop
>> V/->->FEX ( 350): in populateContents, fileList[1]: build.prop is
>> neither a file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[2]: etc
>> V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
>> V/->->FEX ( 350): in populateContents, fileList[2]: etc is a directory
>> and is non-empty
>> V/->->FEX ( 350): in populateContents, fileList[3]: app
>> V/->->FEX ( 350): in populateContents, fileList[3]: app is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[4]: usr
>> V/->->FEX ( 350): in populateContents, fileList[4]: usr is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[5]: fonts
>> V/->->FEX ( 350): in populateContents, fileList[5]: fonts is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[6]: media
>> V/->->FEX ( 350): in populateContents, fileList[6]: media is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[7]: sounds
>> V/->->FEX ( 350): in populateContents, fileList[7]: sounds is neither
>> a file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[8]: lib
>> V/->->FEX ( 350): in populateContents, fileList[8]: lib is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[9]: xbin
>> V/->->FEX ( 350): in populateContents, fileList[9]: xbin is neither a
>> file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[10]: framework
>> V/->->FEX ( 350): in populateContents, fileList[10]: framework is
>> neither a file nor a directory
>> V/->->FEX ( 350): in populateContents, fileList[11]: lost+found
>> V/->->FEX ( 350): in populateContents, fileList[11]: lost+found is
>> neither a file nor a directory
>>
>> Regards,
>> Anirudh
>>
>>
>>
>
> >
>


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

Note: pleas

[android-developers] How to query the number of unread SMS

2009-07-14 Thread n179911

Hi,

Can you please tell me how can i query the number of unread SMS in
android programmically?

i.e. How can I implement the SMS unread count like this link:
http://android.kanokgems.com/sms-unread-count/

Thank you.

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



[android-developers] Re: what is android.process.acore used for?

2009-07-14 Thread Dianne Hackborn
It's an internal process where we can run a bunch of stuff that is
frequently used (home, contacts provider, user dictionary provider, etc)
without having to spend separate processes for each.

So basically it is an optimization.

On Tue, Jul 14, 2009 at 2:50 AM, Nick Hsiao  wrote:

>
> some package whether in apps or provider directory adds it self into
> android.process.acore by adding
>  AndroidManifest.xml,
> I dont know if there is difference between not adding or adding this
> line???
> thanks~
>
> >
>


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

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

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



[android-developers] Re: Lock screen feature does not work

2009-07-14 Thread Dianne Hackborn
Please post questions about building the platform on android-porting,
thanks.  Fwiw, this has been asked a number of times, and it is because your
device hasn't been provisioned yet.

On Tue, Jul 14, 2009 at 1:01 AM, Jerry Wang  wrote:

>
> Hi there,
>
> I have ever saw the similar discussion in this group, but nobody
> answer. And I am very confusing about this feature. Because most of
> developers do not seem to meet this problem.
>
> The problem is when I press ENDCALL button, it does not going into
> Screen Lock view. And I have download the source code of "cupcake" &
> "android-1.5" & "android-1.5r2" & "android-sdk-1.5_r1" version from
> Android's GitWeb. The feature of lock screen does not work on the
> emulator. But it works on the offical SDK version. I don't know what
> is happened.
>
> Please give me a help!! Thanks a lot.
>
> >
>


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

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

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



[android-developers] Re: JNI_OnLoad (). Is it mandatory?

2009-07-14 Thread David Turner
No, it's optional.

On Tue, Jul 14, 2009 at 6:00 AM, krr_android  wrote:

>
> Hi,
>
> Is it mandatory to provide this method inisde any .so library?
>
> JNIEXPORT jint JNICALL
> JNI_OnLoad (JavaVM * vm, void * reserved)
> {
>return JNI_VERSION_1_6;
> }
>
> Because, I dont see this inside any of the source files of the natice
> samples provided in the NDK. Then, how does it work there?
>
> Pls clarify the necessity of this function. Thanks in advance.
>
> Regards,
>
> >
>

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



[android-developers] Re: Android GUI testing

2009-07-14 Thread Dianne Hackborn
You can use Instrumentation, which allows test code to run inside the app,
so it can directly access views and retrieve them with things like
View.findViewById().

On Tue, Jul 14, 2009 at 7:55 AM, AndroidAutoTest wrote:

>
> I am investigating to improve test engine for automating android
> platform.
> The test engine I developed controls UI component by the absolute
> coordinate of the screen, not by its control ID.
> For example, if I want to click a button "A", I can send a command to
> click the button by tapping the screen by the specified coordinate.
>
> However, if the location of the button is changed due to UI change, I
> have to change my script accordingly so that it taps on the right
> coordinate to press the button.
>
> Is there any other method to control the UI component by its ID or
> name, not by tapping the absolute coordinate?
>
> For example, if I can send a command to press a button "A" by its
> name, the script would press the button successfully no matter where
> the button is located.
>
>
> >
>


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

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

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



[android-developers] Re: Soft keyboard Layout

2009-07-14 Thread Dianne Hackborn
Only if you write your own IME.

On Tue, Jul 14, 2009 at 4:37 AM, I_Shove  wrote:

>
> Hello
>
> Is it possible to change the layout of the softkeyboard ?
>
> Regards
>
> >
>


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

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

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



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Dianne Hackborn
Oh if you are doing this in your manifest, then that won't work:

http://developer.android.com/reference/android/content/Intent.html#ACTION_BATTERY_CHANGED

On Tue, Jul 14, 2009 at 9:17 AM, Richard Schilling <
richard.rootwirel...@gmail.com> wrote:

>
> That's a good point.  I will try registering the broadcast receiver
> programmatically as well to see if there's a difference in behavior.
>
> Richard Schilling
> Root Wireless
>
>
> On Jul 14, 9:08 am, Dianne Hackborn  wrote:
> > Fwiw, you don't need that permission to get the battery state.  Other
> than
> > that, I can't really help you.  If the status bar battery indicator is
> > changing, then the broadcast is indeed being sent, because it is driven
> off
> > of that.
> >
> > On Tue, Jul 14, 2009 at 1:56 AM, Richard Schilling <
> >
> >
> >
> > richard.rootwirel...@gmail.com> wrote:
> >
> > > Oh, and I do have permission "android.permission.BATTERY_STATS"
> > > included in the manifest as well.
> >
> > > So. what's wrong?
> >
> > > Any ideas?
> >
> > > Thanks in advance,
> >
> > > Richard Schilling
> > > Root Wireless
> >
> > > On Jul 14, 1:54 am, Richard Schilling 
> > > wrote:
> > > > For some reason, the BATTERY_CHANGED event has stopped being
> broadcast
> > > > by the phone.
> >
> > > > I have my application setup properly:
> >
> > > > 1. I have a broadcast receiver setup with the filter of
> > > > "android.intent.action.BATTERY_CHANGED" in the manifest.
> > > > 2. I have permission of "android.permission.DEVICE_POWER" also
> defined
> > > > in the manifest.
> >
> > > > When the application first starts up, I get one BATTERY_CHANGED
> intent
> > > > that the phone gives me.  And, then after that, the phone doesn't
> > > > broadcast any more BATTERY_CHANGED intents as the phone is plugged in
> > > > and unplugged.
> >
> > > > This is really weird.
> >
> > > > Richard Schilling
> > > > Root Wireless
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


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

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

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



[android-developers] Re: TDD on Android (or should I say Dalvik)

2009-07-14 Thread jimshowalter

I don't see mocks for SQLiteDatabase or Cursor in android.test.mock. I
want to test my data model without using the actual database. I tried
using EasyMock to do that, but it flunked Verify on the emulator. I
tried creating my own stub, but the default constructor for
SQLiteDatabase wasn't visible, and the super's parameterized
constructor tried to open an actual database.

Is there a way to do what I want?

On Jun 8, 11:01 pm, Brett Chabot  wrote:
> Responses inline
>
> On Sat, Jun 6, 2009 at 6:11 AM, RedMac G wrote:
>
> > JUnit -- android.jar has its own junit.jar and my assumption is you're
> > supposed to use it, not the latest version from junit.org
>
> There's a collection of helper test classes in android.test package as
> well. For example, if your test needs access to a Context, you can use
> AndroidTestCase. If you want your test to have access to
> Instrumentation, which will allow it to launch activities, inject key
> events, etc, then you an use one of the subclasses of
> InstrumentationTestCase.
>
> The ApiDemos/tests sample code has some test examples.
>
> > Mockito -- read this one
> >http://code.google.com/p/mockito/issues/detail?id=57
>
> See android.test.mock for a selection of frameworks for creating
> Mocks. It includes mock versions of Application, Context,
> ContentResolver, PackageManager, and other commonly used Android
> classes.
>
> > EclEmma -- doesn't support Android JUnit tests
>
> I'm working on supporting Emma code coverage on Android. The support
> is still pretty rough, I wouldn't recommend trying it as this point
> unless you are really keen. I posted info on getting Emma code
> coverage data when running tests on Android on a earlier thread in
> this group. It would be cool to hook into EclEmma as well but there
> are no definite plans for that.
>
> Regards,
> Brett.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to write async socket with Android?

2009-07-14 Thread Moto

I just googled: "java async socket"
And got this tutorial:
http://games.fabiolee.com/post.asp?id=418

I'm not sure if it helps...

Moto!


On Jul 14, 11:17 am, Walter  wrote:
> You usually need different threads to read  and write, prevent
> blocking the UI thread.
>
> On Jul 14, 12:49 am, Victor Lin  wrote:
>
> > Well, but will the read of InputStream blocked when there is no
> > incoming data?
> > I mean... for example:
>
> > I run the sock in specific thread, because those methods' call will
> > blocked. The code might like this:
>
> > /// This is the socket thread for checking data
> > while not stop:
> >     data = read(); // if no incoming data, we will blocked here
>
> > The client program needs to check the data from sever, so it run a
> > loop to read data. And how about outgoing data? Can I send out going
> > data from another thread? like this.
>
> > // this is called from UI thread
> > void onClick() {
> >     outputStream.write("hello baby!");
>
> > }
>
> > On 7月14日, 下午2時21分, James <030440...@163.com> wrote:
>
> > > Hi Victor Lin:
> > > I don't know why could your problem happen,As One socket have both
> > > inputstream and outputstreams,They are responsible for read and write;
> > > And as far as i call tell,Socket is not android-specified,Hope this
> > > helps!
>
> > > Bgs!
> > > James
>
> > > On Jul 14, 12:57 pm, Victor Lin  wrote:
>
> > > > Hi,
>
> > > > I am developing a program that needs async socket. I am new to Android
> > > > and Java. As I can see in the document, to write network program, I
> > > > got Socket and SocketChannel, but it seems they are all sync socket,
> > > > it means, I need an extra thread to call blocking read, write... and
> > > > etc. Here comes the problem, my program is a chat room, the
> > > > communicate is not linear, I have no idea when the server will send a
> > > > message to me, if I read in that thread to wait message from server,
> > > > but the user want to send message to server, the reading function
> > > > blocked forever, if there is no incoming data, then the pending
> > > > outgoing message will not be sent. That's why I need async socket. So
> > > > my question is: How to write async socket under Android environment?
>
> > > > Thanks.
> > > > Victor Lin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] getDeviceId returns null

2009-07-14 Thread MCON Dev
Hi,
I am running this piece of code

myDevice = Globals.getInstance().getDevice();
  this.deviceID = myDevice.getDeviceId() ;
with the below xml

http://schemas.android.com/apk/res/android";
  package="com.org.mcruiseon.client"
  android:versionCode="1"
  android:versionName="1.0">
  
  
  
  
  
  
  
  
  



What am I doing wrong. Why is getDeviceId returning null ?
Siddharth

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



[android-developers] Re: Speech Recognition

2009-07-14 Thread Steven

I figured out what was wrong. But like the commenter below I get the
"recognizer is not present" displayed when I run my code in the
emulator. I read that google voice search must be installed for the
voice recognition intent to work. Is this correct?
-Steven

On Jul 9, 6:08 pm, Mark Murphy  wrote:
> Steven wrote:
> > So when I use the code from voiceRecognition.java to see if it will
> > work. I get and error with R.layout.voice_recognition as well as R.id
>
> What are the error messages?
>
> Also, remember that you cannot necessarily just grab bits of Java code
> -- these errors are referring to items in a layout that may be missing.
>
> > and when I try import com.example.android.apis.R it wants me to create
> > the class.
>
> That should be automatically built once we get the other problems above
> fixed.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need help for your Android OSS project?http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Mark Murphy

Richard Schilling wrote:
> That's a good point.  I will try registering the broadcast receiver
> programmatically as well to see if there's a difference in behavior.

The docs say you need to register BATTERY_CHANGED receivers in code, not
via the manifest.

"You can not receive this through components declared in manifests, only
by exlicitly [sic] registering for it with Context.registerReceiver(). "

http://developer.android.com/reference/android/content/Intent.html#ACTION_BATTERY_CHANGED

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

Need help for your Android OSS project? http://wiki.andmob.org/hado

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



[android-developers] Re: HOWTO push kernel repo into android.git.kernel.org?

2009-07-14 Thread Yusuf T. Mobile

Or the repo mailing list. But before you ask them, read this:
http://source.android.com/submit-patches/workflow



Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



On Jul 13, 6:54 pm, JBQ  wrote:
> This question is more likely to get answered on the android-kernel
> mailing list.
>
> JBQ
>
> On Jul 13, 6:34 pm, Xinyu Chen  wrote:
>
>
>
> > Hi All
>
> > I'm working for Freescale Semiconductor on the i.MX series linux BSP.
> > Now we have android running well on i.MX515 platform, and hope to push
> > android kernel repo into android.git.kernel.org.
> > Then what's the process need us to follow? How reviews will be done?
> > And what we should provide?
>
> > Can anybody kindly answer the questions, and give any suggestion?
> > Thanks.
>
> > BR
> > Xinyu Chen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: onTap display toast or message

2009-07-14 Thread Mark Murphy

alexdonnini wrote:
> Thanks. What I meant is that I thought that in your example,
> SitesOverlay is an inner class of the map activity "NooYawk". In my
> case, the custom itemized overlay class is not an inner class of the
> map activity. This means that an entry like NooYawk.this will not
> work.
> 
> Am I wrong? I have not been able to get it to work.

Ah, now I understand.

Just pass in the activity to your ItemizedOverlay's subclass'
constructor, and use it to create your Toast.

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

Need help for your Android OSS project? http://wiki.andmob.org/hado

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



[android-developers] Re: multiple-process in single application.

2009-07-14 Thread magicpig

Thanks for the reply.

I am trying hard to merge them together and the Application logic
seems a little more than setting the globals, such performing
differently on onLowMemory,  onTerminate and  onConfigurationChanged.

So,is it possible to get the intent that starts the activity or the
different process name in Application#onCreate?

Thanks


On Jul 14, 2:20 pm, Dianne Hackborn  wrote:
> Sorry, you can't do that.  There are really very few reasons to have a
> custom Application anyway.  I would generally suggest staying away from it,
> and just using statics for your globals.
>
>
>
> On Mon, Jul 13, 2009 at 11:17 PM, magicpig  wrote:
> > HI,
>
> >      I need  two activities run in different processes in the same
> > application. Now I have made it work by specifying the different
> > process name in "android:process".
>
> >        But I met a problem,  from
>
> >http://developer.android.com/guide/topics/manifest/application-elemen...
> > ,
> > we have only one superclass of Application will run before the
> > activity starts(I have tested it, and each time a after new processes
> > start, this Application(its superclass) will run before activity).
> > But, my two activities have two different superclasses of
> > Applications. So, how to make Applications for different activities
> > run for its corresponding activity?
>
> >       If there is no way to use different Application class for
> > different activity, how can I make a flag for the common Application
> > superclass to judge which process(by getting its name) is running?
>
> >      BTW, the two activities were on the separated development flow
> > and I am trying to merge them.
>
> > Thanks a lot.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: multiple-process in single application.

2009-07-14 Thread magicpig

Thanks for the reply.

I am trying hard to merge them together and the Application logic
seems a little more than setting the globals, such performing
differently on onLowMemory,  onTerminate and  onConfigurationChanged.

So,is it possible to get the intent that starts the activity or the
different process name in Application#onCreate?

Thanks

On Jul 14, 2:20 pm, Dianne Hackborn  wrote:
> Sorry, you can't do that.  There are really very few reasons to have a
> custom Application anyway.  I would generally suggest staying away from it,
> and just using statics for your globals.
>
>
>
> On Mon, Jul 13, 2009 at 11:17 PM, magicpig  wrote:
> > HI,
>
> >      I need  two activities run in different processes in the same
> > application. Now I have made it work by specifying the different
> > process name in "android:process".
>
> >        But I met a problem,  from
>
> >http://developer.android.com/guide/topics/manifest/application-elemen...
> > ,
> > we have only one superclass of Application will run before the
> > activity starts(I have tested it, and each time a after new processes
> > start, this Application(its superclass) will run before activity).
> > But, my two activities have two different superclasses of
> > Applications. So, how to make Applications for different activities
> > run for its corresponding activity?
>
> >       If there is no way to use different Application class for
> > different activity, how can I make a flag for the common Application
> > superclass to judge which process(by getting its name) is running?
>
> >      BTW, the two activities were on the separated development flow
> > and I am trying to merge them.
>
> > Thanks a lot.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem in running the android sky widget

2009-07-14 Thread Jeff Sharkey

There have been previous threads about android.location.Geocoder not
entirely working in the SDK.  That app depends on responses from that
API, which is why it's not working.

The geocoder works on actual devices, otherwise you could hard-code
values when debugging.

j


On Tue, Jul 14, 2009 at 5:04 AM, bhoj wrote:
>
> same here even I am facing the same problem
>
> On Jul 14, 11:07 am, n179911  wrote:
>> Hi,
>>
>> I have download the android sky project and able to get it to compile
>> it under eclipse.
>>
>> http://code.google.com/p/android-sky/
>>
>> But when i try to add a 'Forecast' Widget on emulator, it pops up a
>> 'Configure forecast widget',
>> then I click 'Manual search' , I entered '60005' as my zip code. Then
>> I press the 'Search' Icon.
>>
>> Then what should I do to next? Both 'Verify on Map' and 'Save' buttons
>> are disabled. I am not sure what else do i need to do to run it on
>> emulator?
>>
>> Thank you.
> >
>



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

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



[android-developers] Re: Problem in running the android sky widget

2009-07-14 Thread n179911

On Tue, Jul 14, 2009 at 11:05 AM, Jeff Sharkey wrote:
>
> There have been previous threads about android.location.Geocoder not
> entirely working in the SDK.  That app depends on responses from that
> API, which is why it's not working.
>
> The geocoder works on actual devices, otherwise you could hard-code
> values when debugging.
>

Thank you. Can you please tell me how to hard-code values? (i.e. which
classes to put what hard code values)



> j
>
>
> On Tue, Jul 14, 2009 at 5:04 AM, bhoj wrote:
>>
>> same here even I am facing the same problem
>>
>> On Jul 14, 11:07 am, n179911  wrote:
>>> Hi,
>>>
>>> I have download the android sky project and able to get it to compile
>>> it under eclipse.
>>>
>>> http://code.google.com/p/android-sky/
>>>
>>> But when i try to add a 'Forecast' Widget on emulator, it pops up a
>>> 'Configure forecast widget',
>>> then I click 'Manual search' , I entered '60005' as my zip code. Then
>>> I press the 'Search' Icon.
>>>
>>> Then what should I do to next? Both 'Verify on Map' and 'Save' buttons
>>> are disabled. I am not sure what else do i need to do to run it on
>>> emulator?
>>>
>>> Thank you.
>> >
>>
>
>
>
> --
> Jeff Sharkey
> jshar...@android.com
>
> >
>

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



[android-developers] Re: flag_fullscreen + windowNoTitle == button focus bug

2009-07-14 Thread Brady

Hi Dianne,

thank you for your reply. I wonder if dynamically positioning the top
buttons onscreen in the OnCreate would help this timing issue? For now
I guess I lucked out because I don't use the IME in this screen, but
thank you for pointing this out. I can see why this might be a problem
considering it shifts the content on the screen when it is shown.

Regards,
Brady

On Jul 13, 3:43 pm, Dianne Hackborn  wrote:
> Note this this will break your interaction with the IME, if it is
> displayed.  What is going on is that during the transition to your app, the
> status bar is still visible, so if you have something at the top of the UI
> that is in focus it will move your window to make it visible behind the
> status bar.
>
> You can use this by using the Fullscreen theme, so the system knows your
> window will be fullscreen a bit earlier.  There can still be some
> interesting timing in the transition that still leaves the status bar
> visible initially, which hopefully will be improved in a future version of
> the platform.
>
>
>
> On Mon, Jul 13, 2009 at 2:33 PM, Ward Willats  wrote:
>
> > YES! Fixes it here too. Nice diagnosis/hacking Brady. Thanks very
> > much. (And yes, it must be a bug.)
>
> > -- Ward
>
> > At 1:12 PM -0700 7/13/09, Brady wrote:
> > >Hey Ward,
>
> > >looks like exactly the same problem! Does my workaround fix your
> > >issue?
>
> > >Brady
>
> > >On Jul 13, 1:02 pm, Ward Willats  wrote:
> > >>  Me too. Can't believe you and I are the only two who see this.
>
> > >>  http://groups.google.com/group/android-developers/browse_thread/threa.
> > ..
>
> > >>  -- Ward
>
> > >>  At 12:50 PM -0700 7/13/09, Brady wrote:
>
> > >>  >Hi, just a quick note, bug.java was really named StatusBarBug.java
> > >>  >like my project.
>
> > >>  >Cheers,
> > >>  >Brady
>
> > >>  >On Jul 13, 12:46 pm, Brady  wrote:
> > >>  >>  Hi guys,
>
> > >>  >>  I've found an irritating bug that I could please use some help
> > with.
>
> > >>  >>  My application is styled to show no title (android:windowNoTitle)
> > and
> > >>  >>  in onCreate() in the activity the system toolbar is hidden to
> > display
> > >>  >>  as fullscreen. There are two buttons in the activity's relative
> > >>  >>  layout, aligned top of parent and bottom. The bug happens when I
> > use 5-
> > >>  >>  way navigation to focus the top button. The screen momentarily
> > shifts
> > >>  >>  or bounces down the size of the default titlebar. In some instances
> > >>  >>  part of the bottom content gets clipped. Here is a mini app I
> > created
> > >>  >>  to reproduce the bug. Any help to workaround this bug would be
> > >>  >>  appreciated! Note: you may have to run the app twice to see this
> > >>  >>  behavior.
>
> > >>  >>  Brady
>
> > >>  >>  [bug.java]
>
> > >>  >>  package com.adobe.test;
>
> > >>  >>  import android.app.Activity;
> > >>  >>  import android.os.Bundle;
> > >>  >>  import android.view.WindowManager;
>
> > >>  >>  public class StatusBarBug extends Activity {
> > >>  >>      /** Called when the activity is first created. */
> > >>  >>     �...@override
> > >>  >>      public void onCreate(Bundle savedInstanceState)
> > >>  >>      {
> > >>  >>          super.onCreate(savedInstanceState);
>
> > >>  >>getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
> > >>  >>  WindowManager.LayoutParams.FLAG_FULLSCREEN);
>
> > >>  >>          setContentView(R.layout.main);
> > >>  >>      }
>
> > >>  >>  }
>
> > >>  >>  [main.xml]
>
> > >>  >>  
> > >>  >>  http://schemas.android.com/apk/res/
> > >>  >>  android"
> > >>  >>          android:layout_width="fill_parent"
> > >>  >>          android:layout_height="fill_parent">
>
> > >>  >>                   > >>  >>                          android:layout_width="wrap_content"
> > >>  >>                          android:layout_height="wrap_content"
> > >>  >>                          android:text="button"/>
>
> > >>  >>                   > >>  >>                          android:layout_height="wrap_content"
> > >>  >>                          android:layout_alignParentBottom="true"
> > >>  >>                          android:text="button2">
> > >>  >>                          
> > >>  >>                  
>
> > >>  >>  
>
> > >>  >>  [styles.xml]
>
> > >>  >>  
> > >>  >>  
> > >>  >>    
> > >>  >>    
> > >>  >>          true
> > >>  >>    
> > >>  >>  
>
> > >>  >>  [manifest.xml]
>
> > >>  >>  
> > >>  >>  http://schemas.android.com/apk/res/android";
> > >>  >>        package="com.adobe.test"
> > >>  >>        android:versionCode="1"
> > >>  >>        android:versionName="1.0">
> > >>  >>       > android:label="@string/
> > >>  >>  app_name"
> > >>  >>          android:theme="@style/StatusBarTheme">
> > >>  >>           > >>  >>                    android:label="@string/app_name">
> > >>  >>              
> > >>  >>                   > />
> > >>  >>                   > >>  >>  android:name="android.intent.category.LAUNCHER" />
> > >>  >>       

[android-developers] Re: Test onUpgrade

2009-07-14 Thread Vyrak

I did that part.  The problem I'm running into is trying to 'simulate'
an application upgrade to test if my onUpgrade method works.  However,
it's still not being invoked when I try reinstalling the application
to a new version.  Is there a way to simulate an application upgrade
without having to post it onto the market?

On Jul 13, 1:46 pm, skyman  wrote:
> onUpgradeis invoked only when SQLiteOpenHelper cunstructor's version
> paremeter is greater than when the database was created at first.
>
> In my app (pl.skyman.autobuser) I have constant field for "current"
> database version and inonUpgradeI compare oldVersion and newVersion
> with values from past to make step by step upgrade.
>
> Skyman
>
> On 13 Lip, 21:11, VRAQ  wrote:
>
> > I changed my database schema on my application to include an
> > additional column in one of the tables.  I did this in theonUpgrade
> > method in the DBHelper.
>
> > Then I tried exporting my signed application and reinstalling it using
> > the 'adb install -r .apk' command to try and 'simulate' an
> > application upgrade, butonUpgradenever gets called.
>
> > Is there a command that I can use to try and duplicate the behavior of
> > an application upgrade?
>
> > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to use adb tool on SAMSUNG GALAXY?

2009-07-14 Thread Da Yang
OK. There is only one way to test my camera application. use any APK
Installer install the apk, though it's not handy, it's the solution in the
moment.
But thank you for your answers. Maybe i want to write to SAMSUNG development
group, and ask for a right adb if they do have one.

On Tue, Jul 14, 2009 at 6:11 PM, David Turner  wrote:

> You need a different version of ADB to access this phone at the moment.
> A future release of the SDK will provide an ADB binary that should be able
> to do that, but this is not available yet as far as I know.
>
> You're quite on the bleeding edge, aren't you ;-)
>
>
> On Tue, Jul 14, 2009 at 6:05 PM, legerb  wrote:
>
>>
>> Hey,
>> I just got this device too. Trying to figure out how to debug on
>> device too.
>> According this
>> http://groups.google.com/group/android-beginners/browse_thread/thread/167b279683bddc8a
>> Samsung have their own adb.
>> Please update the thread if you've got any progress :)
>>
>> thanks ahead!
>>
>> On Jul 11, 10:54 pm, da yang  wrote:
>> > Hi
>> > i got this new mobilephone this week in Germany, wanted to debug my
>> > program on the device. but it doesn't work, "c:\>adbdevices" lists
>> > no device attached, though i have tried to change the
>> > "android_usb.inf" in order to install the usb driver from SDK.
>> > i added some entries as follows:
>> > under
>> > [Google.NTx86]
>> >
>> > ; HTC DREAM
>> > ...
>> >
>> > ; SAMSUNGGALAXY
>> > %USB\VID_04E8&PID_6640.
>> > DeviceDescRelease%=androidusb.Dev, USB
>> > \VID_04E8&PID_6640
>> > %USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease%=androidusb.Dev, USB
>> > \VID_04E8&PID_6640&MI_01
>> > %USB\VID_04E8&PID_6640.DeviceDescRelease%=androidusb.Dev, USB
>> > \VID_04E8&PID_6640
>> >
>> > and [Strings]:
>> >
>> > USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXY"
>> > USB\VID_04E8&PID_6640&MI_01.DeviceDescRelease="SAMSUNGGALAXY
>> > CompositeADBInterface"
>> > USB\VID_04E8&PID_6640.DeviceDescRelease="SAMSUNGGALAXYBootloader"
>> >
>> > i got only one VID and one PID through
>> > USBVIEW, though for HTC DREAM there are different PIDs used.
>> > Theadbinterface got installed, butadbjust didn't work.
>> >
>> > later i also tried to use the device under linux, set up the device as
>> > in Dev guide:
>> >
>> > If you're developing on Ubuntu Linux, you need to add a rules file:
>> >
>> >1. Login as root and create this file: /etc/udev/rules.d/51-
>> > android.rules.
>> >
>> >   For Gusty/Hardy, edit the file to read:
>> >   SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
>> >
>> >   For Dapper, edit the file to read:
>> >   SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
>> >2. Now execute:
>> >   chmod a+rx /etc/udev/rules.d/51-android.rules
>> >
>> > "adbdevices" listed nothing as well. : (
>> >
>> > open a terminal on the device, with "ps", i guess theadbdaemon
>> > "adbd" is running.
>> > but theadbtool just doesn't work.
>> >
>> > Can someone help me?
>> >
>> > thanks da
>>
>>
>
> >
>


-- 

Da Yang
daboil...@gmail.com

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



[android-developers] Re: multiple-process in single application.

2009-07-14 Thread magicpig

On Tue, Jul 14, 2009 at 12:12 AM, magicpig 
wrote:

Thanks Dianne for the quick reply.

My two Application.java do some more things than having the
statics:
1. own the ability to store current activity for use in all the
activities in the same process. (In the former description, I just
talked about two for simple).
2. Creating some instances for later use(maybe can be moved to
statics)

So, if there is a way for replacing this easily, I am happy to do.

BTW, I think we can read the process name, right?

Thanks a again.



On Jul 15, 1:58 am, magicpig  wrote:
> Thanks for the reply.
>
> I am trying hard to merge them together and the Application logic
> seems a little more than setting the globals, such performing
> differently on onLowMemory,  onTerminate and  onConfigurationChanged.
>
> So,is it possible to get the intent that starts the activity or the
> different process name in Application#onCreate?
>
> Thanks
>
> On Jul 14, 2:20 pm, Dianne Hackborn  wrote:
>
> > Sorry, you can't do that.  There are really very few reasons to have a
> > custom Application anyway.  I would generally suggest staying away from it,
> > and just using statics for your globals.
>
> > On Mon, Jul 13, 2009 at 11:17 PM, magicpig  wrote:
> > > HI,
>
> > >      I need  two activities run in different processes in the same
> > > application. Now I have made it work by specifying the different
> > > process name in "android:process".
>
> > >        But I met a problem,  from
>
> > >http://developer.android.com/guide/topics/manifest/application-elemen...
> > > ,
> > > we have only one superclass of Application will run before the
> > > activity starts(I have tested it, and each time a after new processes
> > > start, this Application(its superclass) will run before activity).
> > > But, my two activities have two different superclasses of
> > > Applications. So, how to make Applications for different activities
> > > run for its corresponding activity?
>
> > >       If there is no way to use different Application class for
> > > different activity, how can I make a flag for the common Application
> > > superclass to judge which process(by getting its name) is running?
>
> > >      BTW, the two activities were on the separated development flow
> > > and I am trying to merge them.
>
> > > Thanks a lot.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Cell Radio Info

2009-07-14 Thread Richard Schilling

I found good field test mode instructions at

http://phoneftd.blogspot.com/2009/03/google-g1-phone-field-test.html

Enter the Field Mode by typing (exactly) this into the Dailer app:
*#*#7262626#*#*
When the dialer sees the string it will start the field test
application.

I'm sure if you look at the dialer application source code you'll see
all of the codes that it recognizes.


Richard

On Jul 10, 11:00 am, ain  wrote:
> So have you been to see the listeners/managers?
> Looks like either someone has the code or was able to access the
> fieldtestMode
>
> http://www.flickr.com/photos/12118...@n00/3258661437/in/set-721576134...
>
> On Jul 9, 6:58 pm, RichardSchilling
> wrote:
>
> > That's probably all you're going to get at the application layer,
> > although from what I've seen the managers/listeners you've identified
> > are pretty reliable.
>
> > My guess would be that you need to debug the platform itself on a
> > Linux box to get this information.  There's a field test mode in the
> > phone, but I don't have the code here (google for them).  The RIL is
> > buried pretty deeply in the Linux kernel 
>
> > RichardSchilling
> > Root Wireless
>
> > On Jul 9, 7:46 am,ain wrote:
>
> > > Is there a way I can get access to the following information from the
> > > cell. I know that it uses a Qualcomm MSM7201A chip. I know qualcomm
> > > unleashes a boat load of information such as:
> > > Pilots-Channels
> > > PN offset
> > > Neighbours
> > > Searches
> > > PN Codes
> > > Power Control-TX and RX
> > > Slot
> > > DRC
> > > Signal Noise Ratio
> > > Carrier to Noise Ratio
> > > Energy to Noise Ratio
>
> > > so the question is can I get access to all this information and are
> > > there APIs from Android that I can use.
>
> > > So far the closets I have come is in
> > > telephony/PhoneStateListener
> > > telephony/NeighboringCellInfo
> > > telephony/CellLocation
> > > telephony/TelephonyManager
>
> > > any more help is welcome
>
> > >ain
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Some G1 phones getting "device not found" with adb...

2009-07-14 Thread Richard Schilling

Somehow I feel both relieved and scared at the same time knowing this
is a possibility.  :-)

I wonder.  My second phone started acting the same way last night.

Richard


On Jul 13, 7:24 pm, "nEx.Software"  wrote:
> This occasionally happens to me on both my G1 and my Ion. I think its
> related to the data pins not contacting competely. Usually the old NES
> trick (blow in the cartridge) works for me. A quick little blow in
> both the USB connectors and it works like new. Unfortunately,  I think
> there is a chance that constantly plugging in and removing the USB can
> rather quickly damage the port.
>
> On Jul 13, 6:56 pm, Richard Schilling 
> wrote:
>
> > I'm doing a lot of G1 development these days, and I'm seeing a problem
> > others have talked about but there seems to be no consistent answer.
>
> > I have multiple G1 phones.  Same model, manufacturer, etc...
>
> > One of them connects to the computer, is recognized by adb, etc. just
> > fine.  Works like a charm.
>
> > The second phone isn't recognized by adb at all.
>
> > The two phones are setup identically.
>
> > In fact, I have an application running on both phones that detects
> > changes in battery state.  The phone that connects to the computer
> > just fine also captures the battery states for being plugged in and
> > unplugged just fine.
>
> > The phone that doesn't get recognized doesn't get the battery events
> > at all - not when it's plugged in to the USB port, nor when it's
> > plugged into the wall charger.
>
> > Any help on troubleshooting the phone that won't connect would be
> > appreciated.
>
> > A factory reset seems to not help.
>
> > Thanks.
>
> > Richard Schilling
> > Root Wireless
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Getting ESN number of a Phone

2009-07-14 Thread MCON Dev
Yusuf,
Wont the following work ?
globals.setDevice((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE));
Globals {
public void setDevice(TelephonyManager myDevice){this.myDevice = myDevice ;}

public initialize(){
  myDevice = Globals.getInstance().getDevice();
  this.deviceID = myDevice.getDeviceId() ;
  this.networkType = myDevice.getNetworkType() ;
  this.phoneType = myDevice.getPhoneType() ;
  this.simSerialNumber = myDevice.getSimSerialNumber();
}

}
I am getting this.deviceID as null, networkType as 0, phoneType = 0,
simSerialNumber=0.
Please help
Siddharth

On Tue, Jun 30, 2009 at 6:11 AM, Yusuf T. Mobile wrote:

>
> Here's some code to get you on your way:
>
>
> Yusuf Saib
> Android
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> --
>
>
> import java.io.IOException;
> import java.io.InputStream;
>
> import android.content.Context;
> import android.os.Build;
> import android.telephony.TelephonyManager;
> import android.telephony.gsm.GsmCellLocation;
>
> public class DeviceInfomation {
>
>private MonitorActivity mon;
>
>/**
> *
> * @param monAct
> *  the monitor activity.
> */
>public DeviceInfomation(MonitorActivity monAct) {
>this.mon = monAct;
>}
>
>public String getDeviceInfo() {
>String result = "\t\n";
>result += getSoftwareRevision();
>result += getHardwareRevision();
>result += "\t\t" + getCellID() + "\n";
>result += "\t\t" + getMsisdn() + "\n";
>result += "\t\t" + getImei() + "\n";
>result += "\t\n";
>return result;
>}
>
>/**
> *
> * @return Returns the IMEI.
> */
>private String getImei() {
>TelephonyManager mTelephonyMgr = (TelephonyManager)
>mon.getSystemService(Context.TELEPHONY_SERVICE);
>return mTelephonyMgr.getDeviceId();
>}
>
>/**
> *
> * @return Returns the MSISDN.
> */
>private String getMsisdn() {
>TelephonyManager mTelephonyMgr = (TelephonyManager)
>mon.getSystemService(Context.TELEPHONY_SERVICE);
>return mTelephonyMgr.getLine1Number();
>}
>
>/**
> *
> * @return Returns the cell ID.
> */
>private int getCellID() {
>TelephonyManager mTelephonyMgr = (TelephonyManager)
>mon.getSystemService(Context.TELEPHONY_SERVICE);
>GsmCellLocation location = (GsmCellLocation)
>mTelephonyMgr.getCellLocation();
>return location.getCid();
>}
>
>/**
> *
> * @return Returns the software revision.
> */
>private String getSoftwareRevision() {
>String result = "\t\n";
>Runtime runtime = Runtime.getRuntime();
>try {
>Process proc = runtime.exec("cat /proc/version");
>int exit = proc.waitFor();
>if (exit == 0) {
>String content = getContent(proc.getInputStream());
>int index = content.indexOf(')');
>if (index >= 0) {
>result += "\t\t" + content.substring(0,
> index +1)
>+ "\n";
>}
>}
>} catch (IOException e) {
>e.printStackTrace();
>} catch (InterruptedException e) {
>e.printStackTrace();
>}
>result += "\t\t" + Build.PRODUCT +
> Build.VERSION.RELEASE
>+ "\n";
>result += "\t\n";
>return result;
>}
>
>private String getHardwareRevision() {
>String result = "\t\n";
>Runtime runtime = Runtime.getRuntime();
>try {
>Process proc = runtime.exec("cat /proc/cpuinfo");
>int exit = proc.waitFor();
>if (exit == 0) {
>String content = getContent(proc.getInputStream());
>String [] lines = content.split("\n");
>String [] hInfo = {
>"Processor", "Hardware", "Revision"
>};
>if (lines != null) {
>for (String line: lines) {
>for (String info: hInfo) {
>int index = line.indexOf(info);
>if (index >= 0) {
>result += "\t\t<" + info.toLowerCase()
> + ">";
>int vIndex = line.indexOf(':');
>result += line.substring(vIndex + 1);
>result += "\t\t () + ">";
>}
>}
>}
>}
>}
>} catch (IOException e) {
>e.printStackTrace();
>} catch (InterruptedException e) {
>e.printStackTrace();
>}
>result += "\t\n";
>return re

[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Richard Schilling

Thanks everyone for your help.

My bad.  I do register in the body of the program instead of in the
manifest.  So, scratch the part above about the manifest.

I declare a static variable in the activity to keep track of whether
or not the registration has already happened.  Perhaps the receiver is
being de-registered while the static boolean reference is kept alive
in the VM:



public MyActivity extends Activity {

private static boolean registeredBatteryIntent = false;

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

IntentFilter filter = new IntentFilter
(Intent.ACTION_BATTERY_CHANGED);
MyReceiver receiver = new MyReceiver();
this.registerReceiver(receiver, filter);
Log.i("Receiver.Registration", "registered intent
receiver.");
registeredBatteryIntent = true;


}
}
}

Richard

On Jul 14, 10:31 am, Mark Murphy  wrote:
> Richard Schilling wrote:
> > That's a good point.  I will try registering the broadcast receiver
> > programmatically as well to see if there's a difference in behavior.
>
> The docs say you need to register BATTERY_CHANGED receivers in code, not
> via the manifest.
>
> "You can not receive this through components declared in manifests, only
> by exlicitly [sic] registering for it with Context.registerReceiver(). "
>
> http://developer.android.com/reference/android/content/Intent.html#AC...
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need help for your Android OSS project?http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multi-touch & My Touch Phone Questions

2009-07-14 Thread dotclick

Multitouch has been used before Apple so I doubt their patent will
survive. But I can understand why they might not want to get into a
legal argument until its settled.

On Jul 13, 4:58 pm, Streets Of Boston  wrote:
> Some hackers have been able to enable multi-touch on the G1. The
> hardware is there, but because of legal issues, it has not been
> enabled.
> It is a patent issue. Just google this:
>
>   apple patent multi touch
>
> And to be honest, i don't miss multi-touch that much. I like that i
> can use only one hand to operate the phone (except when using the
> keyboard).
>
> >"It just feels like many of the user 'use cases' that might have been used 
> >don't seem real world and practical."<
>
> Which use cases don't seem real-world nor practical (besides that bug
> 1583)?
>
> I don't think HTC is making the 
> iPhone:http://texyt.com/iphone+manufacturer+supplier+assembler+not+apple+00113
>
> On Jul 12, 1:26 pm, Infinite  wrote:
>
>
>
> > Keep in mind I am not an android developer, however I am a tech
> > consumer with authority to select and purchase over 100+ phones.
>
> > I just saw the new Google phone at t-mobile and I was disappointed
> > that it didn't have any multi-touch functionality.  Actually I was
> > quite disappointed in the phone all together.  It just feels like many
> > of the user 'use cases' that might have been used don't seem real
> > world and practical.
>
> > Again, don't get me wrong. I am a big proponent of Google and love
> > Chrome and what they have done with their business hosting services --
> > but Adroid is just killing me.  Apple is slick... and with their new
> > GS, is absolutely a wow, mind blowing speed.
>
> > My questions:
>
> > Is multi-touch supported by android or is this just a lack of a
> > hardware implimentation?
>
> > Is Google still sponsoring the new My touch phone that is just coming
> > out?
>
> > I believe HTC is making the G1, My Touch, and the Apple GS... so why
> > such radical departures in CPU speed and multi-touch capability?
>
> > Why should I continue to purchase hundreds of Android based phones
> > when the developers/analysts can't use real-world use cases or when we
> > can't get a BUG fixed (again stupid use case scenario) fixed that
> > displays the wrong contact associated with a phone number.
>
> >     Issue ID 1583 -- Reported on December of 2008.
> >     If you have two contacts with the same last 4 numbers, it appears
> > to
> >     display the first contact.  Phone number matching with caller-id
> > is only
> >     matching the last 4 numbers and not the entire phone number.
>
> > Thanks,
> > -Derek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android BUG....

2009-07-14 Thread dotclick

This is EXACTLY the ridiculous type of response I'm talking about.

If you would have actually read the post or taken the 2 seconds to
click your own link and search "1583" you would have found that it was
reported but has not been fixed.

I like Google but this just just fell to a new low of stupididty.
-D

On Jul 13, 2:58 pm, "Yusuf T. Mobile"  wrote:
> Hello, M. Infinite. Thank you for identifying this issue, as well as
> for contributing your frank assessment of Google's business practices.
> In fact there is a process by which helpful individuals such as
> yourself can report bugs to the Android community who then often
> actually fix them:http://code.google.com/p/android/issues/list
>
> Yusuf Saib
> Android
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Jul 12, 10:34 am, Infinite  wrote:
>
>
>
> >     Issue ID 1583 -- Reported on December of 2008.
> >     If you have two contacts with the same last 4 numbers, it appears
> > to
> >     display the first contact.  Phone number matching with caller-id
> > is only
> >     matching the last 4 numbers and not the entire phone number.
>
> > Not resolved affects hundreds of staff at my company.  August 1st, we
> > need to make a purchasing decision for 350 phones.  Google folks, your
> > taking yourself right of the business community with very dumb
> > mistakes.
>
> > If you can't solve a problem a simple usability problem like this, why
> > would we want to use the business community to chrome, desktop chrome,
> > or any other Google services?   Not only is it getting ridiculous but
> > the effort I have to take to get the visibility to get something so
> > stupid resolved.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] keeping screen on while activity active

2009-07-14 Thread Lex

Hi,

I have a map activity for which I would like to have the screen turned
on as long it's active (the app consists of one activity only). When
the activity is paused or stopped I want to return to normal on/off
mode. Keeping the screen on works fine while the app is running but
when I exit the app the screen stays on as well. What am I missing?

public void onCreate(...) {

  getWindow().addFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView
}


public void onPause(...) {

  getWindow().cleaFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}

public void onResume(...) {

  getWindow().addFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

}

public void onStop(...) {

  getWindow().cleaFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getDeviceId returns null

2009-07-14 Thread Al Sutton

I'm guessing you're running on the emulator in which case getting null
is normal.

Al.
---
http://andappstore.com/

On Jul 14, 6:22 pm, MCON Dev  wrote:
> Hi,
> I am running this piece of code
>
> myDevice = Globals.getInstance().getDevice();
>   this.deviceID = myDevice.getDeviceId() ;
> with the below xml
> 
> http://schemas.android.com/apk/res/android";
>   package="com.org.mcruiseon.client"
>   android:versionCode="1"
>   android:versionName="1.0">
>    android:label="@string/app_name">
>      android:label="@string/app_name">
>   
>   
>   
>   
>   
>   
>   
>  android:name="android.permission.INTERNET">
>  android:name="android.permission.READ_PHONE_STATE">
> 
> What am I doing wrong. Why is getDeviceId returning null ?
> Siddharth
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: keeping screen on while activity active

2009-07-14 Thread Dianne Hackborn
You don't even need to clear it.  This flag is associated with the window,
and it will only keep the screen on while your window is displayed.  I
really can't explain the behavior you say you are seeing, if your window is
not displayed this flag simply will not keep the screen on.

On Tue, Jul 14, 2009 at 12:21 PM, Lex  wrote:

>
> Hi,
>
> I have a map activity for which I would like to have the screen turned
> on as long it's active (the app consists of one activity only). When
> the activity is paused or stopped I want to return to normal on/off
> mode. Keeping the screen on works fine while the app is running but
> when I exit the app the screen stays on as well. What am I missing?
>
> public void onCreate(...) {
>
>  getWindow().addFlags
> (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
>  setContentView
> }
>
>
> public void onPause(...) {
>
>  getWindow().cleaFlags
> (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
> }
>
> public void onResume(...) {
>
>  getWindow().addFlags
> (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
>
> }
>
> public void onStop(...) {
>
>  getWindow().cleaFlags
> (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
> }
> >
>


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

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

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



[android-developers] Re: BATTERY_CHANGED not being sent for some reason.

2009-07-14 Thread Dianne Hackborn
Don't do this in a static.  Once the static is set, it will hold that value
until your process is killed, and you have no way of knowing when that will
be.

On Tue, Jul 14, 2009 at 12:08 PM, Richard Schilling <
richard.rootwirel...@gmail.com> wrote:

>
> Thanks everyone for your help.
>
> My bad.  I do register in the body of the program instead of in the
> manifest.  So, scratch the part above about the manifest.
>
> I declare a static variable in the activity to keep track of whether
> or not the registration has already happened.  Perhaps the receiver is
> being de-registered while the static boolean reference is kept alive
> in the VM:
>
>
>
> public MyActivity extends Activity {
>
>private static boolean registeredBatteryIntent = false;
>
>  @Override
>public void onCreate(Bundle savedInstanceState) {
>super.onCreate(savedInstanceState);
>if (!registeredBatteryIntent){
>
>IntentFilter filter = new IntentFilter
> (Intent.ACTION_BATTERY_CHANGED);
>MyReceiver receiver = new MyReceiver();
>this.registerReceiver(receiver, filter);
>Log.i("Receiver.Registration", "registered intent
> receiver.");
>registeredBatteryIntent = true;
>
>
>}
>}
> }
>
> Richard
>
> On Jul 14, 10:31 am, Mark Murphy  wrote:
> > Richard Schilling wrote:
> > > That's a good point.  I will try registering the broadcast receiver
> > > programmatically as well to see if there's a difference in behavior.
> >
> > The docs say you need to register BATTERY_CHANGED receivers in code, not
> > via the manifest.
> >
> > "You can not receive this through components declared in manifests, only
> > by exlicitly [sic] registering for it with Context.registerReceiver(). "
> >
> > http://developer.android.com/reference/android/content/Intent.html#AC...
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Need help for your Android OSS project?http://wiki.andmob.org/hado
> >
>


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

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

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



  1   2   >