[android-developers] Re: Using the Emulator with a Proxy - 0.9 Beta SDK Windows Eclipse 3.4

2008-08-22 Thread shan

Hi Bob,
I got the browser up. If you have any other versions of the sdk/
emulator on your system, erase them and then unzip the new sdk. And
provide the proxy as proxy:port only. Do not use the http://, it
throws a NumberFormatException.
The -http-proxy startup option did'nt work but the workaround
did(using the system table insertion).



On Aug 21, 4:30 am, Bob [EMAIL PROTECTED] wrote:
 I've tried to use the Emulator with a Proxy using the instructions
 here...

 http://code.google.com/android/reference/emulator.html#proxy

 but have had no success using either of the two options discussed in
 the reference. The 'Browser' application reports...

 Web page not available
 The Web page athttp://www.google.com/mcould not be loaded as:
 The connection to the server was unsuccessful.

 I'm using the Windows 0.9 Beta SDK w/Eclipse 3.4.

 Has anyone got this working? Seems like such a basic thing, I
 shouldn't be stumbling on this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: maps behind proxy 0.9 beta

2008-08-22 Thread shan

Hi Justin

Now the browser works in the emulator but not the maps.
Any suggestions to get the maps going.

On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED]
wrote:
 Does the browser work in the emulator for you? The emulator doesn't
 deal well with being behind a proxy and my guess would be that you
 aren't able to use any data at all.

 Cheers,
 Justin
 Android Team @ Google

 On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote:



  Can the maps API  work behind proxy in the 0.9 beta?- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: -http-proxy problems

2008-08-22 Thread shan

Thanks Andyn, got the browser up. Seems like a problem related with
multiple SDKs on the same machine messing with the proxy.
Refer :
http://groups.google.com/group/android-developers/browse_thread/thread/5bf421494daf6784/cfcc4ad406134b14#cfcc4ad406134b14

If you know/find a reason please update.

On Aug 21, 5:21 pm, shan [EMAIL PROTECTED] wrote:
 I think the same, but I got a workaround.
 - Using the ddms - file explorer we pull out the settings.db file
 - Use SQLite Manager to modify the system table ie. insert the
 http_proxy field
 - Pull the file from the machine into the device as earlier
 - restart the emulator

 This successfully inserted the http_proxy field in the system table
 but the browser is stuck now(seems like a different problem).
 Please refer :  
 http://groups.google.com/group/android-developers/browse_frm/thread/8...
 Any solutions?

 On Aug 21, 4:34 pm, andyn [EMAIL PROTECTED] wrote:



  Hm, I don't really know a solution. Maybe you can wait till the next
  release? It will have sqlite3 included also at the Windows version

  -http://groups.google.com/group/android-developers/browse_frm/thread/8...

  On Aug 21, 10:00 am, shan [EMAIL PROTECTED] wrote:

   Sorry I forgot to mention i am using the SDK 0.9 beta for Windows
   which does'nt have sqlite3 embedded.
   I can't invoke the sqlite3 from the adb shell. I can't access the
   system table in the /data/.settings.db path.
   Any solutions?

   On Aug 21, 12:08 pm, andyn [EMAIL PROTECTED] wrote:

Try it this 
way:http://openhandsetmagazine.com/2007/11/tips-howto-connect-android-emu...

On Aug 21, 9:05 am, shan [EMAIL PROTECTED] wrote:

 I am using a Win XP machine, I started the emulator with : emulator -
 http-proxy http://proxy:port  but the default browser does'nt
 work (can't find message).
 Please assist.- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: sqlite3?

2008-08-22 Thread shan

Thanks all, the browser is working behind the proxy, seems related
with multiple SDKs on the same machine messed up the proxy configs of
the emulator(a guess).
Refer : 
http://groups.google.com/group/android-developers/browse_thread/thread/5bf421494daf6784/cfcc4ad406134b14#cfcc4ad406134b14

If anyone knows the reason please update.

On Aug 21, 5:00 pm, shan [EMAIL PROTECTED] wrote:
 Thanks Mark,  I can access the db files.

 Although the device now gets the proxy but the browser is hung up
 (earlier it gave the not found message), also
 the -http-proxy startup option does'nt work, I can't see it on the
 system table.
 Any solutions?

 On Aug 21, 3:51 pm, Mark Murphy [EMAIL PROTECTED] wrote:



  shan wrote:
   I need to access the system table in data/data/
   com.android.providers.settings/databases/settings.db in the adb shell.
   I had earlier did this in the m5 to insert the 'http_proxy' field, but
   now i can't invoke sqlite3 from the adb shell.
   Please assist.

  Use adb pull (or the equivalent IDE action) to download your SQLite
  database to your development machine. Then use any SQLite client you
  want (sqlite3 console app, SQLite Manager Firefox extension, etc.). If
  you make changes you want reflected on the phone, use adb push (or the
  equivalent IDE action) to put the database back on the phone.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  _The Busy Coder's Guide to Android Development_ Version 1.1 Published!- 
  Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity Question

2008-08-22 Thread Gil

hackbod,

I wrote a simple app, based on the SDK Forwarding example, which
reproduces the problem. The only difference between my app and the
Forwarding app, as far as I can tell, is that the manifest:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.multiplefacets.test
application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.ActivityA android:label=Activity A
android:launchMode=singleTask
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
activity android:name=.ActivityB android:label=Activity B
android:launchMode=singleTop/
/application
/manifest

Note the launchModes for the two Activities. The source for ActivityA
and ActivityB is not worth posting; it is almost identical to the
Forwarding app code.

Thanks for your unrelenting help!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no certificates at entry res/drawable/icon.png; when run my application (sdk 0.9)

2008-08-22 Thread Xavier Ducrohet
If you use the 0.7.1 plugin then it will automatically use a debug
key/certificate to sign application when building.

When you release your application you will need to export it from Eclipse
(see the overview page of the manifest editor, it'll create an unsigned
package), and then manually sign it with your personnal certificate, using
jarsigner.

Xav

On Thu, Aug 21, 2008 at 10:52 PM, Wesley [EMAIL PROTECTED] wrote:

 hi Xav,

 oic...

 thanks for the reply...

 is there means sdk 0.9 need to sign application manually??? I use eclipse
 to create project it can install and run, but when I develop use the project
 and adding image to res and so on... it has this problem... means I need to
 manually signing the apk with some sort of key???

 how to signing apk???
 can u show me???


 thanks...
 have a nice day...


 Wesley.

 On Fri, Aug 22, 2008 at 12:36 PM, Xavier Ducrohet [EMAIL PROTECTED] wrote:

 You are attempting to install an application that is not signed.

 If use ant, you will need to have activityCreator regenerate a new
 build.xml file that contains the proper steps for building/signing your
 application.

 More information here:
 http://code.google.com/android/intro/develop-and-debug.html#signing

 Xav

 On Thu, Aug 21, 2008 at 9:22 PM, Wesley Sagittarius [EMAIL PROTECTED]wrote:


 I trying the SDK 0.9... my previous application is for m5 one..

 I got this error when I wanna to run my application...
 may I know any one what is that means??? and solution would be???


 08-22 04:13:41.732: ERROR/PackageParser(46): Package
 com.google.testing has no certificates at entry res/drawable/icon.png;
 ignoring!




 Wesley.







 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Socket exception-unknown error from HttpClient execute() method

2008-08-22 Thread sacoskun

Did you add uses-permission
android:name=android.permission.INTERNET / tag to your
AndroidManifest.xml?
The new SDK requires that permission for network calls.

sacoskun

On Aug 21, 6:13 pm, Graeme [EMAIL PROTECTED] wrote:
 Hi everyone

 I'm trying to figure out how to use HttpClient 4.x to do POST requests
 routed via
 a Proxy server. I'm seeing a socket exception triggered by calling

 DefaultHttpClient.execute(HttpHost target, HttpRequest method). My
 HttpPoster class looks like

 package com.bt.gcto.android.testhttp;

 import java.io.IOException;
 import java.util.Hashtable;

 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.params.ConnRoutePNames;
 import org.apache.http.conn.scheme.PlainSocketFactory;
 import org.apache.http.conn.scheme.Scheme;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.conn.scheme.SocketFactory;
 import org.apache.http.conn.ssl.SSLSocketFactory;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.util.EntityUtils;

 import android.net.Uri;
 import android.util.Log;

 public class HttpPoster {
        private final String TAG=HttpPoster;
            private final String NETWORK_DEVICE_SIDE_TRUE =
 ;deviceside=true;
            private final String NETWORK_DEVICE_SIDE_FALSE =
 ;deviceside=false;
            private final String NETWORK_WIFI = ;interface=wifi;
            //private final String proxy=proxy.intra.bt.com:8080;
            private boolean useWifi;
            private boolean deviceSide;
            // Apache HttpClient 4.x stuff
            private static HttpParams defaultParameters = null;
            private static SchemeRegistry supportedSchemes = null;

            /**
              * Performs general setup.
              * This should be called only once.
              */
             private final static void setup() {

                 supportedSchemes = new SchemeRegistry();

                 // Register the http and https protocol schemes, they are
                 // required by the default operator to look up socket
 factories.
                 SocketFactory sf = PlainSocketFactory.getSocketFactory();
                 supportedSchemes.register(new Scheme(http, sf, 80));
                 sf = SSLSocketFactory.getSocketFactory();
                 supportedSchemes.register(new Scheme(https, sf, 80));

                 // prepare parameters
                 HttpParams params = new BasicHttpParams();
                 HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
                 HttpProtocolParams.setContentCharset(params, UTF-8);
                 HttpProtocolParams.setUseExpectContinue(params, true);
                 defaultParameters = params;

             } // setup

             private final static HttpParams getParams() {
                 return defaultParameters;
             }

            HttpPoster(boolean deviceSide, boolean useWifi) {
                this.useWifi = useWifi;
                this.deviceSide = deviceSide;
                System.err.println(HttpPoster::HttpPoster);
            }

            public String post(String url,
                                                 HashtableString,String 
 headerProperties, byte[] bytes )
               throws IOException {
                     HttpClient client = null;
                     HttpPost method=null;
                 //InputStream is = null;
                 //OutputStream os = null;
                 //String response = ;
                 HttpResponse rsp = null;
                 HttpEntity entity=null;
                 String fullUrl;
                 //int rc;

                 Log.d(TAG,post() ---ENTER---);
                 Log.d(TAG,HttpPoster::post);
                 Log.d(TAG,http.proxyHost =  +
 System.getProperty(http.proxyHost));
                 Log.d(TAG,http.proxyPort =  +
 System.getProperty(http.proxyPort));
                 try {
                     fullUrl = url + (deviceSide ? NETWORK_DEVICE_SIDE_TRUE :
 NETWORK_DEVICE_SIDE_FALSE)
                      + (useWifi ? NETWORK_WIFI : );
                     Uri fullUri = Uri.parse( fullUrl );
                     String targetname = fullUri.getHost();
                     Log.d(TAG,HttpPoster::post -- about to open connection
 on URL =  + fullUrl);
                     //
                     // setup proxy server
                     //
                         final HttpHost target = new HttpHost(targetname, 80,
 http);
                         

[android-developers] Re: Using the Emulator with a Proxy - 0.9 Beta SDK Windows Eclipse 3.4

2008-08-22 Thread Manish Pandit



On Aug 21, 11:02 pm, shan [EMAIL PROTECTED] wrote:
 Hi Bob,
 I got the browser up. If you have any other versions of the sdk/
 emulator on your system, erase them and then unzip the new sdk. And
 provide the proxy as proxy:port only. Do not use the http://, it
 throws a NumberFormatException.
 The -http-proxy startup option did'nt work but the workaround
 did(using the system table insertion).

 On Aug 21, 4:30 am, Bob [EMAIL PROTECTED] wrote:

  I've tried to use the Emulator with a Proxy using the instructions
  here...

 http://code.google.com/android/reference/emulator.html#proxy

  but have had no success using either of the two options discussed in
  the reference. The 'Browser' application reports...

  Web page not available
  The Web page athttp://www.google.com/mcouldnot be loaded as:
  The connection to the server was unsuccessful.

  I'm using the Windows 0.9 Beta SDK w/Eclipse 3.4.

  Has anyone got this working? Seems like such a basic thing, I
  shouldn't be stumbling on this.

I was able to get it working - I am running Ganymede with 0.9 Beta
Android on Ubuntu 8.04. I selected run-configurations, selected the
config I use for my app, under Target tab there is a section for
additional emulator params. I typed in -http-proxy http://login:[EMAIL 
PROTECTED]:port
without quotes and was able to connect successfully. For some reason,
I had to bounce my Eclipse though...

-cheers,
Manish

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: LocationManager - getLastKnownLocation() - NullPointer Exception

2008-08-22 Thread code_android_festival_way

So I got it working now. I'm using the service thread to get the
location.

And that's the way I did it:

http://paste.pocoo.org/show/b67L69qf5QDNtq1pTzZz/

It works pretty fine. But you should add some timeout to the
condition.await() of the background thread.

Regards!

On 21 Aug., 16:45, code_android_festival_way
[EMAIL PROTECTED] wrote:
 The LocationManager.request*Updates methods must be called from a
 Looper thread, such as the main thread of an Activity. Additional
 method variants have been added that take an explicit Looper argument
 to allow for use outside of a main thread.

 This could be the solution for my problem. Now I have to understand
 what that means for me. If someone knows the solution I'm looking
 forward reading it. :-)

 Regards!

 On 21 Aug., 15:50, code_android_festival_way

 [EMAIL PROTECTED] wrote:
  Thank you for your response. I will try handling this in a different
  way now. If I'm struggling I will come back to your offer. :-)

  Regards!

  On 21 Aug., 15:38, Mark Murphy [EMAIL PROTECTED] wrote:

   code_android_festival_way wrote:
In M5 I only called getCurrentLocation() and everything was fine.
Now as the methode is gone I need to set this update request to the
LocationManager in order to get a not outdatet position. To achieve
that I have to loop inside my geo location class and wait for the
Listener to be invoked in order to be able to return some location
from the geo location class.

   Off the cuff, I suspect you will need to have whatever code uses
   GeoProvider switch to supporting asynchronous delivery of location data.
   It may no longer be possible to synchronously get your current position.

   But, I won't be diving into the new mapping code until this weekend at
   the earliest, so I can't comment on how better to handle your situation
   until then.

   If you're still struggling come Monday, send me an email to remind me to
   post something.

   --
   Mark Murphy (a Commons Guy)http://commonsware.com
   Warescription: All titles, revisions,  ebook formats, just $35/year


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding content to a tab view dynamically

2008-08-22 Thread Teo
Ok, great, thanks for the help! Here's the relevant code from the XML:

*LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
TabHost android:id=@+id/tabhost
android:layout_width=fill_parent
android:layout_height=fill_parent
TabWidget android:id=@android:id/tabs
android:layout_width=fill_parent
android:layout_height=wrap_content
/
FrameLayout android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent
android:paddingTop=62px
Button android:id=@+id/buttontab
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=A semi-random button
/
/FrameLayout
/TabHost
/LinearLayout*


And here's how i tried to add something:

*private void addItem(){
CheckBox c=new CheckBox(this);
ArrayListView a=new ArrayListView();
a.add(c);
tabs.getCurrentView().addTouchables(a);
}*

*tabs* is the TabHost object.

Did i get it wrong with the *addTouchables*? I couldn't find any better
method. Also, instead of *getCurrentView* i tried *getCurrentTabView* and i
also tried a lot of casts applied to children and children of children and i
couldn't get an effect.

(I know the function above is called when it should be - i confirmed it
during debug..)

Thanks,
Teo

On Fri, Aug 22, 2008 at 12:06 AM, Josh Guilfoyle [EMAIL PROTECTED] wrote:


 Actually my mistake.  getCurrentTabView might just get the view of the
 tab you have selected (not the contents of the tab).  Try
 getCurrentView.  Post sample code if you can't get it working and I
 will explore further.

 On Aug 21, 2:04 pm, Josh Guilfoyle [EMAIL PROTECTED] wrote:
  Do you mean to add a new tab or simply dynamically adjust the View
  hierarchy in a particular tab?  If so, getCurrentTabView will work to
  do what you need.  Just modify the view hierarchy found there.  Do
  realize that you are getting the root-level View of the tab, so you
  must search within that using View#findViewById to locate the actual
  view you're looking to modify.
 
  On Aug 21, 11:28 am, Teo [EMAIL PROTECTED] wrote:
 
   Hi,
 
   i tried debugging quite a bit, but i can't figure it out; is it
   possible to add something (buttons, etc.) to a tab? I'm using a
   FrameLayout inside a TabWidget inside a TabHost. I tried lots of
   things, including adding to TabHost's getCurrentTabView, but i wasn't
   lucky.
 
   Any tips?
 
   Thanks,
   Teo
 



-- 
Teo (a.k.a. Teodor Filimon, Teominator)
Site - www.teodorfilimon.com | Blog - www.teodorfilimon.blogspot.com
GMT +2 (or PDT +10)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: maps behind proxy 0.9 beta

2008-08-22 Thread shan

Hi Jokochi

I am using a Windows machine, do i need to setup something to execute
the script?
Also my proxy port no is 8080, i could make out that you were routing
to 8080 but mine already runs on the same.
I tried to execute it on IE7 but it returned an open-save dialog which
keeps looping.
I got the browser up but the maps won't respond.
Thanks for the script.

Any solutions.

On Aug 22, 11:04 am, shan [EMAIL PROTECTED] wrote:
 Hi Justin

 Now the browser works in the emulator but not the maps.
 Any suggestions to get the maps going.

 On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:



  Does the browser work in the emulator for you? The emulator doesn't
  deal well with being behind a proxy and my guess would be that you
  aren't able to use any data at all.

  Cheers,
  Justin
  Android Team @ Google

  On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote:

   Can the maps API  work behind proxy in the 0.9 beta?- 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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multipart Messages - Is there an example how to get them work now. (Uploading to a web API)

2008-08-22 Thread code_android_festival_way

Hello!

I have done it the following way:

http://paste.pocoo.org/show/GwHe8LrG9DCnq4zuphmK/

(note that this is just a sample code the HttpClient needs some
setup)

Using it this way multipart messages work quite fine.

Regards!

On 22 Aug., 07:16, shotwave [EMAIL PROTECTED] wrote:
 I also have problems with multipart entities, so I have followed the
 recomendations given here and added mime4j and httpmime as the
 libraries to my eclipse project, however once I have started the app
 and tried to upload some data I have got an exception

 08-22 01:11:12.672: WARN/dalvikvm(229): VFY: unable to resolve new-
 instance 255 (Lorg/apache/commons/io/output/ByteArrayOutputStream;) in
 Lorg/apache/http/entity/mime/HttpMultipart;
 08-22 01:11:12.682: WARN/dalvikvm(229): VFY:  rejecting opcode 0x22 at
 0x0031
 08-22 01:11:12.692: WARN/dalvikvm(229): VFY:  rejected Lorg/apache/
 http/entity/mime/HttpMultipart;.getTotalLength ()J
 08-22 01:11:12.692: WARN/dalvikvm(229): Verifier rejected class Lorg/
 apache/http/entity/mime/HttpMultipart;
 08-22 01:11:12.722: WARN/System.err(229): java.lang.VerifyError:
 org.apache.http.entity.mime.HttpMultipart
 08-22 01:11:12.782: WARN/System.err(229):     at
 org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
 76)
 08-22 01:11:12.852: WARN/System.err(229):     at
 org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
 99)
 08-22 01:11:12.862: WARN/System.err(229):     at
 com.sphericbox.jigsaw.LoginActivity
 $YesClickListener.onClick(LoginActivity.java:78)
 08-22 01:11:12.862: WARN/System.err(229):     at
 android.view.View.performClick(View.java:2068)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.View.onTouchEvent(View.java:3453)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.widget.TextView.onTouchEvent(TextView.java:4347)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.View.dispatchTouchEvent(View.java:3108)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.872: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.902: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.902: WARN/System.err(229):     at
 android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
 08-22 01:11:12.912: WARN/System.err(229):     at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.superDispatchTouchEvent(PhoneWindow.java:1552)
 08-22 01:11:12.912: WARN/System.err(229):     at
 com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
 1059)
 08-22 01:11:12.932: WARN/System.err(229):     at
 android.app.Activity.dispatchTouchEvent(Activity.java:1872)
 08-22 01:11:12.932: WARN/System.err(229):     at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.dispatchTouchEvent(PhoneWindow.java:1536)
 08-22 01:11:12.932: WARN/System.err(229):     at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1088)
 08-22 01:11:12.932: WARN/System.err(229):     at
 android.os.Handler.dispatchMessage(Handler.java:88)
 08-22 01:11:12.932: WARN/System.err(229):     at
 android.os.Looper.loop(Looper.java:123)
 08-22 01:11:12.932: WARN/System.err(229):     at
 android.app.ActivityThread.main(ActivityThread.java:3708)
 08-22 01:11:12.962: WARN/System.err(229):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 08-22 01:11:12.972: WARN/System.err(229):     at
 java.lang.reflect.Method.invoke(Method.java:492)
 08-22 01:11:12.972: WARN/System.err(229):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:734)
 08-22 01:11:12.972: WARN/System.err(229):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
 08-22 01:11:12.972: WARN/System.err(229):     at
 dalvik.system.NativeStart.main(Native Method)

 could you pls help me with that?

 On Aug 18, 8:11 pm, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:

  Looks like you also need the Apache Commons IO library which you can
  get fromhttp://commons.apache.org/io/.

  Cheers,
  Justin
  Android Team @ Google

  On Aug 18, 3:19 pm, code_android_festival_way

  [EMAIL PROTECTED] wrote:
   So I'm back with a question. I've imported the libraries mentioned
   above and got the following setup:

  http://paste.pocoo.org/show/82631/

   Now I get an error while executing the POST method with the
   HttpClient. Am I doing sth. wrong or what do I have to change to get
   it working. (the paste above is cutted down to the most important
   parts)

   The error message:

   Error in org.apache.commons.io.ouput.ByteArrayOutputStream

   I'm looking forward getting some answers.

   Regards!


[android-developers] Re: Trouble with 0.9 beta and MapActivity

2008-08-22 Thread woodm

I was having this same problem yesterday but managed to solve it.

It's just a case of fixing your AndroidManifest.xml file. It needs to
use the correct permissions and contain a uses-library
android:name=com.google.android.maps / tag.

This post:
http://groups.google.com/group/android-developers/browse_thread/thread/74b47e1e11067865/cc22e133ff88a0a5?lnk=gstq=problem+with+map+view#cc22e133ff88a0a5

was a great help to me, and shows the permissions you need to use.

On Aug 22, 6:45 am, Casey Borders [EMAIL PROTECTED] wrote:
 I have and application that was running fine under m5, but it fails in
 0.9.  I tried to nail down what was causing it to fail and I have an
 extremely simple MapActivity that is failing too.  Here's the code:

 package org.moo.android.Test;

 import com.google.android.maps.MapActivity;
 import com.google.android.maps.MapView;

 import android.os.Bundle;
 import android.view.Window;

 public class MapTest extends MapActivity
 {
 private MapView mMap;

 @Override
 public void onCreate(Bundle icicle)
 {
 super.onCreate(icicle);
 requestWindowFeature(Window.FEATURE_NO_TITLE);

 mMap = new MapView(this, MapAPIKey);
 setContentView(mMap);

 }

 @Override
 protected boolean isRouteDisplayed()
 {
 return false;
 }

 }

 Here's the logcat output:

 08-22 05:36:30.274: WARN/dalvikvm(263): Unable to resolve superclass
 of Lorg/moo/android/Test/MapTest; (4)
 08-22 05:36:30.284: WARN/dalvikvm(263): Link of class
 'Lorg/moo/android/Test/MapTest;' failed
 08-22 05:36:30.294: DEBUG/AndroidRuntime(263): Shutting down VM
 08-22 05:36:30.304: WARN/dalvikvm(263): threadid=3: thread exiting
 with uncaught exception (group=0x40010e28)
 08-22 05:36:30.304: ERROR/AndroidRuntime(263): Uncaught handler:
 thread main exiting due to uncaught exception
 08-22 05:36:30.334: ERROR/AndroidRuntime(263):
 java.lang.RuntimeException: Unable to instantiate activity
 ComponentInfo{org.moo.android.Test/org.moo.android.Test.MapTest}:
 java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in
 loader [EMAIL PROTECTED]
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2060)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2147)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.access$1800(ActivityThread.java:112)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.os.Handler.dispatchMessage(Handler.java:88)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.os.Looper.loop(Looper.java:123)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.main(ActivityThread.java:3708)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.reflect.Method.invokeNative(Native Method)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.reflect.Method.invoke(Method.java:492)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 dalvik.system.NativeStart.main(Native Method)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): Caused by:
 java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in
 loader [EMAIL PROTECTED]
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 dalvik.system.PathClassLoader.findClass(PathClassLoader.java:215)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.ClassLoader.loadClass(ClassLoader.java:453)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.ClassLoader.loadClass(ClassLoader.java:421)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.Instrumentation.newActivity(Instrumentation.java:1095)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): ... 11 more
 08-22 05:36:30.364: INFO/Process(51): Sending signal. PID: 263 SIG: 3
 08-22 05:36:30.404: INFO/dalvikvm(263): threadid=7: reacting to signal 3
 08-22 05:36:30.464: INFO/dalvikvm(263): Wrote stack trace to
 '/data/anr/traces.txt'
 08-22 05:36:35.364: DEBUG/dalvikvm(93): GC freed 1197 objects / 58416
 bytes in 198ms
 08-22 05:36:35.364: DEBUG/dalvikvm(124): GC freed 3 objects / 72 bytes in 
 185ms

 What's going wrong here?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To 

[android-developers] Re: Trouble with 0.9 beta and MapActivity

2008-08-22 Thread Casey Borders

That did it!!  Thank you!!

On Fri, Aug 22, 2008 at 3:05 AM, woodm [EMAIL PROTECTED] wrote:

 I was having this same problem yesterday but managed to solve it.

 It's just a case of fixing your AndroidManifest.xml file. It needs to
 use the correct permissions and contain a uses-library
 android:name=com.google.android.maps / tag.

 This post:
 http://groups.google.com/group/android-developers/browse_thread/thread/74b47e1e11067865/cc22e133ff88a0a5?lnk=gstq=problem+with+map+view#cc22e133ff88a0a5

 was a great help to me, and shows the permissions you need to use.

 On Aug 22, 6:45 am, Casey Borders [EMAIL PROTECTED] wrote:
 I have and application that was running fine under m5, but it fails in
 0.9.  I tried to nail down what was causing it to fail and I have an
 extremely simple MapActivity that is failing too.  Here's the code:

 package org.moo.android.Test;

 import com.google.android.maps.MapActivity;
 import com.google.android.maps.MapView;

 import android.os.Bundle;
 import android.view.Window;

 public class MapTest extends MapActivity
 {
 private MapView mMap;

 @Override
 public void onCreate(Bundle icicle)
 {
 super.onCreate(icicle);
 requestWindowFeature(Window.FEATURE_NO_TITLE);

 mMap = new MapView(this, MapAPIKey);
 setContentView(mMap);

 }

 @Override
 protected boolean isRouteDisplayed()
 {
 return false;
 }

 }

 Here's the logcat output:

 08-22 05:36:30.274: WARN/dalvikvm(263): Unable to resolve superclass
 of Lorg/moo/android/Test/MapTest; (4)
 08-22 05:36:30.284: WARN/dalvikvm(263): Link of class
 'Lorg/moo/android/Test/MapTest;' failed
 08-22 05:36:30.294: DEBUG/AndroidRuntime(263): Shutting down VM
 08-22 05:36:30.304: WARN/dalvikvm(263): threadid=3: thread exiting
 with uncaught exception (group=0x40010e28)
 08-22 05:36:30.304: ERROR/AndroidRuntime(263): Uncaught handler:
 thread main exiting due to uncaught exception
 08-22 05:36:30.334: ERROR/AndroidRuntime(263):
 java.lang.RuntimeException: Unable to instantiate activity
 ComponentInfo{org.moo.android.Test/org.moo.android.Test.MapTest}:
 java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in
 loader [EMAIL PROTECTED]
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2060)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2147)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.access$1800(ActivityThread.java:112)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.os.Handler.dispatchMessage(Handler.java:88)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.os.Looper.loop(Looper.java:123)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.main(ActivityThread.java:3708)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.reflect.Method.invokeNative(Native Method)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.reflect.Method.invoke(Method.java:492)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 dalvik.system.NativeStart.main(Native Method)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): Caused by:
 java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in
 loader [EMAIL PROTECTED]
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 dalvik.system.PathClassLoader.findClass(PathClassLoader.java:215)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.ClassLoader.loadClass(ClassLoader.java:453)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 java.lang.ClassLoader.loadClass(ClassLoader.java:421)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.Instrumentation.newActivity(Instrumentation.java:1095)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
 08-22 05:36:30.334: ERROR/AndroidRuntime(263): ... 11 more
 08-22 05:36:30.364: INFO/Process(51): Sending signal. PID: 263 SIG: 3
 08-22 05:36:30.404: INFO/dalvikvm(263): threadid=7: reacting to signal 3
 08-22 05:36:30.464: INFO/dalvikvm(263): Wrote stack trace to
 '/data/anr/traces.txt'
 08-22 05:36:35.364: DEBUG/dalvikvm(93): GC freed 1197 objects / 58416
 bytes in 198ms
 08-22 05:36:35.364: DEBUG/dalvikvm(124): GC freed 3 objects / 72 bytes in 
 185ms

 What's going wrong here?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups 

[android-developers] Re: no certificates at entry res/drawable/icon.png; when run my application (sdk 0.9)

2008-08-22 Thread Wesley
hi Xav,

I not really familiar with jarsigner and keytool thing...

this is what I did...
1. as u said I export unsigning apk, then I use the apk on this two
command...
2. keytool -genkey -dname cn=Wesley, ou=Wesley Soft, o=BJSG, c=MY -alias
android -keypass and123 -keystore c:\mystore -storepass abc123 -validity 365

jarsigner -keystore C:\mystore -storepass abc123 -keypass and123 -signedjar
AndroidSubmarine.jar AndroidSubmarine.apk android

3. I try to install... using adb...

adb -s emulator-5554 install -r AndroidSubmarine.apk
1522 KB/s (0 bytes in 414131.000s)
pkg: /data/local/tmp/AndroidSubmarine.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

it return this error... can u help me???

Thanks for your times...
have a nice day...



Wesley...


On Fri, Aug 22, 2008 at 2:24 PM, Xavier Ducrohet [EMAIL PROTECTED] wrote:

 If you use the 0.7.1 plugin then it will automatically use a debug
 key/certificate to sign application when building.

 When you release your application you will need to export it from Eclipse
 (see the overview page of the manifest editor, it'll create an unsigned
 package), and then manually sign it with your personnal certificate, using
 jarsigner.

 Xav


 On Thu, Aug 21, 2008 at 10:52 PM, Wesley [EMAIL PROTECTED] wrote:

 hi Xav,

 oic...

 thanks for the reply...

 is there means sdk 0.9 need to sign application manually??? I use eclipse
 to create project it can install and run, but when I develop use the project
 and adding image to res and so on... it has this problem... means I need to
 manually signing the apk with some sort of key???

 how to signing apk???
 can u show me???


 thanks...
 have a nice day...


 Wesley.

 On Fri, Aug 22, 2008 at 12:36 PM, Xavier Ducrohet [EMAIL PROTECTED] wrote:

 You are attempting to install an application that is not signed.

 If use ant, you will need to have activityCreator regenerate a new
 build.xml file that contains the proper steps for building/signing your
 application.

 More information here:
 http://code.google.com/android/intro/develop-and-debug.html#signing

 Xav

 On Thu, Aug 21, 2008 at 9:22 PM, Wesley Sagittarius [EMAIL 
 PROTECTED]wrote:


 I trying the SDK 0.9... my previous application is for m5 one..

 I got this error when I wanna to run my application...
 may I know any one what is that means??? and solution would be???


 08-22 04:13:41.732: ERROR/PackageParser(46): Package
 com.google.testing has no certificates at entry res/drawable/icon.png;
 ignoring!




 Wesley.










 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Socket exception-unknown error from HttpClient execute() method

2008-08-22 Thread Graeme

hi sacoskun

Thanks for your suggestion. Yes I had not set the INTERNET permission
in my
AndroidManifest.xml. I have updated that now and the socket exception
has changed
to being about being unable to resolve the domain name of a http proxy
server
I am located behind. I have noticed other threads where http-proxy
usage has been
problematic.

Thanks for your tip.
Best Regards
Graeme

On Aug 22, 7:30 am, sacoskun [EMAIL PROTECTED] wrote:
 Did you add uses-permission
 android:name=android.permission.INTERNET / tag to your
 AndroidManifest.xml?
 The new SDK requires that permission for network calls.

 sacoskun

 On Aug 21, 6:13 pm, Graeme [EMAIL PROTECTED] wrote:



  Hi everyone

  I'm trying to figure out how to use HttpClient 4.x to do POST requests
  routed via
  a Proxy server. I'm seeing a socket exception triggered by calling

  DefaultHttpClient.execute(HttpHost target, HttpRequest method). My
  HttpPoster class looks like

  package com.bt.gcto.android.testhttp;

  import java.io.IOException;
  import java.util.Hashtable;

  import org.apache.http.Header;
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpHost;
  import org.apache.http.HttpResponse;
  import org.apache.http.HttpVersion;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.conn.ClientConnectionManager;
  import org.apache.http.conn.params.ConnRoutePNames;
  import org.apache.http.conn.scheme.PlainSocketFactory;
  import org.apache.http.conn.scheme.Scheme;
  import org.apache.http.conn.scheme.SchemeRegistry;
  import org.apache.http.conn.scheme.SocketFactory;
  import org.apache.http.conn.ssl.SSLSocketFactory;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
  import org.apache.http.params.BasicHttpParams;
  import org.apache.http.params.HttpParams;
  import org.apache.http.params.HttpProtocolParams;
  import org.apache.http.util.EntityUtils;

  import android.net.Uri;
  import android.util.Log;

  public class HttpPoster {
         private final String TAG=HttpPoster;
             private final String NETWORK_DEVICE_SIDE_TRUE =
  ;deviceside=true;
             private final String NETWORK_DEVICE_SIDE_FALSE =
  ;deviceside=false;
             private final String NETWORK_WIFI = ;interface=wifi;
             //private final String proxy=proxy.intra.bt.com:8080;
             private boolean useWifi;
             private boolean deviceSide;
             // Apache HttpClient 4.x stuff
             private static HttpParams defaultParameters = null;
             private static SchemeRegistry supportedSchemes = null;

             /**
               * Performs general setup.
               * This should be called only once.
               */
              private final static void setup() {

                  supportedSchemes = new SchemeRegistry();

                  // Register the http and https protocol schemes, they 
  are
                  // required by the default operator to look up socket
  factories.
                  SocketFactory sf = PlainSocketFactory.getSocketFactory();
                  supportedSchemes.register(new Scheme(http, sf, 80));
                  sf = SSLSocketFactory.getSocketFactory();
                  supportedSchemes.register(new Scheme(https, sf, 80));

                  // prepare parameters
                  HttpParams params = new BasicHttpParams();
                  HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
                  HttpProtocolParams.setContentCharset(params, UTF-8);
                  HttpProtocolParams.setUseExpectContinue(params, true);
                  defaultParameters = params;

              } // setup

              private final static HttpParams getParams() {
                  return defaultParameters;
              }

             HttpPoster(boolean deviceSide, boolean useWifi) {
                 this.useWifi = useWifi;
                 this.deviceSide = deviceSide;
                 System.err.println(HttpPoster::HttpPoster);
             }

             public String post(String url,
                                                  HashtableString,String 
  headerProperties, byte[] bytes )
                throws IOException {
                      HttpClient client = null;
                      HttpPost method=null;
                  //InputStream is = null;
                  //OutputStream os = null;
                  //String response = ;
                  HttpResponse rsp = null;
                  HttpEntity entity=null;
                  String fullUrl;
                  //int rc;

                  Log.d(TAG,post() ---ENTER---);
                  Log.d(TAG,HttpPoster::post);
                  Log.d(TAG,http.proxyHost =  +
  System.getProperty(http.proxyHost));
                  Log.d(TAG,http.proxyPort =  +
  System.getProperty(http.proxyPort));
                  try {
                      fullUrl = 

[android-developers] How to compile android emulator on windows platform?

2008-08-22 Thread Linuxemacs

Dear all,
  Does anyone know how to compile the android emulator with source code 
on windows platform?
  Thanks a lot for your help!

Best Regards!
Jiang Jiang
2008-08-22

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: maps behind proxy 0.9 beta

2008-08-22 Thread shan

Thanks Jokochi, still can't get it same problems. Please update if you
could.
Were you able to display the maps?


On Aug 22, 1:10 pm, jokochi [EMAIL PROTECTED] wrote:
 Hi Shan,

 I am sorry I did not test with windows so I can not answer you so far.
 But at least your PC has to be installed PHP5.

 Regarding port no, only if your site proxy is the same PC which runs
 emurator, you have to change the port no.
 In my example mentioned before,  it is running the PHP script and
 emulator on local pc (xxx.yyy.com).
 The connection is like this
  emulator (xxx.yyy.com:???) - php script (xxx.yyy.com:8080) - proxy
 (aaa.bbb.com:8000) - (Google?)
 Of course you can change the local port and run script on the
 different PC.

 Ahh, I found a bug in my code.
 Please fix this line;
 wrong:
 if (isset($argv[2])  (preg_match(^\d+$, $argv[2])))
 correct:
 if (isset($argv[2])  (preg_match(/^\d+$/, $argv[2])))

 Thank you.

 On 8月22日, 午後3:58, shan [EMAIL PROTECTED] wrote:



  Hi Jokochi

  I am using a Windows machine, do i need to setup something to execute
  the script?
  Also my proxy port no is 8080, i could make out that you were routing
  to 8080 but mine already runs on the same.
  I tried to execute it on IE7 but it returned an open-save dialog which
  keeps looping.
  I got the browser up but the maps won't respond.
  Thanks for the script.

  Any solutions.

  On Aug 22, 11:04 am, shan [EMAIL PROTECTED] wrote:

   Hi Justin

   Now the browser works in the emulator but not the maps.
   Any suggestions to get the maps going.

   On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED]
   wrote:

Does the browser work in the emulator for you? The emulator doesn't
deal well with being behind a proxy and my guess would be that you
aren't able to use any data at all.

Cheers,
Justin
Android Team @ Google

On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote:

 Can the maps API  work behind proxy in the 0.9 beta?- Hide quoted 
 text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] DateUtils.getRelativeTimeSpanString in v0.9

2008-08-22 Thread Guillaume Perrot

In Android SDK v0.9, the DateUtils class has been removed.
Where is the equivalent to format relative dates ? The function was
getRelativeTimeSpanString, I hope I don't have to code it myself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Drag Drop outside the parent ViewGroup

2008-08-22 Thread Erik Calissendorff

Hi I'm implementing some drag  drop functionality.

I'm currently having two problems:
1) When I drag the View outside of it's parent it's being clipped, I
like to be able to drag the item around the whole window.

2) Z-order, I'm currently bringing the dragged View to the front but
with the same approach when moving over view groups would mean that
the parent ViewGroup would have to be at the front potentially
resulting in distorting the layout of the application.

Question: Is there a way to hand over the drawing of a View to my root
View or even the activity so it can be ensured to be at the front and
move around the whole window? I would prefer not to have to remove the
child and add it into an other ViewGroup during the drag  drop
operation if possible.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: REST + JSON Web Service Client

2008-08-22 Thread Baran

Hi Charun,

thanks for the reply, Everything changed since my last post ..:)

I worked pretty good on android sdk m5 for JSON, and as soon as I got
success in it , here is the new SDK with quite a few changes in it.

Now I am stuck with the things...

Please visit for the details and take a look at the things...
http://groups.google.co.in/group/android-developers/browse_thread/thread/27a46468c1b68070#



On Aug 21, 12:18 pm, cbraun75 [EMAIL PROTECTED] wrote:
 Yes the Yelp.com offer a API withJSON response (http://www.yelp.com/
 developers)

 Cu

 Christian

 On 21 Aug., 07:12, Baran [EMAIL PROTECTED] wrote:

  Anyone having any test web service link that provide response inJSON
  format. Need one to test the clinet.

  On Aug 21, 10:00 am, Baran [EMAIL PROTECTED] wrote:

   Hi,

   Thanks for the reply, actually I was confused with how we can use
  JSON. I suppose this is for manipulating the response we get after a
   successful web service request. Please correct me if I am wrong. Still
   new to this thing.

   On Aug 20, 7:00 pm, Mark Murphy [EMAIL PROTECTED] wrote:

Baran wrote:
 Hi,

 I need to access a .Net web service in Rest format usingJSON. I m
 pretty new to this concept and very much confused about how this
 works

 Any one who can give an overview of the two. I need the steps that I
 need to follow to useJSON. Right now my doubt is how to useJSONto
 grab to output. Lets say we create a http client and it get the
 respone now what?

 How can we use theJSONobject to manipulate the response...

There is aJSONparser built into Android:

   http://code.google.com/android/reference/org/json/package-summary.html

And there is an HTTP client built into Android:

   http://code.google.com/android/reference/org/apache/http/package-summ...

though you may wish to view the HttpClient documentation here:

   http://hc.apache.org/

Both of these are open source projects with their own documentation, on
top of what is in Android. Both are usable in other Java projects
outside of Android.

If you have specific questions regarding the use of one or the other,
particular as it pertains to Android, write back with the details!

--
Mark Murphy (a Commons Guy)http://commonsware.com
Warescription: All titles, revisions,  ebook formats, just $35/year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Instrumentation failing with classnotfound on android.test.InstrumentationTestRunner

2008-08-22 Thread Carl H.

Hello,

I am trying to follow the post on ApplicationInstrumentation:
http://code.google.com/android/samples/ApiDemos/tests/src/com/android/samples/AllTests.html
http://code.google.com/android/samples/ApiDemos/tests/src/com/android/samples/ApiDemosApplicationTests.html

My setup is very similar then the example. I have the following in my
manifest:
instrumentation xmlns:android=http://schemas.android.com/apk/res/
android
android:targetPackage=com.novoda.runbuddy
android:name=android.test.InstrumentationTestRunner
android:label=testInst /

And I start the instrumentation like this:
 adb shell am instrument -e class com.android.samples.AllTests -w
com.novoda.runbuddy/android.test.InstrumentationTestRunner

I get the following error message:
INSTRUMENTATION_RESULT: shortMsg=Unable to instantiate instrumentation
ComponentInfo{com.novoda.runbuddy/
android.test.InstrumentationTestRunner}:
java.lang.ClassNotFoundException:
android.test.InstrumentationTestRunner in loader
[EMAIL PROTECTED]
INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to
instantiate instrumentation ComponentInfo{com.novoda.runbuddy/
android.test.InstrumentationTestRunner}:
java.lang.ClassNotFoundException:
android.test.InstrumentationTestRunner in loader
[EMAIL PROTECTED]
INSTRUMENTATION_CODE: 0


I tried different combination and can not make the above work. The
documentation is sparse so I am not sure where I am going wrong. Why
would I get a class not found on android.test? There is no need for
permission from what I take with the new SDK.

Any ideas?
./Acsia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to display a local file in the browser?

2008-08-22 Thread [EMAIL PROTECTED]

I already done that but there's another limit: data rendered via
loadData are not able to load remote resources (img
src=http://...;).

On 21 Ago, 22:21, Megha Joshi [EMAIL PROTECTED] wrote:
 On Wed, Aug 20, 2008 at 4:46 PM, Megha Joshi [EMAIL PROTECTED] wrote:
  For security reasons, WebView does not allow file: access any more.

  If you want the link to be loaded in your activity, you should provide a
  WebViewClient and implement shouldOverrideUrlLoading with { return false; }

 This option does not work anymore, sorry for the confusion!

 So the only way to load local file contents into WebView, is as Gil pointed
 out ...by loading the contents with loadData()/

 Sample code:
  static final int MAXFILESIZE = 8096;
  String path = uri.getPath();
         File f = new File(path);
         final long length = f.length();
         if (!f.exists() || length  MAXFILESIZE) {
             return;
         }

         // typecast to int is safe as long as MAXFILESIZE  MAXINT
         byte[] array = new byte[(int)length];

         try {
             InputStream is = new FileInputStream(f);
             is.read(array);
             is.close();
         } catch (FileNotFoundException ex) {
             // Checked for file existance already, so this should not happen
             return;
         } catch (IOException ex) {
             // read or close failed
             Log.e(LOGTAG, Failed to access file:  + path, ex);
             return;
         }
         mWebView.loadData(new String(array), mimeType, null);

 There is a 8KB limit on the file size. So if your data is more that 8KB, you
 should create a content provider
 for your files and then the use the ContentResolver.openContentURI()...



  On Wed, Aug 20, 2008 at 4:34 PM, [EMAIL PROTECTED] 
  [EMAIL PROTECTED] wrote:

  I used WebView to display rich content emails (I'm writing a mail
  client). It worked well loading URI such as
  file://sdcard/filewhateveryouwant.xxx
  ...
  Now I upgraded to 0.9 and Android OS is displaying me a page with The
  requested file was not found.

  Maybe a PERMISSION issue?

  On 19 Ago, 20:36, Megha Joshi [EMAIL PROTECTED] wrote:
   Browser does not support viewing local files...

   On Tue, Aug 19, 2008 at 12:38 AM, Peli [EMAIL PROTECTED] wrote:

Is it possible to open a local file in the browser?

In the Android browser, I tried menu / go to:
file:///sdcard/test.html

I always receive the error message:
Web page not available.
The web page at file:///sdcard/test.html could not be loaded as:
The requested file was not found.

even though the files exist in /sdcard/test.html.
Do I have to use a different URL, or put files into a different
folder?

Peli

PS: From within an application, there seems to be a way to load local
files:

The prefix file:///android_asset/ will cause WebView to load
content from the current application's assets folder.
   http://code.google.com/android/reference/android/webkit/WebView.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] More camera misery with SDK 0.9 beta

2008-08-22 Thread blindfold

I am trying to acquire camera preview images through
onPreviewFrame(byte[] data, Camera c)  and, within this callback
function, BitmapFactory.decodeByteArray(data, 0, data.length). The
callback works and does get called as shown by my debug output.
However, the Eclipse log file  shows error messages tagged by
CameraHardwareStub stating that only yuv422sp preview is  supported,
e.g., if I apply setPreviewFormat() to set PixelFormat.RGB_565 or
PixelFormat.JPEG. BitmapFactory.decodeByteArray indeed returns null as
expected under this pixel format restriction.

Now I do not find support for something like PixelFormat.YUV_422_SP
for use with  BitmapFactory.decodeByteArray. There is
PixelFormat.YCbCr_422_SP, but with that,
BitmapFactory.decodeByteArray(data, 0, data.length) still returns
null. What's wrong? Is  Android lacking a set of compatible image
formats across the various Camera and Bitmap APIs? That would be bad.

Moreover, data.length in the callback is twice the number of pixels,
implying a 16 bits per  pixel encoding, while yuv422sp would seem to
be an 8 bit encoding?

So what should be done here to decode preview images into a Bitmap for
further image  processing? Or is there an alternative decent way to
map camera preview images into a Bitmap? A working example would help!

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Instrumentation failing with classnotfound on android.test.InstrumentationTestRunner

2008-08-22 Thread Carl H.

Note that the cmd line is:

adb shell am instrument -e class com.novoda.runbuddy.AllTests -w
com.novoda.runbuddy/android.test.InstrumentationTestRunner

and not as previously stated:
 adb shell am instrument -e class com.android.samples.AllTests -w
com.novoda.runbuddy/android.test.InstrumentationTestRunner

The error is still apparent




On Aug 22, 12:18 pm, Carl H. [EMAIL PROTECTED] wrote:
 Hello,

 I am trying to follow the post on 
 ApplicationInstrumentation:http://code.google.com/android/samples/ApiDemos/tests/src/com/android...http://code.google.com/android/samples/ApiDemos/tests/src/com/android...

 My setup is very similar then the example. I have the following in my
 manifest:
         instrumentation xmlns:android=http://schemas.android.com/apk/res/
 android
                 android:targetPackage=com.novoda.runbuddy
 android:name=android.test.InstrumentationTestRunner
                 android:label=testInst /

 And I start the instrumentation like this:
  adb shell am instrument -e class com.android.samples.AllTests -w
 com.novoda.runbuddy/android.test.InstrumentationTestRunner

 I get the following error message:
 INSTRUMENTATION_RESULT: shortMsg=Unable to instantiate instrumentation
 ComponentInfo{com.novoda.runbuddy/
 android.test.InstrumentationTestRunner}:
 java.lang.ClassNotFoundException:
 android.test.InstrumentationTestRunner in loader
 [EMAIL PROTECTED]
 INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to
 instantiate instrumentation ComponentInfo{com.novoda.runbuddy/
 android.test.InstrumentationTestRunner}:
 java.lang.ClassNotFoundException:
 android.test.InstrumentationTestRunner in loader
 [EMAIL PROTECTED]
 INSTRUMENTATION_CODE: 0

 I tried different combination and can not make the above work. The
 documentation is sparse so I am not sure where I am going wrong. Why
 would I get a class not found on android.test? There is no need for
 permission from what I take with the new SDK.

 Any ideas?
 ./Acsia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Remote 3GP video in 0.9 SDK

2008-08-22 Thread snowcrash

Hi there,

first of all, an extra big THANK YOU to Justin, Megha, and all other
Google folks answering our questions here. This is very highly
appreciated.
To furthermore light up things here, I think some 'hard specs' on the
media formats supported would help a lot. I couldn't find such
information, not in the android-docs here and also not at PacketVideo.
There is only a marketing brochure (http://www.pv.com/resources/
OpenCORE-brochure.pdf) with rather superficial information and no real
specs.
As far as I worked things out, MPEG-4 simple profile 0, 0b, 1 and AVC
baseline, all with AMR-NB and AAC-LC in 3GP and MP4 containers seem to
work. Even some parts of MPEG-4 SP, L3 worked, but it started choking
with [EMAIL PROTECTED] But all this is just poking around. In my opinion, some
clear and 'official' words would help a lot.

Is anything in this respect available?

Cheers and thanks,
snowcrash
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] m5 GetMethod.getResponseBody as String in SDK 0.9

2008-08-22 Thread Baran

Hi,

Any idea about where can I find GetMethod class's
getResonseBodyAsString() method in SDK 0.9.

I need to perform the web service client activity, it was fine in the
m5 but I can't find the method to retrieve web service respone as
string in new SDK.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: m5 GetMethod.getResponseBody as String in SDK 0.9

2008-08-22 Thread Mark Murphy

Baran wrote:
 Any idea about where can I find GetMethod class's
 getResonseBodyAsString() method in SDK 0.9.
 
 I need to perform the web service client activity, it was fine in the
 m5 but I can't find the method to retrieve web service respone as
 string in new SDK.

There is no GetMethod in the Apache HTTP Components, which is what 
Android now uses, replacing the former Jakarta Commons HttpClient.

Admittedly, the HTTP Components documentation leaves a bit to be 
desired, even at their home site (http://hc.apache.org).

You might wish to take a peek at this sample code:

http://tinyurl.com/65qng2

It would appear that the way to get a String representation of the HTTP 
response is via:

EntityUtils.toString(rsp.getEntity())

(where rsp is the HttpResponse you got from execute()).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Why is my e-mail being spammed by this group

2008-08-22 Thread Aaron_Stone
When I set it up for 1 e-mail a day I started getting 100.  I
unsubscribed 
but the spam continues.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] is there a way to install back the SDK m5-rc15 after upgrading into 0.9 beta

2008-08-22 Thread drik_wen

I get a lot problem after upgrading my SDK to 0.9 beta..
I can't launch my program..
is there a way to install back to the SDK m5-rc15??
a lil bit hurry..
thx in advanced..

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] [v0.9 beta] text color won't change for TextView.setEnabled(false)

2008-08-22 Thread samlu

When I called setEnabled(false) for a TextView object on m5-rc15, the
text color will be changed to gray (or dim).

After switching to v0.9, it seems that all view object won't change
color when I call setEnabled(false).

Does anyone know how to fix this problem?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] MapView and Zoom Control in 0.9 SDK

2008-08-22 Thread Cristina

Hi!

I am trying to show the zoom controls over a MapView in the new 0.9
SDK.

I have been able to show the zoom Control View using the following
code
 // Zoom View
View zoomView = mMapView.getZoomControls();
zoomView.setLayoutParams(new ViewGroup.LayoutParams
(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
   mMapView.addView(zoomView);
  mMapView.displayZoomControls(true);

Using this code, I have been able to show the Zoom Control View at the
top-left edge the screen (over the map).
 However, I will want it to be a the bottom of the screen, and I do
not know how to move it to that position.

I have tried to use de ViewGroup method requestChildRectangleOnScreen,
in order to move the zoomView to the position I want, but I have been
not able to make it work.

Can anyone help me with this issue?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Why is my e-mail being spammed by this group

2008-08-22 Thread Justin (Google Employee)

Either you didn't set the setting you thought you did (perhaps you
didn't hit save after changing to digest?) or there was an error
setting it (always possible). The easiest thing to do when this
happens is to go and double check your settings, when I looked at
yours, you were set for email as messages arrive. I've gone ahead and
changed your delivery type to Digest Email. Also I'd like to note
that this wouldn't be spam since the email is unsolicited.

Cheers,
Justin
Android Team @ Google

On Aug 22, 5:37 am, [EMAIL PROTECTED] wrote:
 When I set it up for 1 e-mail a day I started getting 100.  I
 unsubscribed
 but the spam continues.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] [v0.9 beta] SystemClock.setCurrentTimeMillis() failed

2008-08-22 Thread samlu

I am using v0.9 beta SDK and got the following warning when I call
SystemClock.setCurrentTimeMillis()

WARN/SystemClock(1000): Unable to open alarm driver: Permission denied

Does anyone know which permission should be specified?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] alwaysRetainTaskState - Some questions

2008-08-22 Thread code_android_festival_way

I came across the parameter alwaysRetainTaskState at
http://code.google.com/android/reference/android/R.attr.html#alwaysRetainTaskState
and don't really know how to use it the right way. I've got several
activities in my application and want to persist the state of my
activity UI so that the user can press the home button and after
starting my application again he will come back to the last opened
activity.
When I understand the parameter in the right way I think that he
should do what I want. Now I've added the parameter to all activities
in my AndroidManifest but after restarting my application from the
home screen (after pressing the home button in my app) I'm always
getting back to my initial screen.

Here is one sample from my AndroidManifest:

activity android:name=.Preferences
  android:alwaysRetainTaskState=true
/activity

What am I doing wrong? In addition I'd like to ask what state in
detail will be presisted. (the complete UI state?)

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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] v0.9 beta - SystemClock.setCurrentTimeMillis() failed

2008-08-22 Thread samlu

I am using v0.9 beta SDK, got the following warning when I call
SystemClock.setCurrentTimeMillis()

WARN/SystemClock(516): Unable to open alarm driver: Permission denied

Does anyone know which permission should be specified?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with TableLayout

2008-08-22 Thread Kavi

How about telling the TableRows to evenly take the height from the
Table layout. Is that possible?
So, for example in my main.xml, the TableLayout is taking up the whole
screen. And all the table rows height is equal to what they need for
their content.
Thus, their is some extra space left at the bottom of the screen. I
want the rows to spread out so that the whole page is taken. Can that
be done using a TableLayout?


About using a Linearlayout, i have used that but i need to test it
with a TableLayout now. Also, would you have an idea in terns of the
rendering time for both LinearLayout and TableLayout. Which one is
faster and takes up less memory?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: m5 GetMethod.getResponseBody as String in SDK 0.9

2008-08-22 Thread Baran

Thanks buddy,

you are rightthey have removed the classI wasted my time for
nothingthanks again

On Aug 22, 5:49 pm, Mark Murphy [EMAIL PROTECTED] wrote:
 Baran wrote:
  Any idea about where can I find GetMethod class's
  getResonseBodyAsString() method in SDK 0.9.

  I need to perform the web service client activity, it was fine in the
  m5 but I can't find the method to retrieve web service respone as
  string in new SDK.

 There is no GetMethod in the Apache HTTP Components, which is what
 Android now uses, replacing the former Jakarta Commons HttpClient.

 Admittedly, the HTTP Components documentation leaves a bit to be
 desired, even at their home site (http://hc.apache.org).

 You might wish to take a peek at this sample code:

 http://tinyurl.com/65qng2

 It would appear that the way to get a String representation of the HTTP
 response is via:

 EntityUtils.toString(rsp.getEntity())

 (where rsp is the HttpResponse you got from execute()).

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: maps behind proxy 0.9 beta

2008-08-22 Thread jokochi

Yes, I am able to see the map.
After that I checked the script working on Windows.
Have you install PHP5 and run it on command prompt(cmd.exe) ?

Windows PHP can be found here.
http://www.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror

I installed it with default setting.
Please do not forget to turn off the firewall.

On 8月22日, 午後6:43, shan [EMAIL PROTECTED] wrote:
 Thanks Jokochi, still can't get it same problems. Please update if you
 could.
 Were you able to display the maps?

 On Aug 22, 1:10 pm, jokochi [EMAIL PROTECTED] wrote:

  Hi Shan,

  I am sorry I did not test with windows so I can not answer you so far.
  But at least your PC has to be installed PHP5.

  Regarding port no, only if your site proxy is the same PC which runs
  emurator, you have to change the port no.
  In my example mentioned before,  it is running the PHP script and
  emulator on local pc (xxx.yyy.com).
  The connection is like this
   emulator (xxx.yyy.com:???) - php script (xxx.yyy.com:8080) - proxy
  (aaa.bbb.com:8000) - (Google?)
  Of course you can change the local port and run script on the
  different PC.

  Ahh, I found a bug in my code.
  Please fix this line;
  wrong:
  if (isset($argv[2])  (preg_match(^\d+$, $argv[2])))
  correct:
  if (isset($argv[2])  (preg_match(/^\d+$/, $argv[2])))

  Thank you.

  On 8月22日, 午後3:58, shan [EMAIL PROTECTED] wrote:

   Hi Jokochi

   I am using a Windows machine, do i need to setup something to execute
   the script?
   Also my proxy port no is 8080, i could make out that you were routing
   to 8080 but mine already runs on the same.
   I tried to execute it on IE7 but it returned an open-save dialog which
   keeps looping.
   I got the browser up but the maps won't respond.
   Thanks for the script.

   Any solutions.

   On Aug 22, 11:04 am, shan [EMAIL PROTECTED] wrote:

Hi Justin

Now the browser works in the emulator but not the maps.
Any suggestions to get the maps going.

On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED]
wrote:

 Does the browser work in the emulator for you? The emulator doesn't
 deal well with being behind a proxy and my guess would be that you
 aren't able to use any data at all.

 Cheers,
 Justin
 Android Team @ Google

 On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote:

  Can the maps API  work behind proxy in the 0.9 beta?- Hide quoted 
  text -

 - Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] TabHost view

2008-08-22 Thread dai

Hi, is it possible to display icon(jpg, png) within tab? I'd like to
add icon and text(setIndicator(***)) within tab..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: TabHost view

2008-08-22 Thread dai

Ahh, I've found out public TabHost.TabSpec  setIndicator(CharSequence
label, Drawable icon)  of TabHost class..

On 8月22日, 午後11:21, dai [EMAIL PROTECTED] wrote:
 Hi, is it possible to display icon(jpg, png) within tab? I'd like to
 add icon and text(setIndicator(***)) within tab..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread code_android_festival_way

Hello guys!

I'm having the following problem. I'm having an activity that starts a
background thread in order to bind to a service which does some work.
Now I've got the problem that when pressing the back button I get the
following exception:

08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
thread Thread-8 exiting due to uncaught exception
08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
java.lang.IllegalArgumentException: Service not
registered: [EMAIL PROTECTED]

I've done the following in the onPause() method:

this.unbindService(svcConn);
background.interrupt();
background = null;

I don't really know how to stop that thread properly when leaving the
activity. Any help would be appreciated!

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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with TableLayout

2008-08-22 Thread Kavi



On Aug 22, 8:37 am, Kavi [EMAIL PROTECTED] wrote:
 How about telling the TableRows to evenly take the height from the
 Table layout. Is that possible?
 So, for example in my main.xml, the TableLayout is taking up the whole
 screen. And all the table rows height is equal to what they need for
 their content.
 Thus, their is some extra space left at the bottom of the screen. I
 want the rows to spread out so that the whole page is taken. Can that
 be done using a TableLayout?

Ok i found the answer to this one using layout_weight.

 About using a Linearlayout, i have used that but i need to test it
 with a TableLayout now. Also, would you have an idea in terns of the
 rendering time for both LinearLayout and TableLayout. Which one is
 faster and takes up less memory?

This one, i'll still like to know.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Images Cursor Problem

2008-08-22 Thread webmonkey

-Any idea what is causing this? Does the column name actually exist?

No this field does not exist. It is a bug that should be reported.

In the mean time you can simply use:

Cursor cursor = getContentResolver().query( extras.getData(), null,
null, null, null);


On Aug 22, 2:06 am, Gil [EMAIL PROTECTED] wrote:
 My code launches the image picker to select a photo from external
 media. In the onActivityResult I call extra.getData() to obtain the
 image Uri. I know that it is valid because I can obtain a bitmap from
 the Uri. However, when I try to get a cursor for this item for the
 purpose of getting the photo information (description, ...) I get an
 exception:

 Cursor cursor = MediaStore.Images.Media.query( getContentResolver(),
 extras.getData(), null);

 ERROR/AndroidRuntime(1463): Caused by:
 android.database.sqlite.SQLiteException: no such column: name: , while
 compiling: SELECT * FROM images WHERE (_id = 40) ORDER BY name ASC
 ERROR/AndroidRuntime(1463):     at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 143)
 ERROR/AndroidRuntime(1463):     at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 111)
 ERROR/AndroidRuntime(1463):     at
 android.content.ContentProviderProxy.bulkQuery(ContentProviderNative.java:
 259)
 ERROR/AndroidRuntime(1463):     at
 android.content.ContentProviderProxy.query(ContentProviderNative.java:
 278)
 ERROR/AndroidRuntime(1463):     at
 android.content.ContentResolver.query(ContentResolver.java:146)
 ERROR/AndroidRuntime(1463):     at android.provider.MediaStore$Images
 $Media.query(MediaStore.java:186)
 ERROR/AndroidRuntime(1463):     at
 com.multiplefacets.blogger.PostActivity.onActivityResult(PostActivity.java:
 493)
 ERROR/AndroidRuntime(1463):     at
 android.app.Activity.dispatchActivityResult(Activity.java:3413)
 ERROR/AndroidRuntime(1463):     at
 android.app.ActivityThread.deliverResults(ActivityThread.java:2826)

 Any idea what is causing this? Does the column name actually exist?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android JNI

2008-08-22 Thread vol

I'm having trouble building the JNI example at
http://davanum.wordpress.com/2007/12/09/android-invoke-jni-based-methods-bridging-cc-and-java/
.

First up, is it possible to actually do this from windows? Do I have
to do this in a linux environment? I would think that doing this from
windows is possible, but I don't have jdk/include/linux, just jdk/
include/win32, so that's throwing me.

Second, I am at step 6, and am attempting to use arm-none-linux-
gnueabi-gcc.
$ arm-none-linux-gnueabi-gcc  -I/cygdrive/c/Program\ Files/Java/
jdk1.6.0_04/include/ -I/cygdrive/c/Program\ Files/Java/jdk1.6.0_04/
include/win32/  -fpic -c org_apache_NativeAdd.c

In file included from org_apache_NativeAdd.c:1:
org_apache_NativeAdd.h:2:17: error: jni.h: No such file or directory
In file included from org_apache_NativeAdd.c:1:
org_apache_NativeAdd.h:15: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'jlong'
org_apache_NativeAdd.c:3: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'jlong'

Ok. Cygwin + arm-none-linux-gnueabi-gcc didn't want to seem to include
anything like that, so I just flat out copied over the contents, and
it was happy to include them. Unfortunately, it didn't want to build
them, giving me other errors like those seen above.

What do I have set up incorrectly for building JNI?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Mark Murphy

 I'm having the following problem. I'm having an activity that starts a
 background thread in order to bind to a service which does some work.
 Now I've got the problem that when pressing the back button I get the
 following exception:

 08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
 thread Thread-8 exiting due to uncaught exception
 08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
 java.lang.IllegalArgumentException: Service not
 registered: [EMAIL PROTECTED]

 I've done the following in the onPause() method:

 this.unbindService(svcConn);
 background.interrupt();
 background = null;

...the method Thread.interrupt() does not interrupt a running thread.
What the method actually does is to throw an interrupt if the thread is
blocked, so that it exits the blocked state. More precisely, if the thread
is blocked at one of the methods Object.wait, Thread.join, or
Thread.sleep, it receives an InterruptedException, thus terminating the
blocking method prematurely.

(from http://articles.techrepublic.com.com/5100-10878_11-5144546.html)

Lacking most of your source, it's hard to say specifically how to handle
things given your current setup. I prefer to use something out of
java.util.concurrent as a means of indicating to a thread that it should
shut down, though you may be able to get by with just a flag and
Thread#interrupt().

For example, in (*cough*) my book, I have an example service, with
associated activity client, for polling POP3 and IMAP mailboxes for new
messages and displaying a Notification when messages arrive. In that case,
the background thread is in the service, polling the inboxes at a
specified frequency. Of course, that thread needs to end when needed.

The way I set that up was to use a
java.util.concurrent.LinkedBlockingQueue, which the thread monitors for
work. Objects are popped on that queue based on a timer (meaning to go
poll the inboxes) and on shutdown. When a shutdown message arrives, the
service's background thread just falls out the bottom of the
watch-the-queue loop, causing the Thread to terminate on its own.

Even this may not be the best hunk of code -- it's a book sample, not a
heart monitor or nuclear power plant control system -- but I think it's in
the ballpark.

Java Concurrency in Practice (ISBN-10: 0321349601) is well-regarded for
multi-threaded programming and covers the classes in the
java.util.concurrent package.

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-08-22 Thread Manu

Hi Folks,

Trying to insert even in google calendar but with no luck. Any
pointers?

 String [EMAIL PROTECTED];
 String pass=xyz;
  myService.setUserCredentials(name, pass);
  URL postUrl =
new URL(http://www.google.com/calendar/feeds/+name+/private/
full);
  CalendarEventEntry myEntry = new CalendarEventEntry();

  myEntry.setTitle(new PlainTextConstruct(Tennis with Beth));
  myEntry.setContent(new PlainTextConstruct(Meet for a quick
lesson.));

  DateTime startTime =
DateTime.parseDateTime(2008-08-22T15:00:00-08:00);
  DateTime endTime =
DateTime.parseDateTime(2008-08-22T17:00:00-08:00);
  When eventTimes = new When();
  eventTimes.setStartTime(startTime);
  eventTimes.setEndTime(endTime);
  myEntry.addTime(eventTimes);
Thanks
Manu


  // Send the request and receive the response:
  CalendarEventEntry insertedEntry = myService.insert(postUrl,
myEntry);

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Draw graphics with opengl

2008-08-22 Thread Michel

None of the examples compile anymore. The SDK v0.9 has made drastic
changes and I cannot get a single example to even compile out of the
box!

On Aug 7, 8:11 am, Hong [EMAIL PROTECTED] wrote:
 there's an opengl tutorial in android development samples, as well as a
 globaltime sample application from google that you can look into.

 On Thu, Aug 7, 2008 at 12:37 AM, CherryMM [EMAIL PROTECTED] wrote:

  Hi,all:
    I'm an Android  beginner . I want to draw a suquare with opengl,
  but there is nothing in the screen. The code is following:

  public class GLTest2 extends Activity {
     /** Called when the activity is first created. */
    [EMAIL PROTECTED]
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         GLTutorialTwo gv = new GLTutorialTwo(this);
         setContentView(gv);
     }
     protected void onResume()
     {
         super.onResume();
         //android.os.Debug.startMethodTracing(/tmp/trace/
  GLView1.dmtrace,
         //  8 * 1024 * 1024);
     }

    [EMAIL PROTECTED]
         protected void onStop()
     {
         super.onStop();
         //android.os.Debug.stopMethodTracing();
     }
  }

  class GLTutorialTwo extends SurfaceView implements
  SurfaceHolder.Callback{
         private OpenGLContext glContext;
         private SurfaceHolder holder;
         private GL10 gl;

         float[] square = new float[] {  0.25f, 0.25f, 0.0f,

   0.75f, 0.25f, 0.0f,

   0.25f, 0.75f, 0.0f,

   0.75f, 0.75f, 0.0f };
         /*
         byte[] indices = {
                         0,1, 1,2,  2,3,  3,0
         };
         */
         FloatBuffer squareBuff;

         public GLTutorialTwo(Context c) {
                 super(c);
                 holder = getHolder();
                 holder.addCallback(this);

         }

         protected void onDraw(GL10 gl) {

                 gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
                 gl.glColor4f(1,1,1,1);
                 gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
         GLU.gluOrtho2D(gl, 0.0f,1.2f,0.0f,1.0f);
                 gl.glVertexPointer(3, GL10.GL_FLOAT, 0, squareBuff);
         glContext.post();
         }

        [EMAIL PROTECTED]
         public void surfaceChanged(SurfaceHolder holder, int format, int
  width,
                         int height) {
                 // TODO Auto-generated method stub
                 gl.glViewport(0,0,width,height);

         }

        [EMAIL PROTECTED]
         public void surfaceCreated(SurfaceHolder holder) {
                 // TODO Auto-generated method stub

                 glContext = new OpenGLContext(0);
                 glContext.waitNative();
                 glContext.makeCurrent(holder);

                 gl = (GL10)glContext.getGL();
                  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
  GL10.GL_FASTEST);
                 gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
         //      gl.glTranslatef(0,0, -3.0f);

                 gl.glMatrixMode(GL10.GL_PROJECTION);
                 gl.glLoadIdentity();

                 gl.glEnable(GL10.GL_DITHER);
                 gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
                 gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
         gl.glEnable(GL10.GL_CULL_FACE);
         gl.glShadeModel(GL10.GL_SMOOTH);

                 ByteBuffer bb = ByteBuffer.allocateDirect(square.length*4);
                 bb.order(ByteOrder.nativeOrder());
                 squareBuff = bb.asFloatBuffer();
                 squareBuff.put(square);
                 squareBuff.position(0);

         //      gl.glDrawElements(GL10.GL_LINES, 8, GL10.GL_UNSIGNED_BYTE,
  ib);

                 onDraw(gl);
         }

        [EMAIL PROTECTED]
         public void surfaceDestroyed(SurfaceHolder arg0) {
                 // TODO Auto-generated method stub

         }
  }

  Who knows the problem,please tell me,thanks 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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding content to a tab view dynamically

2008-08-22 Thread Josh Guilfoyle

This seems a bit goofed up to me.  First off, the FrameLayout holding
your tabs should initially be empty.  the TabHost will manage filling
it in with the contents of the tab you've selected.

addTouchables is very certainly not what you want.  You want to use
addView() but make sure that the view you get with getCurrentView is
what you expect.  Make one tab have a LinearLayout with android:id=@
+id/foobarbaz, then check that getCurrentView hands you a view for
which findViewById(R.id.foobarbaz) succeeds to find your
LinearLayout.  If not, try getCurrentTabView (there is nod
ocumentation, so we're just stabbing in the dark here).  The other
solution is to better abstract the tab content in question and let the
abstractions manage themselves.  You can do this by separating the
content of each tab into its own Activity and properly isolate them
that way.  When you click some button in Activity A, A can manage
adding views to its layout entirely on its own.

On Aug 21, 11:48 pm, Teo [EMAIL PROTECTED] wrote:
 Ok, great, thanks for the help! Here's the relevant code from the XML:

 *LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:orientation=vertical
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 TabHost android:id=@+id/tabhost
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 TabWidget android:id=@android:id/tabs
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 /
 FrameLayout android:id=@android:id/tabcontent
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:paddingTop=62px
 Button android:id=@+id/buttontab
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:text=A semi-random button
 /
 /FrameLayout
 /TabHost
 /LinearLayout*

 And here's how i tried to add something:

 *private void addItem(){
 CheckBox c=new CheckBox(this);
 ArrayListView a=new ArrayListView();
 a.add(c);
 tabs.getCurrentView().addTouchables(a);
 }*

 *tabs* is the TabHost object.

 Did i get it wrong with the *addTouchables*? I couldn't find any better
 method. Also, instead of *getCurrentView* i tried *getCurrentTabView* and i
 also tried a lot of casts applied to children and children of children and i
 couldn't get an effect.

 (I know the function above is called when it should be - i confirmed it
 during debug..)

 Thanks,
 Teo



 On Fri, Aug 22, 2008 at 12:06 AM, Josh Guilfoyle [EMAIL PROTECTED] wrote:

  Actually my mistake.  getCurrentTabView might just get the view of the
  tab you have selected (not the contents of the tab).  Try
  getCurrentView.  Post sample code if you can't get it working and I
  will explore further.

  On Aug 21, 2:04 pm, Josh Guilfoyle [EMAIL PROTECTED] wrote:
   Do you mean to add a new tab or simply dynamically adjust the View
   hierarchy in a particular tab?  If so, getCurrentTabView will work to
   do what you need.  Just modify the view hierarchy found there.  Do
   realize that you are getting the root-level View of the tab, so you
   must search within that using View#findViewById to locate the actual
   view you're looking to modify.

   On Aug 21, 11:28 am, Teo [EMAIL PROTECTED] wrote:

Hi,

i tried debugging quite a bit, but i can't figure it out; is it
possible to add something (buttons, etc.) to a tab? I'm using a
FrameLayout inside a TabWidget inside a TabHost. I tried lots of
things, including adding to TabHost's getCurrentTabView, but i wasn't
lucky.

Any tips?

Thanks,
Teo

 --
 Teo (a.k.a. Teodor Filimon, Teominator)
 Site -www.teodorfilimon.com| Blog -www.teodorfilimon.blogspot.com
 GMT +2 (or PDT +10)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Draw graphics with opengl

2008-08-22 Thread Justin (Google Employee)

Make sure to clean out the old samples from M5 and use the updated
samples in the new SDK.

Cheers,
Justin
Android Team @ Google

On Aug 22, 9:11 am, Michel [EMAIL PROTECTED] wrote:
 None of the examples compile anymore. The SDK v0.9 has made drastic
 changes and I cannot get a single example to even compile out of the
 box!

 On Aug 7, 8:11 am, Hong [EMAIL PROTECTED] wrote:

  there's an opengl tutorial in android development samples, as well as a
  globaltime sample application from google that you can look into.

  On Thu, Aug 7, 2008 at 12:37 AM, CherryMM [EMAIL PROTECTED] wrote:

   Hi,all:
 I'm an Android  beginner . I want to draw a suquare with opengl,
   but there is nothing in the screen. The code is following:

   public class GLTest2 extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle icicle) {
  super.onCreate(icicle);
  GLTutorialTwo gv = new GLTutorialTwo(this);
  setContentView(gv);
  }
  protected void onResume()
  {
  super.onResume();
  //android.os.Debug.startMethodTracing(/tmp/trace/
   GLView1.dmtrace,
  //  8 * 1024 * 1024);
  }

  @Override
  protected void onStop()
  {
  super.onStop();
  //android.os.Debug.stopMethodTracing();
  }
   }

   class GLTutorialTwo extends SurfaceView implements
   SurfaceHolder.Callback{
  private OpenGLContext glContext;
  private SurfaceHolder holder;
  private GL10 gl;

  float[] square = new float[] {  0.25f, 0.25f, 0.0f,

0.75f, 0.25f, 0.0f,

0.25f, 0.75f, 0.0f,

0.75f, 0.75f, 0.0f };
  /*
  byte[] indices = {
  0,1, 1,2,  2,3,  3,0
  };
  */
  FloatBuffer squareBuff;

  public GLTutorialTwo(Context c) {
  super(c);
  holder = getHolder();
  holder.addCallback(this);

  }

  protected void onDraw(GL10 gl) {

  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  gl.glColor4f(1,1,1,1);
  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
  GLU.gluOrtho2D(gl, 0.0f,1.2f,0.0f,1.0f);
  gl.glVertexPointer(3, GL10.GL_FLOAT, 0, squareBuff);
  glContext.post();
  }

  @Override
  public void surfaceChanged(SurfaceHolder holder, int format, int
   width,
  int height) {
  // TODO Auto-generated method stub
  gl.glViewport(0,0,width,height);

  }

  @Override
  public void surfaceCreated(SurfaceHolder holder) {
  // TODO Auto-generated method stub

  glContext = new OpenGLContext(0);
  glContext.waitNative();
  glContext.makeCurrent(holder);

  gl = (GL10)glContext.getGL();
   gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
   GL10.GL_FASTEST);
  gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
  //  gl.glTranslatef(0,0, -3.0f);

  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();

  gl.glEnable(GL10.GL_DITHER);
  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
  gl.glEnable(GL10.GL_CULL_FACE);
  gl.glShadeModel(GL10.GL_SMOOTH);

  ByteBuffer bb = ByteBuffer.allocateDirect(square.length*4);
  bb.order(ByteOrder.nativeOrder());
  squareBuff = bb.asFloatBuffer();
  squareBuff.put(square);
  squareBuff.position(0);

  //  gl.glDrawElements(GL10.GL_LINES, 8, GL10.GL_UNSIGNED_BYTE,
   ib);

  onDraw(gl);
  }

  @Override
  public void surfaceDestroyed(SurfaceHolder arg0) {
  // TODO Auto-generated method stub

  }
   }

   Who knows the problem,please tell me,thanks 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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-08-22 Thread Justin (Google Employee)

What's the output from logcat?

Cheers,
Justin
Android Team @ Google

On Aug 22, 7:20 am, Manu [EMAIL PROTECTED] wrote:
 Hi Folks,

 Trying to insert even in google calendar but with no luck. Any
 pointers?

  String [EMAIL PROTECTED];
  String pass=xyz;
   myService.setUserCredentials(name, pass);
   URL postUrl =
 new URL(http://www.google.com/calendar/feeds/+name+/private/
 full);
   CalendarEventEntry myEntry = new CalendarEventEntry();

   myEntry.setTitle(new PlainTextConstruct(Tennis with Beth));
   myEntry.setContent(new PlainTextConstruct(Meet for a quick
 lesson.));

   DateTime startTime =
 DateTime.parseDateTime(2008-08-22T15:00:00-08:00);
   DateTime endTime =
 DateTime.parseDateTime(2008-08-22T17:00:00-08:00);
   When eventTimes = new When();
   eventTimes.setStartTime(startTime);
   eventTimes.setEndTime(endTime);
   myEntry.addTime(eventTimes);
 Thanks
 Manu

   // Send the request and receive the response:
   CalendarEventEntry insertedEntry = myService.insert(postUrl,
 myEntry);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Justin (Google Employee)

I'm not sure its complaining about the thread shutting down, but
rather that you're trying to unbind a service that is note bound to
Service not registered.

Try keep a reference to your thread in the your Activity. in onPause()
your should call Thread.stop(). Override stop() in your thread to
unbind the service and then call super.stop().

Cheers,
Justin
Android Team @ Google

On Aug 22, 8:19 am, code_android_festival_way
[EMAIL PROTECTED] wrote:
 Hello guys!

 I'm having the following problem. I'm having an activity that starts a
 background thread in order to bind to a service which does some work.
 Now I've got the problem that when pressing the back button I get the
 following exception:

 08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
 thread Thread-8 exiting due to uncaught exception
 08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
 java.lang.IllegalArgumentException: Service not
 registered: [EMAIL PROTECTED]

 I've done the following in the onPause() method:

 this.unbindService(svcConn);
 background.interrupt();
 background = null;

 I don't really know how to stop that thread properly when leaving the
 activity. Any help would be appreciated!

 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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Justin (Google Employee)

My bad, stop() is final, so you'll have to find another place to
unbind the service.

Cheers,
Justin
Android Team @ Google

On Aug 22, 9:26 am, Justin (Google Employee) [EMAIL PROTECTED]
wrote:
 I'm not sure its complaining about the thread shutting down, but
 rather that you're trying to unbind a service that is note bound to
 Service not registered.

 Try keep a reference to your thread in the your Activity. in onPause()
 your should call Thread.stop(). Override stop() in your thread to
 unbind the service and then call super.stop().

 Cheers,
 Justin
 Android Team @ Google

 On Aug 22, 8:19 am, code_android_festival_way

 [EMAIL PROTECTED] wrote:
  Hello guys!

  I'm having the following problem. I'm having an activity that starts a
  background thread in order to bind to a service which does some work.
  Now I've got the problem that when pressing the back button I get the
  following exception:

  08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
  thread Thread-8 exiting due to uncaught exception
  08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
  java.lang.IllegalArgumentException: Service not
  registered: [EMAIL PROTECTED]

  I've done the following in the onPause() method:

  this.unbindService(svcConn);
  background.interrupt();
  background = null;

  I don't really know how to stop that thread properly when leaving the
  activity. Any help would be appreciated!

  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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Can MediaRecoder record audio in wave format?

2008-08-22 Thread april

How to set the MediaRecorder to record in specified format? such as
wav format. In emulator, how can we test record functionality without
hardware?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Images from Google Chart API

2008-08-22 Thread dai

Ciao, can anyhone get image files from Google Chart API?
I'm trying to get image from 
http://chart.apis.google.com/chart?chs=460x230chd=t:62cht=pchl=Google,
but I could not do well..

Any hints on this...?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: MapView and Zoom Control in 0.9 SDK

2008-08-22 Thread marcel-182

Hey,

I have the same problem. I want my MapView to handle the ZoomControls
like in the standard Maps application but haven't found a way how to
do it :-(.

On 22 Aug., 11:45, Cristina [EMAIL PROTECTED] wrote:
 Hi!

 I am trying to show the zoom controls over a MapView in the new 0.9
 SDK.

 I have been able to show the zoom Control View using the following
 code
  // Zoom View
 View zoomView = mMapView.getZoomControls();
 zoomView.setLayoutParams(new ViewGroup.LayoutParams
 (ViewGroup.LayoutParams.WRAP_CONTENT,
 ViewGroup.LayoutParams.WRAP_CONTENT));
mMapView.addView(zoomView);
   mMapView.displayZoomControls(true);

 Using this code, I have been able to show the Zoom Control View at the
 top-left edge the screen (over the map).
  However, I will want it to be a the bottom of the screen, and I do
 not know how to move it to that position.

 I have tried to use de ViewGroup method requestChildRectangleOnScreen,
 in order to move the zoomView to the position I want, but I have been
 not able to make it work.

 Can anyone help me with this issue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons

2008-08-22 Thread Justin (Google Employee)

APIDemos  App  Dialog

Cheers,
Justin
Android Team @ Google

On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote:
 How do I create a dialog activity that looks exactly the same as when
 you build a dialog with the AlertDialog class, including the buttons
 panel at the bottom.

 Basically, I want the same sort of activity that you get when you add
 a Bookmark in the Browser app.

 I checked the APIDemos  Activity  Dialog sample but it is missing
 the panel with the buttons.

 Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity Question

2008-08-22 Thread Gil

If I use singleTop for both activities the code works as expected.
The singleTask launchMode is causing the behavior described
above.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons

2008-08-22 Thread webmonkey

Hello Justin,

Thanks for your response, but I already checked these samples and I
know how to build dialogs using the AlertDialog class. The thing is, I
usually call AlertDialog inside an existing activity, for example to
create a delete confirmation dialog. But now I want the entire
activity to be the dialog. ( so I can handle an ACTION_EDIT intent
that works on my custom content provider )

From the logs, I can tell that the Browser app calls a separate intent
to add a bookmark, but the entire bookmark activity is displayed as a
dialog, complete with title and buttons panel. How do I do this?

I hope you understand what I am trying to achieve.

Thanks


On Aug 22, 7:09 pm, Justin (Google Employee) [EMAIL PROTECTED]
wrote:
 APIDemos  App  Dialog

 Cheers,
 Justin
 Android Team @ Google

 On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote:



  How do I create a dialog activity that looks exactly the same as when
  you build a dialog with the AlertDialog class, including the buttons
  panel at the bottom.

  Basically, I want the same sort of activity that you get when you add
  a Bookmark in the Browser app.

  I checked the APIDemos  Activity  Dialog sample but it is missing
  the panel with the buttons.

  Thanks- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android JNI

2008-08-22 Thread vol

Actually, the errors stemmed from some compile-related
incompatabilities.

Is it possible to do this from win32, or do I have to do it from
Linux?

On Aug 22, 11:36 am, vol [EMAIL PROTECTED] wrote:
 I'm having trouble building the JNI example 
 athttp://davanum.wordpress.com/2007/12/09/android-invoke-jni-based-meth...
 .

 First up, is it possible to actually do this from windows? Do I have
 to do this in a linux environment? I would think that doing this from
 windows is possible, but I don't have jdk/include/linux, just jdk/
 include/win32, so that's throwing me.

 Second, I am at step 6, and am attempting to use arm-none-linux-
 gnueabi-gcc.
 $ arm-none-linux-gnueabi-gcc  -I/cygdrive/c/Program\ Files/Java/
 jdk1.6.0_04/include/ -I/cygdrive/c/Program\ Files/Java/jdk1.6.0_04/
 include/win32/  -fpic -c org_apache_NativeAdd.c

 In file included from org_apache_NativeAdd.c:1:
 org_apache_NativeAdd.h:2:17: error: jni.h: No such file or directory
 In file included from org_apache_NativeAdd.c:1:
 org_apache_NativeAdd.h:15: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'jlong'
 org_apache_NativeAdd.c:3: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'jlong'

 Ok. Cygwin + arm-none-linux-gnueabi-gcc didn't want to seem to include
 anything like that, so I just flat out copied over the contents, and
 it was happy to include them. Unfortunately, it didn't want to build
 them, giving me other errors like those seen above.

 What do I have set up incorrectly for building JNI?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread code_android_festival_way

Thank you for your answers.

That's what I do:

http://paste.pocoo.org/show/83036/

I've just shortened it up a bit. With the binded service I'm calling a
method which is waiting for a location update. I'm registering the
LocationManager from the onStart() method of the service. (thats why I
need the startService(..) ) When the location listener gets called the
above mentioned method stops waiting and does its work and returns the
result to the activity. This is working pretty fine but now I'm not
pretty sure what happens (regarding the opening of new threads) when I
start/bind my service. From my point of view and what I've seen in the
DDMS just the one background thread gets added to the thread list
which I don't really understand. (I thought that starting a service
leads to a new thread in which the service runs)

I would be happy if someone could explain what really happens. :-)

Regards!

On 22 Aug., 18:28, Justin (Google Employee) [EMAIL PROTECTED] wrote:
 My bad, stop() is final, so you'll have to find another place to
 unbind the service.

 Cheers,
 Justin
 Android Team @ Google

 On Aug 22, 9:26 am, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:

  I'm not sure its complaining about the thread shutting down, but
  rather that you're trying to unbind a service that is note bound to
  Service not registered.

  Try keep a reference to your thread in the your Activity. in onPause()
  your should call Thread.stop(). Override stop() in your thread to
  unbind the service and then call super.stop().

  Cheers,
  Justin
  Android Team @ Google

  On Aug 22, 8:19 am, code_android_festival_way

  [EMAIL PROTECTED] wrote:
   Hello guys!

   I'm having the following problem. I'm having an activity that starts a
   background thread in order to bind to a service which does some work.
   Now I've got the problem that when pressing the back button I get the
   following exception:

   08-22 17:09:46.460: ERROR/AndroidRuntime(26218): Uncaught handler:
   thread Thread-8 exiting due to uncaught exception
   08-22 17:09:46.460: ERROR/AndroidRuntime(26218):
   java.lang.IllegalArgumentException: Service not
   registered: [EMAIL PROTECTED]

   I've done the following in the onPause() method:

   this.unbindService(svcConn);
   background.interrupt();
   background = null;

   I don't really know how to stop that thread properly when leaving the
   activity. Any help would be appreciated!

   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
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] showAlert in latest SDK

2008-08-22 Thread Mark Hansen

I've been going over a bunch of examples and for the life of me can't
figure out how to get showAlert to generate a dialog.

I'm fairly new to both Android and Java development so I could easily
be missing something, but I'm stumped.

This is the menu option selected override in a class that is
overriding ListActivity (I'm wondering if that isn't the issue?)

Thanks,
Mark


@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId()) {
case 0:
showAlert(Menu Item,New Post,ok,null,false,null);
return true;
case 1:
showAlert(Menu Item,Refresh,ok,null,false,null);
fillDataSAX();
return true;
case 2:
showAlert(Menu Item,Settings,ok,null,false,null);
return true;
}
return false;
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Mark Murphy

 (I thought that starting a service
 leads to a new thread in which the service runs)

At least in M5, with a default setup for the service, and the service in
the same application, it does not run on a separate thread. If you call
into the service from an activity, and you're calling from the activity's
main thread, the activity will block until the service returns (or until
the Grim Reaper determines your activity has been unresponsive for too
long and kills it off).

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Using the Emulator with a Proxy - 0.9 Beta SDK Windows Eclipse 3.4

2008-08-22 Thread Megha Joshi
This thread has some good info on proxy config...
Could one of you please add this  to the porting docs..whenever you find
time..Thanks!
On Thu, Aug 21, 2008 at 11:15 PM, Manish Pandit [EMAIL PROTECTED]wrote:




 On Aug 21, 11:02 pm, shan [EMAIL PROTECTED] wrote:
  Hi Bob,
  I got the browser up. If you have any other versions of the sdk/
  emulator on your system, erase them and then unzip the new sdk. And
  provide the proxy as proxy:port only. Do not use the http://, it
  throws a NumberFormatException.
  The -http-proxy startup option did'nt work but the workaround
  did(using the system table insertion).
 
  On Aug 21, 4:30 am, Bob [EMAIL PROTECTED] wrote:
 
   I've tried to use the Emulator with a Proxy using the instructions
   here...
 
  http://code.google.com/android/reference/emulator.html#proxy
 
   but have had no success using either of the two options discussed in
   the reference. The 'Browser' application reports...
 
   Web page not available
   The Web page athttp://www.google.com/mcouldnot be loaded as:
   The connection to the server was unsuccessful.
 
   I'm using the Windows 0.9 Beta SDK w/Eclipse 3.4.
 
   Has anyone got this working? Seems like such a basic thing, I
   shouldn't be stumbling on this.

 I was able to get it working - I am running Ganymede with 0.9 Beta
 Android on Ubuntu 8.04. I selected run-configurations, selected the
 config I use for my app, under Target tab there is a section for
 additional emulator params. I typed in -http-proxy
 http://login:[EMAIL PROTECTED]:port
 without quotes and was able to connect successfully. For some reason,
 I had to bounce my Eclipse though...

 -cheers,
 Manish

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread code_android_festival_way

Ok.

After a little bit of debugging I know that the Service runs inside
the background thread. (the methods that I call inside the service
after binding to it)

But after that is it really that difficult to stop that background
thread in onPause? Even calling the deprecated stop() doesn't stop the
thread.

On 22 Aug., 20:19, Mark Murphy [EMAIL PROTECTED] wrote:
  (I thought that starting a service
  leads to a new thread in which the service runs)

 At least in M5, with a default setup for the service, and the service in
 the same application, it does not run on a separate thread. If you call
 into the service from an activity, and you're calling from the activity's
 main thread, the activity will block until the service returns (or until
 the Grim Reaper determines your activity has been unresponsive for too
 long and kills it off).

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding content to a tab view dynamically

2008-08-22 Thread Teo
Thanks for the help. I didn't actually manage it this way, but somehow i saw
the *createTabContent*  function from *TabContentFactory* (which i was
already using actually) is called every time a tab is selected, not just at
its creation. So i make a completely new *LinearLayout* inside the tab and
just return it as the content, being able to do whatever i want in that *
LinearLayout*.

Thanks for the help again.

On Fri, Aug 22, 2008 at 7:20 PM, Josh Guilfoyle [EMAIL PROTECTED] wrote:


 This seems a bit goofed up to me.  First off, the FrameLayout holding
 your tabs should initially be empty.  the TabHost will manage filling
 it in with the contents of the tab you've selected.

 addTouchables is very certainly not what you want.  You want to use
 addView() but make sure that the view you get with getCurrentView is
 what you expect.  Make one tab have a LinearLayout with android:id=@
 +id/foobarbaz, then check that getCurrentView hands you a view for
 which findViewById(R.id.foobarbaz) succeeds to find your
 LinearLayout.  If not, try getCurrentTabView (there is nod
 ocumentation, so we're just stabbing in the dark here).  The other
 solution is to better abstract the tab content in question and let the
 abstractions manage themselves.  You can do this by separating the
 content of each tab into its own Activity and properly isolate them
 that way.  When you click some button in Activity A, A can manage
 adding views to its layout entirely on its own.

 On Aug 21, 11:48 pm, Teo [EMAIL PROTECTED] wrote:
  Ok, great, thanks for the help! Here's the relevant code from the XML:
 
  *LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
 
  android:orientation=vertical
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  TabHost android:id=@+id/tabhost
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  TabWidget android:id=@android:id/tabs
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  /
  FrameLayout android:id=@android:id/tabcontent
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:paddingTop=62px
  Button android:id=@+id/buttontab
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:text=A semi-random button
  /
  /FrameLayout
  /TabHost
  /LinearLayout*
 
  And here's how i tried to add something:
 
  *private void addItem(){
  CheckBox c=new CheckBox(this);
  ArrayListView a=new ArrayListView();
  a.add(c);
  tabs.getCurrentView().addTouchables(a);
  }*
 
  *tabs* is the TabHost object.
 
  Did i get it wrong with the *addTouchables*? I couldn't find any better
  method. Also, instead of *getCurrentView* i tried *getCurrentTabView* and
 i
  also tried a lot of casts applied to children and children of children
 and i
  couldn't get an effect.
 
  (I know the function above is called when it should be - i confirmed it
  during debug..)
 
  Thanks,
  Teo
 
 
 
  On Fri, Aug 22, 2008 at 12:06 AM, Josh Guilfoyle [EMAIL PROTECTED]
 wrote:
 
   Actually my mistake.  getCurrentTabView might just get the view of the
   tab you have selected (not the contents of the tab).  Try
   getCurrentView.  Post sample code if you can't get it working and I
   will explore further.
 
   On Aug 21, 2:04 pm, Josh Guilfoyle [EMAIL PROTECTED] wrote:
Do you mean to add a new tab or simply dynamically adjust the View
hierarchy in a particular tab?  If so, getCurrentTabView will work to
do what you need.  Just modify the view hierarchy found there.  Do
realize that you are getting the root-level View of the tab, so you
must search within that using View#findViewById to locate the actual
view you're looking to modify.
 
On Aug 21, 11:28 am, Teo [EMAIL PROTECTED] wrote:
 
 Hi,
 
 i tried debugging quite a bit, but i can't figure it out; is it
 possible to add something (buttons, etc.) to a tab? I'm using a
 FrameLayout inside a TabWidget inside a TabHost. I tried lots of
 things, including adding to TabHost's getCurrentTabView, but i
 wasn't
 lucky.
 
 Any tips?
 
 Thanks,
 Teo
 
  --
  Teo (a.k.a. Teodor Filimon, Teominator)
  Site -www.teodorfilimon.com| Blog -www.teodorfilimon.blogspot.com
  GMT +2 (or PDT +10)
 



-- 
Teo (a.k.a. Teodor Filimon, Teominator)
Site - www.teodorfilimon.com | Blog - www.teodorfilimon.blogspot.com
GMT +2 (or PDT +10)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!

[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Mark Murphy

 After a little bit of debugging I know that the Service runs inside
 the background thread. (the methods that I call inside the service
 after binding to it)

Right.

 But after that is it really that difficult to stop that background
 thread in onPause?

You don't want to stop the thread. You want whatever the thread is
blocking on to stop blocking, and for the thread to recognize that it
needs to go away and then quietly die on its own.

So...what is the thread blocking on, inside the service? Or are you in
some sort of Thread.sleep() loop?

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Socket exception-unknown error from HttpClient execute() method

2008-08-22 Thread Megha Joshi
Did you try configuring emulator proxy connection as discussed below:
http://groups.google.com/group/android-developers/browse_thread/thread/5bf421494daf6784/2cc9564fd9f62e37

On Fri, Aug 22, 2008 at 1:51 AM, Graeme [EMAIL PROTECTED] wrote:


 hi sacoskun

 Thanks for your suggestion. Yes I had not set the INTERNET permission
 in my
 AndroidManifest.xml. I have updated that now and the socket exception
 has changed
 to being about being unable to resolve the domain name of a http proxy
 server
 I am located behind. I have noticed other threads where http-proxy
 usage has been
 problematic.

 Thanks for your tip.
 Best Regards
 Graeme

 On Aug 22, 7:30 am, sacoskun [EMAIL PROTECTED] wrote:
  Did you add uses-permission
  android:name=android.permission.INTERNET / tag to your
  AndroidManifest.xml?
  The new SDK requires that permission for network calls.
 
  sacoskun
 
  On Aug 21, 6:13 pm, Graeme [EMAIL PROTECTED] wrote:
 
 
 
   Hi everyone
 
   I'm trying to figure out how to use HttpClient 4.x to do POST requests
   routed via
   a Proxy server. I'm seeing a socket exception triggered by calling
 
   DefaultHttpClient.execute(HttpHost target, HttpRequest method). My
   HttpPoster class looks like
 
   package com.bt.gcto.android.testhttp;
 
   import java.io.IOException;
   import java.util.Hashtable;
 
   import org.apache.http.Header;
   import org.apache.http.HttpEntity;
   import org.apache.http.HttpHost;
   import org.apache.http.HttpResponse;
   import org.apache.http.HttpVersion;
   import org.apache.http.client.HttpClient;
   import org.apache.http.client.methods.HttpPost;
   import org.apache.http.conn.ClientConnectionManager;
   import org.apache.http.conn.params.ConnRoutePNames;
   import org.apache.http.conn.scheme.PlainSocketFactory;
   import org.apache.http.conn.scheme.Scheme;
   import org.apache.http.conn.scheme.SchemeRegistry;
   import org.apache.http.conn.scheme.SocketFactory;
   import org.apache.http.conn.ssl.SSLSocketFactory;
   import org.apache.http.impl.client.DefaultHttpClient;
   import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
   import org.apache.http.params.BasicHttpParams;
   import org.apache.http.params.HttpParams;
   import org.apache.http.params.HttpProtocolParams;
   import org.apache.http.util.EntityUtils;
 
   import android.net.Uri;
   import android.util.Log;
 
   public class HttpPoster {
  private final String TAG=HttpPoster;
  private final String NETWORK_DEVICE_SIDE_TRUE =
   ;deviceside=true;
  private final String NETWORK_DEVICE_SIDE_FALSE =
   ;deviceside=false;
  private final String NETWORK_WIFI = ;interface=wifi;
  //private final String proxy=proxy.intra.bt.com:8080;
  private boolean useWifi;
  private boolean deviceSide;
  // Apache HttpClient 4.x stuff
  private static HttpParams defaultParameters = null;
  private static SchemeRegistry supportedSchemes = null;
 
  /**
* Performs general setup.
* This should be called only once.
*/
   private final static void setup() {
 
   supportedSchemes = new SchemeRegistry();
 
   // Register the http and https protocol schemes,
 they are
   // required by the default operator to look up socket
   factories.
   SocketFactory sf =
 PlainSocketFactory.getSocketFactory();
   supportedSchemes.register(new Scheme(http, sf, 80));
   sf = SSLSocketFactory.getSocketFactory();
   supportedSchemes.register(new Scheme(https, sf, 80));
 
   // prepare parameters
   HttpParams params = new BasicHttpParams();
   HttpProtocolParams.setVersion(params,
 HttpVersion.HTTP_1_1);
   HttpProtocolParams.setContentCharset(params, UTF-8);
   HttpProtocolParams.setUseExpectContinue(params, true);
   defaultParameters = params;
 
   } // setup
 
   private final static HttpParams getParams() {
   return defaultParameters;
   }
 
  HttpPoster(boolean deviceSide, boolean useWifi) {
  this.useWifi = useWifi;
  this.deviceSide = deviceSide;
  System.err.println(HttpPoster::HttpPoster);
  }
 
  public String post(String url,
  
 HashtableString,String headerProperties, byte[] bytes )
 throws IOException {
   HttpClient client = null;
   HttpPost method=null;
   //InputStream is = null;
   //OutputStream os = null;
   //String response = ;
   HttpResponse rsp = null;
   HttpEntity entity=null;
   String fullUrl;
   //int rc;
 
  

[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread code_android_festival_way

Well the thread is doing something at the moment I want him to be
killed. (he is downloading pictures which will be shown in the gui
later on) So I've looked at your example but don't understand how I
should implement that in my thread. I just want him to stop what he is
doing because after leaving the activity I dont need that data any
more.

Could the problem be that I'm binding in the activity onStart() but
using the binded service happens in the started background thread?

PS: Thank you for all your help!

On 22 Aug., 20:56, Mark Murphy [EMAIL PROTECTED] wrote:
  After a little bit of debugging I know that the Service runs inside
  the background thread. (the methods that I call inside the service
  after binding to it)

 Right.

  But after that is it really that difficult to stop that background
  thread in onPause?

 You don't want to stop the thread. You want whatever the thread is
 blocking on to stop blocking, and for the thread to recognize that it
 needs to go away and then quietly die on its own.

 So...what is the thread blocking on, inside the service? Or are you in
 some sort of Thread.sleep() loop?

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity Question

2008-08-22 Thread Gil

It turns out that singleTask is what I need in my app for my main
(LAUNCHER) activity otherwise sometimes I end up with multiple
instances of my activities.

On Aug 22, 10:33 am, Gil [EMAIL PROTECTED] wrote:
 If I use singleTop for both activities the code works as expected.
 The singleTask launchMode is causing the behavior described
 above.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no certificates at entry res/drawable/icon.png; when run my application (sdk 0.9)

2008-08-22 Thread Xavier Ducrohet
You are using the -r option of adb install which will basically do a soft
reinstall, keeping the data of the installed application.

The fact that it does not fail with an error indicating that there are no
apps to reinstall means that you have somehow already installed a version.
I'm guessing that you managed to install a version from eclipse, signed with
the debug certificate.

Now, you want to install your application signed with your own personal
certificate, but it is different from the debug one automatically generated
by Eclipse.

The system cannot do a soft reinstall if the new application certificate
does not match the certificate of the application currently installed.

Before installing, you must do a full uninstall: adb uninstall package
Note that package is not AndroidSubmarine.apk but the package declared in
the manifest (something like com.mycompany.androidsubmarine)

This uninstall will remove the application data, and completely clear the
system of the application.

After this is done, you can do a normal install with adb install path to
.apk (note that you should not use the -r option in this case).

Hope this helps.
Xav

PS: in your jarsigner command line, you do not need to use the -signedjar
option as it's only used by the verifiy command.

On Fri, Aug 22, 2008 at 1:23 AM, Wesley [EMAIL PROTECTED] wrote:

 hi Xav,

 I not really familiar with jarsigner and keytool thing...

 this is what I did...
 1. as u said I export unsigning apk, then I use the apk on this two
 command...
 2. keytool -genkey -dname cn=Wesley, ou=Wesley Soft, o=BJSG, c=MY -alias
 android -keypass and123 -keystore c:\mystore -storepass abc123 -validity 365

 jarsigner -keystore C:\mystore -storepass abc123 -keypass and123 -signedjar
 AndroidSubmarine.jar AndroidSubmarine.apk android

 3. I try to install... using adb...

 adb -s emulator-5554 install -r AndroidSubmarine.apk
 1522 KB/s (0 bytes in 414131.000s)
 pkg: /data/local/tmp/AndroidSubmarine.apk
 Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

 it return this error... can u help me???

 Thanks for your times...
 have a nice day...



 Wesley...


 On Fri, Aug 22, 2008 at 2:24 PM, Xavier Ducrohet [EMAIL PROTECTED] wrote:

 If you use the 0.7.1 plugin then it will automatically use a debug
 key/certificate to sign application when building.

 When you release your application you will need to export it from Eclipse
 (see the overview page of the manifest editor, it'll create an unsigned
 package), and then manually sign it with your personnal certificate, using
 jarsigner.

 Xav


 On Thu, Aug 21, 2008 at 10:52 PM, Wesley [EMAIL PROTECTED] wrote:

 hi Xav,

 oic...

 thanks for the reply...

 is there means sdk 0.9 need to sign application manually??? I use eclipse
 to create project it can install and run, but when I develop use the project
 and adding image to res and so on... it has this problem... means I need to
 manually signing the apk with some sort of key???

 how to signing apk???
 can u show me???


 thanks...
 have a nice day...


 Wesley.

 On Fri, Aug 22, 2008 at 12:36 PM, Xavier Ducrohet [EMAIL PROTECTED]wrote:

 You are attempting to install an application that is not signed.

 If use ant, you will need to have activityCreator regenerate a new
 build.xml file that contains the proper steps for building/signing your
 application.

 More information here:
 http://code.google.com/android/intro/develop-and-debug.html#signing

 Xav

 On Thu, Aug 21, 2008 at 9:22 PM, Wesley Sagittarius [EMAIL PROTECTED]
  wrote:


 I trying the SDK 0.9... my previous application is for m5 one..

 I got this error when I wanna to run my application...
 may I know any one what is that means??? and solution would be???


 08-22 04:13:41.732: ERROR/PackageParser(46): Package
 com.google.testing has no certificates at entry res/drawable/icon.png;
 ignoring!




 Wesley.













 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-08-22 Thread Manu

Justing,
It appears that the code is throwing exception in line
myService.setUserCredentials(name, pass);
The catch block for AuthenticationException  is showing as the
exception error message ERROR:Error connecting with login URI
{

  // TODO Auto-generated catch block
  android.util.Log.v(###,ERROR:+e.getMessage());

}

I/ActivityManager(   51): Removing old ANR trace file from /data/anr/
traces.txt

I/Process (   51): Sending signal. PID: 187 SIG: 3

I/Process (   51): Sending signal. PID: 109 SIG: 3

I/Process (   51): Sending signal. PID: 163 SIG: 3

I/dalvikvm(  163): threadid=7: reacting to signal 3

I/dalvikvm(  109): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 145 SIG: 3

I/Process (   51): Sending signal. PID: 51 SIG: 3

I/dalvikvm(  145): threadid=7: reacting to signal 3

I/dalvikvm(  187): threadid=7: reacting to signal 3

I/dalvikvm(   51): threadid=7: reacting to signal 3

I/dalvikvm(  145): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(  109): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(   51): Wrote stack trace to '/data/anr/traces.txt'

I/Process (   51): Sending signal. PID: 113 SIG: 3

I/dalvikvm(  113): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 94 SIG: 3

I/Process (   51): Sending signal. PID: 88 SIG: 3

I/dalvikvm(   88): threadid=7: reacting to signal 3

I/dalvikvm(   94): threadid=7: reacting to signal 3

W/ActivityManager(   51): finishReceiver called but none active

I/dalvikvm(  187): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(  113): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(   94): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(  163): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(   88): Wrote stack trace to '/data/anr/traces.txt'

V/### (  187): ERROR:Error connecting with login URI

W/ActivityManager(   51): finishReceiver called but no pending
broadcasts

D/dalvikvm(  163): GC freed 1978 objects / 105520 bytes in 768ms

D/dalvikvm(  109): GC freed 1768 objects / 99112 bytes in 837ms

D/dalvikvm(   88): GC freed 798 objects / 32984 bytes in 833ms

D/dalvikvm(  113): GC freed 155 objects / 14224 bytes in 634ms

D/dalvikvm(   94): GC freed 187 objects / 11472 bytes in 718ms

D/dalvikvm(   51): GC freed 9280 objects / 422384 bytes in 873ms

Thanks
Manoj

On Aug 22, 9:21 pm, Justin (Google Employee) [EMAIL PROTECTED]
wrote:
 What's the output from logcat?

 Cheers,
 Justin
 Android Team @ Google

 On Aug 22, 7:20 am, Manu [EMAIL PROTECTED] wrote:

  Hi Folks,

  Trying to insert even in google calendar but with no luck. Any
  pointers?

   String [EMAIL PROTECTED];
   String pass=xyz;
    myService.setUserCredentials(name, pass);
        URL postUrl =
          new URL(http://www.google.com/calendar/feeds/+name+/private/
  full);
        CalendarEventEntry myEntry = new CalendarEventEntry();

        myEntry.setTitle(new PlainTextConstruct(Tennis with Beth));
        myEntry.setContent(new PlainTextConstruct(Meet for a quick
  lesson.));

        DateTime startTime =
  DateTime.parseDateTime(2008-08-22T15:00:00-08:00);
        DateTime endTime =
  DateTime.parseDateTime(2008-08-22T17:00:00-08:00);
        When eventTimes = new When();
        eventTimes.setStartTime(startTime);
        eventTimes.setEndTime(endTime);
        myEntry.addTime(eventTimes);
  Thanks
  Manu

        // Send the request and receive the response:
        CalendarEventEntry insertedEntry = myService.insert(postUrl,
  myEntry);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Mark Murphy

 Well the thread is doing something at the moment I want him to be
 killed. (he is downloading pictures which will be shown in the gui
 later on) So I've looked at your example but don't understand how I
 should implement that in my thread. I just want him to stop what he is
 doing because after leaving the activity I dont need that data any
 more.

I'm not real certain myself, in part because I don't have much experience
with the new HttpCore/HttpClient bits. I had used the previous edition of
HttpClient many a time, well before Android, but I hadn't had the need
until now to get into the newer edition.

My recommendation is to poke around the HTTP classes you're using and see
how best to interrupt your download when you need the thread to unwind.
When you tell your service to stop, it really interrupts the download and
lets that thread wrap up before the service completely stops.

 Could the problem be that I'm binding in the activity onStart() but
 using the binded service happens in the started background thread?

Possibly, but from your original post, I got the impression the error was
due to the thread itself. I may be mis-interpreting that message, though.

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-08-22 Thread Manu

Justin,

How can I print the exception to a logcat? Is it feasible?.  I tried
attaching src of gdata to android project for debugging but
compilation fails and so cannot debug.

Thanks
Manoj

On Aug 23, 12:23 am, Manu [EMAIL PROTECTED] wrote:
 Justing,
 It appears that the code is throwing exception in line
 myService.setUserCredentials(name, pass);
 The catch block for AuthenticationException  is showing as the
 exception error message ERROR:Error connecting with login URI
     {

       // TODO Auto-generated catch block
       android.util.Log.v(###,ERROR:+e.getMessage());

     }

 I/ActivityManager(   51): Removing old ANR trace file from /data/anr/
 traces.txt

 I/Process (   51): Sending signal. PID: 187 SIG: 3

 I/Process (   51): Sending signal. PID: 109 SIG: 3

 I/Process (   51): Sending signal. PID: 163 SIG: 3

 I/dalvikvm(  163): threadid=7: reacting to signal 3

 I/dalvikvm(  109): threadid=7: reacting to signal 3

 I/Process (   51): Sending signal. PID: 145 SIG: 3

 I/Process (   51): Sending signal. PID: 51 SIG: 3

 I/dalvikvm(  145): threadid=7: reacting to signal 3

 I/dalvikvm(  187): threadid=7: reacting to signal 3

 I/dalvikvm(   51): threadid=7: reacting to signal 3

 I/dalvikvm(  145): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(  109): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(   51): Wrote stack trace to '/data/anr/traces.txt'

 I/Process (   51): Sending signal. PID: 113 SIG: 3

 I/dalvikvm(  113): threadid=7: reacting to signal 3

 I/Process (   51): Sending signal. PID: 94 SIG: 3

 I/Process (   51): Sending signal. PID: 88 SIG: 3

 I/dalvikvm(   88): threadid=7: reacting to signal 3

 I/dalvikvm(   94): threadid=7: reacting to signal 3

 W/ActivityManager(   51): finishReceiver called but none active

 I/dalvikvm(  187): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(  113): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(   94): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(  163): Wrote stack trace to '/data/anr/traces.txt'

 I/dalvikvm(   88): Wrote stack trace to '/data/anr/traces.txt'

 V/###     (  187): ERROR:Error connecting with login URI

 W/ActivityManager(   51): finishReceiver called but no pending
 broadcasts

 D/dalvikvm(  163): GC freed 1978 objects / 105520 bytes in 768ms

 D/dalvikvm(  109): GC freed 1768 objects / 99112 bytes in 837ms

 D/dalvikvm(   88): GC freed 798 objects / 32984 bytes in 833ms

 D/dalvikvm(  113): GC freed 155 objects / 14224 bytes in 634ms

 D/dalvikvm(   94): GC freed 187 objects / 11472 bytes in 718ms

 D/dalvikvm(   51): GC freed 9280 objects / 422384 bytes in 873ms

 Thanks
 Manoj

 On Aug 22, 9:21 pm, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:

  What's the output from logcat?

  Cheers,
  Justin
  Android Team @ Google

  On Aug 22, 7:20 am, Manu [EMAIL PROTECTED] wrote:

   Hi Folks,

   Trying to insert even in google calendar but with no luck. Any
   pointers?

    String [EMAIL PROTECTED];
    String pass=xyz;
     myService.setUserCredentials(name, pass);
         URL postUrl =
           new URL(http://www.google.com/calendar/feeds/+name+/private/
   full);
         CalendarEventEntry myEntry = new CalendarEventEntry();

         myEntry.setTitle(new PlainTextConstruct(Tennis with Beth));
         myEntry.setContent(new PlainTextConstruct(Meet for a quick
   lesson.));

         DateTime startTime =
   DateTime.parseDateTime(2008-08-22T15:00:00-08:00);
         DateTime endTime =
   DateTime.parseDateTime(2008-08-22T17:00:00-08:00);
         When eventTimes = new When();
         eventTimes.setStartTime(startTime);
         eventTimes.setEndTime(endTime);
         myEntry.addTime(eventTimes);
   Thanks
   Manu

         // Send the request and receive the response:
         CalendarEventEntry insertedEntry = myService.insert(postUrl,
   myEntry);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android JNI

2008-08-22 Thread Tyler Ernst

You are getting those errors because you are building for linux, but
using the windows jni includes.  This is because the compiler does not
recognize the __int64 microsoft extension.  You can build this in a
windows environment, but you'll have to get the include files from the
linux environment.

Also since the 0.9 beta has been released I have been unable to copy
the .so to the /system/lib directory of the emulator.  If anyone has
found a way to do this that would be greatly appreciated.

Thanks

On Aug 22, 10:46 am, vol [EMAIL PROTECTED] wrote:
 Actually, the errors stemmed from some compile-related
 incompatabilities.

 Is it possible to do this from win32, or do I have to do it from
 Linux?

 On Aug 22, 11:36 am, vol [EMAIL PROTECTED] wrote:



  I'm having trouble building the JNI example 
  athttp://davanum.wordpress.com/2007/12/09/android-invoke-jni-based-meth...
  .

  First up, is it possible to actually do this from windows? Do I have
  to do this in a linux environment? I would think that doing this from
  windows is possible, but I don't have jdk/include/linux, just jdk/
  include/win32, so that's throwing me.

  Second, I am at step 6, and am attempting to use arm-none-linux-
  gnueabi-gcc.
  $ arm-none-linux-gnueabi-gcc  -I/cygdrive/c/Program\ Files/Java/
  jdk1.6.0_04/include/ -I/cygdrive/c/Program\ Files/Java/jdk1.6.0_04/
  include/win32/  -fpic -c org_apache_NativeAdd.c

  In file included from org_apache_NativeAdd.c:1:
  org_apache_NativeAdd.h:2:17: error: jni.h: No such file or directory
  In file included from org_apache_NativeAdd.c:1:
  org_apache_NativeAdd.h:15: error: expected '=', ',', ';', 'asm' or
  '__attribute__' before 'jlong'
  org_apache_NativeAdd.c:3: error: expected '=', ',', ';', 'asm' or
  '__attribute__' before 'jlong'

  Ok. Cygwin + arm-none-linux-gnueabi-gcc didn't want to seem to include
  anything like that, so I just flat out copied over the contents, and
  it was happy to include them. Unfortunately, it didn't want to build
  them, giving me other errors like those seen above.

  What do I have set up incorrectly for building JNI?- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Text2Speech now hosted at google code

2008-08-22 Thread l1ghtm4n

I've decided to open source the Text2Speech project for Android. The
code can be found at http://code.google.com/p/android-text2speech/.
The ultimate goal of the project is to become the standard for
Text2Speech services on the Android platform.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread code_android_festival_way

So if I'm understanding you right I HAVE to interrupt the work that is
done in the background thread. That will be difficult, it is not just
the download of information. I'm setting a geo search at flickr,
handling the response and so on and so on. Finally giving back some
links (to photos) which will be downloaded and shown in the GUI of the
activity. Isnt't there a possibility to surround the whole hard work
by a try / catch clause (or something similar) which will be invoked
when I interrupt the thread? And so I could stop the thread nicely.

Regards!



On 22 Aug., 21:23, Mark Murphy [EMAIL PROTECTED] wrote:
  Well the thread is doing something at the moment I want him to be
  killed. (he is downloading pictures which will be shown in the gui
  later on) So I've looked at your example but don't understand how I
  should implement that in my thread. I just want him to stop what he is
  doing because after leaving the activity I dont need that data any
  more.

 I'm not real certain myself, in part because I don't have much experience
 with the new HttpCore/HttpClient bits. I had used the previous edition of
 HttpClient many a time, well before Android, but I hadn't had the need
 until now to get into the newer edition.

 My recommendation is to poke around the HTTP classes you're using and see
 how best to interrupt your download when you need the thread to unwind.
 When you tell your service to stop, it really interrupts the download and
 lets that thread wrap up before the service completely stops.

  Could the problem be that I'm binding in the activity onStart() but
  using the binded service happens in the started background thread?

 Possibly, but from your original post, I got the impression the error was
 due to the thread itself. I may be mis-interpreting that message, though.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-08-22 Thread Manu

Here is the stack trace log output for
StackTraceElement stack[]=e.getStackTrace();
  for(StackTraceElement i:stack)
  {
android.util.Log.v(!!!,i.getClassName()+:+i.getMethodName()
+:+i.getLineNumber());
  }

I/ActivityManager(   51): Annotation: Broadcast of Intent
{ action=android.provider.Telephony.SMS_RECEIVED comp={org.mano/
org.mano.SMSApp} (has extras) }

I/ActivityManager(   51): CPU usage:

I/ActivityManager(   51): Load: 1.11 / 0.74 / 0.57

I/ActivityManager(   51): CPU usage from 11886ms to 590ms ago:

I/ActivityManager(   51):   org.mano: 46% = 41% user + 5% kernel

I/ActivityManager(   51):   system_server: 20% = 15% user + 5% kernel

I/ActivityManager(   51):   mediaserver: 7% = 5% user + 2% kernel

I/ActivityManager(   51):   com.android.phone: 6% = 4% user + 2%
kernel

I/ActivityManager(   51):   com.android.mms: 4% = 3% user + 1% kernel

I/ActivityManager(   51):   android.process.shared: 3% = 2% user + 1%
kernel

I/ActivityManager(   51):   adbd: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   android.process.media: 0% = 0% user + 0%
kernel

I/ActivityManager(   51):   logcat: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   rild: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   events/0: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   pdflush: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   servicemanager: 0% = 0% user + 0% kernel

I/ActivityManager(   51):   qemud: 0% = 0% user + 0% kernel

I/ActivityManager(   51): TOTAL: 94% = 76% user + 17% kernel + 0%
softirq

I/ActivityManager(   51):

I/ActivityManager(   51): /proc/meminfo:

I/ActivityManager(   51): MemTotal:94572 kB

I/ActivityManager(   51): MemFree: 10324 kB

I/ActivityManager(   51): Buffers: 0 kB

I/ActivityManager(   51): Cached:  44648 kB

I/ActivityManager(   51): SwapCached:  0 kB

I/ActivityManager(   51): Active:  49832 kB

I/ActivityManager(   51): Inactive:26576 kB

I/ActivityManager(   51): SwapTotal:   0 kB

I/ActivityManager(   51): SwapFree:0 kB

I/ActivityManager(   51): Dirty:   0 kB

I/ActivityManager(   51): Writeback:   0 kB

I/ActivityManager(   51): AnonPages:   31760 kB

I/ActivityManager(   51): Mapped:  21600 kB

I/ActivityManager(   51): Slab: 3004 kB

I/ActivityManager(   51): SReclaimable:  600 kB

I/ActivityManager(   51): SUnreclaim:   2404 kB

I/ActivityManager(   51): PageTables:   2432 kB

I/ActivityManager(   51): NFS_Unstable:0 kB

I/ActivityManager(   51): Bounce:  0 kB

I/ActivityManager(   51): CommitLimit: 47284 kB

I/ActivityManager(   51): Committed_AS:   871240 kB

I/ActivityManager(   51): VmallocTotal:   876544 kB

I/ActivityManager(   51): VmallocUsed: 10436 kB

I/ActivityManager(   51): VmallocChunk:   855036 kB

I/ActivityManager(   51): Removing old ANR trace file from /data/anr/
traces.txt

I/Process (   51): Sending signal. PID: 242 SIG: 3

I/Process (   51): Sending signal. PID: 109 SIG: 3

I/dalvikvm(  242): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 94 SIG: 3

I/dalvikvm(   94): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 163 SIG: 3

I/dalvikvm(  163): threadid=7: reacting to signal 3

I/dalvikvm(  109): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 145 SIG: 3

I/dalvikvm(  145): threadid=7: reacting to signal 3

I/Process (   51): Sending signal. PID: 51 SIG: 3

I/dalvikvm(   51): threadid=7: reacting to signal 3

I/dalvikvm(  163): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(  109): Wrote stack trace to '/data/anr/traces.txt'

I/dalvikvm(  242): Wrote stack trace to '/data/anr/traces.txt'

V/!!! (  242):
com.google.gdata.client.GoogleAuthTokenFactory:getAuthToken:-1

V/!!! (  242):
com.google.gdata.client.GoogleAuthTokenFactory:setUserCredentials:-1

V/!!! (  242):
com.google.gdata.client.GoogleService:setUserCredentials:-1

V/!!! (  242):
com.google.gdata.client.GoogleService:setUserCredentials:-1

V/!!! (  242): org.mano.SMSApp:markCalendar:75

V/!!! (  242): org.mano.SMSApp:onReceive:52

V/!!! (  242): android.app.ActivityThread:handleReceiver:2271

V/!!! (  242): android.app.ActivityThread:access$2700:112

V/!!! (  242): android.app.ActivityThread$H:handleMessage:1620

V/!!! (  242): android.os.Handler:dispatchMessage:88

V/!!! (  242): android.os.Looper:loop:123

V/!!! (  242): android.app.ActivityThread:main:3708

V/!!! (  242): java.lang.reflect.Method:invokeNative:-2

V/!!! (  242): java.lang.reflect.Method:invoke:492

V/!!! (  242): com.android.internal.os.ZygoteInit
$MethodAndArgsCaller:run:734

I/dalvikvm(   51): Wrote stack trace to '/data/anr/traces.txt'

V/!!! (  242): com.android.internal.os.ZygoteInit:main:492

V/!!! (  242): dalvik.system.NativeStart:main:-2

V/### (  242): 

[android-developers] Re: Exception when leaving an activity (with the back button) which is binded to a Service

2008-08-22 Thread Mark Murphy

 So if I'm understanding you right I HAVE to interrupt the work that is
 done in the background thread.

If Thread#interrupt() isn't working, then yes. See below...

 That will be difficult, it is not just
 the download of information. I'm setting a geo search at flickr,
 handling the response and so on and so on. Finally giving back some
 links (to photos) which will be downloaded and shown in the GUI of the
 activity.

How long are each one of those operations? If they're each fairly short,
check some flag you set to see if the thread needs to unwind after every
step and abandon the rest of the work at that point.

You may be able to simplify some of this by moving the background thread
into the service and using other means (e.g., broadcasting Intents) to let
the activity know when stuff is ready.

 Isnt't there a possibility to surround the whole hard work
 by a try / catch clause (or something similar) which will be invoked
 when I interrupt the thread? And so I could stop the thread nicely.

Its called Thread#interrupt() and you tried that. You can see a trivial
sample code of its use here:

http://www.java2s.com/Code/Java/Threads/Threadsleepandinterrupt.htm

I was under the impression is was not giving you control back. Off the top
of my head, I can think of three possibilities for that, though there may
be more:

1. Dalvik doesn't raise an InterruptedException the way Java does

2. Dalvik does raise an InterruptedException in certain cases (e.g., the
Thread is blocked on wait() or sleep()), but that's not the state the
Thread is in at the time you call interrupt() (e.g., the Thread is in a
true busy loop somewhere in the bowels of the libraries you're using)

3. Dalvik does raise an InterruptedException, but it's getting caught and
eaten before it gets to you, perhaps due to an over-aggressive exception
handler

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Crash reading by 16384 of file

2008-08-22 Thread Jon Webb

I keep getting a crash (reading NUL which is not in the file) when I
try to read a file into my app. The crash occurs at byte 16384 of the
file. I assume this is some sort of buffering error because the buffer
size is 8192. I posted an app on the issue list (http://
code.google.com/p/android/issues/detail?id=811) but no replay so far.
People seem to be getting responses here, so maybe this will work.
My app works in J2ME and J2SE. It is just on the Android emulator that
it doesn't. I had the same problem in the February / March SDK, and
reported the bug then.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Using the Emulator with a Proxy - 0.9 Beta SDK Windows Eclipse 3.4

2008-08-22 Thread Manish Pandit

On Aug 22, 11:45 am, Megha Joshi [EMAIL PROTECTED] wrote:
 This thread has some good info on proxy config...
 Could one of you please add this  to the porting docs..whenever you find
 time..Thanks!
 On Thu, Aug 21, 2008 at 11:15 PM, Manish Pandit [EMAIL PROTECTED]wrote:

Hi Megha - I've updated the porting tips doc with the information.
Hope this helps.

-cheers,
Manish
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Using the Emulator with a Proxy - 0.9 Beta SDK Windows Eclipse 3.4

2008-08-22 Thread Megha Joshi
Thanks :)

On Fri, Aug 22, 2008 at 1:43 PM, Manish Pandit [EMAIL PROTECTED]wrote:


 On Aug 22, 11:45 am, Megha Joshi [EMAIL PROTECTED] wrote:
  This thread has some good info on proxy config...
  Could one of you please add this  to the porting docs..whenever you find
  time..Thanks!
  On Thu, Aug 21, 2008 at 11:15 PM, Manish Pandit [EMAIL PROTECTED]
 wrote:

 Hi Megha - I've updated the porting tips doc with the information.
 Hope this helps.

 -cheers,
 Manish
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: [v0.9 beta] text color won't change for TextView.setEnabled(false)

2008-08-22 Thread Jeff Hamilton

How did you define the TextView in your layout file? Are you using one
of the standard textAppearance values?

-Jeff

On Fri, Aug 22, 2008 at 2:17 AM, samlu [EMAIL PROTECTED] wrote:

 When I called setEnabled(false) for a TextView object on m5-rc15, the
 text color will be changed to gray (or dim).

 After switching to v0.9, it seems that all view object won't change
 color when I call setEnabled(false).

 Does anyone know how to fix this problem?

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problems Sending SMS Text Messages in 0.9

2008-08-22 Thread Megha Joshi
On Fri, Aug 22, 2008 at 3:34 AM, Reto [EMAIL PROTECTED] wrote:


 Has anyone had success sending SMS text messages in the new 0.9 beta?

 The following code used to work fine, but now I'm getting a null
 pointer exception on calling sendTextMessage:

  SmsManager smsManager = SmsManager.getDefault();
  String myMessage = Android supports programmatic SMS messaging!;
  String sendTo = 55512345;


  smsManager.sendTextMessage(sendTo, null, myMessage, null, null);

 I've added permissions for both SEND_SMS and WRITE_SMS in the manifest.



What is the error message in logcat?

Android supports sending SMS between two emulators...
If you start two emulators and replace the sendTo string with the port
number of the second emulator( assuming you are starting this app from first
emulator) ...you will see SMS received notification pop up in the second
emulator ...




 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Instrumentation failing with classnotfound on android.test.InstrumentationTestRunner

2008-08-22 Thread Megha Joshi
Did you notice there is one more AndroidManifest.xml file under the /tests
folder in ApiDemos...perhaps you are missing that...
We will add more information to the docs ...

On Fri, Aug 22, 2008 at 4:50 AM, Carl H. [EMAIL PROTECTED] wrote:


 Note that the cmd line is:

 adb shell am instrument -e class com.novoda.runbuddy.AllTests -w
 com.novoda.runbuddy/android.test.InstrumentationTestRunner

 and not as previously stated:
  adb shell am instrument -e class com.android.samples.AllTests -w
 com.novoda.runbuddy/android.test.InstrumentationTestRunner

 The error is still apparent




 On Aug 22, 12:18 pm, Carl H. [EMAIL PROTECTED] wrote:
  Hello,
 
  I am trying to follow the post on ApplicationInstrumentation:
 http://code.google.com/android/samples/ApiDemos/tests/src/com/android...http://code.google.com/android/samples/ApiDemos/tests/src/com/android.
 ..
 
  My setup is very similar then the example. I have the following in my
  manifest:
  instrumentation xmlns:android=
 http://schemas.android.com/apk/res/
  android
  android:targetPackage=com.novoda.runbuddy
  android:name=android.test.InstrumentationTestRunner
  android:label=testInst /
 
  And I start the instrumentation like this:
   adb shell am instrument -e class com.android.samples.AllTests -w
  com.novoda.runbuddy/android.test.InstrumentationTestRunner
 
  I get the following error message:
  INSTRUMENTATION_RESULT: shortMsg=Unable to instantiate instrumentation
  ComponentInfo{com.novoda.runbuddy/
  android.test.InstrumentationTestRunner}:
  java.lang.ClassNotFoundException:
  android.test.InstrumentationTestRunner in loader
  [EMAIL PROTECTED]
  INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to
  instantiate instrumentation ComponentInfo{com.novoda.runbuddy/
  android.test.InstrumentationTestRunner}:
  java.lang.ClassNotFoundException:
  android.test.InstrumentationTestRunner in loader
  [EMAIL PROTECTED]
  INSTRUMENTATION_CODE: 0
 
  I tried different combination and can not make the above work. The
  documentation is sparse so I am not sure where I am going wrong. Why
  would I get a class not found on android.test? There is no need for
  permission from what I take with the new SDK.
 
  Any ideas?
  ./Acsia
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: More camera misery with SDK 0.9 beta

2008-08-22 Thread Megha Joshi
There is no way to convert the preview frames that come as YUV data from
Camera.SetPrivewCallBack() into a bitmap.To draw the preview frames, you can
call Camera.startPreview() and the system takes care of the drawing.
CameraPreview sample code in ApiDemos is updated to use startPreview() now.


On Fri, Aug 22, 2008 at 4:50 AM, blindfold [EMAIL PROTECTED]wrote:


 I am trying to acquire camera preview images through
 onPreviewFrame(byte[] data, Camera c)  and, within this callback
 function, BitmapFactory.decodeByteArray(data, 0, data.length). The
 callback works and does get called as shown by my debug output.
 However, the Eclipse log file  shows error messages tagged by
 CameraHardwareStub stating that only yuv422sp preview is  supported,
 e.g., if I apply setPreviewFormat() to set PixelFormat.RGB_565 or
 PixelFormat.JPEG. BitmapFactory.decodeByteArray indeed returns null as
 expected under this pixel format restriction.

 Now I do not find support for something like PixelFormat.YUV_422_SP
 for use with  BitmapFactory.decodeByteArray. There is
 PixelFormat.YCbCr_422_SP, but with that,
 BitmapFactory.decodeByteArray(data, 0, data.length) still returns
 null. What's wrong? Is  Android lacking a set of compatible image
 formats across the various Camera and Bitmap APIs? That would be bad.

 Moreover, data.length in the callback is twice the number of pixels,
 implying a 16 bits per  pixel encoding, while yuv422sp would seem to
 be an 8 bit encoding?

 So what should be done here to decode preview images into a Bitmap for
 further image  processing? Or is there an alternative decent way to
 map camera preview images into a Bitmap? A working example would help!

 Thanks.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: is there a way to install back the SDK m5-rc15 after upgrading into 0.9 beta

2008-08-22 Thread Megha Joshi
On Fri, Aug 22, 2008 at 5:16 AM, drik_wen [EMAIL PROTECTED] wrote:


 I get a lot problem after upgrading my SDK to 0.9 beta..
 I can't launch my program..
 is there a way to install back to the SDK m5-rc15??


It is not recommended to use m5, please use 0.9 beta...
Post your issues here and we will help you fix your errors :)


 a lil bit hurry..
 thx in advanced..

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multipart Messages - Is there an example how to get them work now. (Uploading to a web API)

2008-08-22 Thread barbapapaz

Hello

I has the same problem and your post resolt it!

thanks

On 22 août, 09:01, code_android_festival_way
[EMAIL PROTECTED] wrote:
 Hello!

 I have done it the following way:

 http://paste.pocoo.org/show/GwHe8LrG9DCnq4zuphmK/

 (note that this is just a sample code the HttpClient needs some
 setup)

 Using it this way multipart messages work quite fine.

 Regards!

 On 22 Aug., 07:16, shotwave [EMAIL PROTECTED] wrote:

  I also have problems with multipart entities, so I have followed the
  recomendations given here and added mime4j and httpmime as the
  libraries to my eclipse project, however once I have started the app
  and tried to upload some data I have got an exception

  08-22 01:11:12.672: WARN/dalvikvm(229): VFY: unable to resolve new-
  instance 255 (Lorg/apache/commons/io/output/ByteArrayOutputStream;) in
  Lorg/apache/http/entity/mime/HttpMultipart;
  08-22 01:11:12.682: WARN/dalvikvm(229): VFY:  rejecting opcode 0x22 at
  0x0031
  08-22 01:11:12.692: WARN/dalvikvm(229): VFY:  rejected Lorg/apache/
  http/entity/mime/HttpMultipart;.getTotalLength ()J
  08-22 01:11:12.692: WARN/dalvikvm(229): Verifier rejected class Lorg/
  apache/http/entity/mime/HttpMultipart;
  08-22 01:11:12.722: WARN/System.err(229): java.lang.VerifyError:
  org.apache.http.entity.mime.HttpMultipart
  08-22 01:11:12.782: WARN/System.err(229):     at
  org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
  76)
  08-22 01:11:12.852: WARN/System.err(229):     at
  org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
  99)
  08-22 01:11:12.862: WARN/System.err(229):     at
  com.sphericbox.jigsaw.LoginActivity
  $YesClickListener.onClick(LoginActivity.java:78)
  08-22 01:11:12.862: WARN/System.err(229):     at
  android.view.View.performClick(View.java:2068)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.View.onTouchEvent(View.java:3453)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.widget.TextView.onTouchEvent(TextView.java:4347)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.View.dispatchTouchEvent(View.java:3108)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.902: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.902: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.912: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow
  $DecorView.superDispatchTouchEvent(PhoneWindow.java:1552)
  08-22 01:11:12.912: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
  1059)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.app.Activity.dispatchTouchEvent(Activity.java:1872)
  08-22 01:11:12.932: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow
  $DecorView.dispatchTouchEvent(PhoneWindow.java:1536)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1088)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.os.Handler.dispatchMessage(Handler.java:88)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.os.Looper.loop(Looper.java:123)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.app.ActivityThread.main(ActivityThread.java:3708)
  08-22 01:11:12.962: WARN/System.err(229):     at
  java.lang.reflect.Method.invokeNative(Native Method)
  08-22 01:11:12.972: WARN/System.err(229):     at
  java.lang.reflect.Method.invoke(Method.java:492)
  08-22 01:11:12.972: WARN/System.err(229):     at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:734)
  08-22 01:11:12.972: WARN/System.err(229):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
  08-22 01:11:12.972: WARN/System.err(229):     at
  dalvik.system.NativeStart.main(Native Method)

  could you pls help me with that?

  On Aug 18, 8:11 pm, Justin (Google Employee) [EMAIL PROTECTED]
  wrote:

   Looks like you also need the Apache Commons IO library which you can
   get fromhttp://commons.apache.org/io/.

   Cheers,
   Justin
   Android Team @ Google

   On Aug 18, 3:19 pm, code_android_festival_way

   [EMAIL PROTECTED] wrote:
So I'm back with a question. I've imported the libraries mentioned
above and got the following setup:

   http://paste.pocoo.org/show/82631/

Now I get an error while executing the POST method with the
HttpClient. Am I doing sth. wrong or what do I have to change to 

[android-developers] Re: showAlert in latest SDK

2008-08-22 Thread Megha Joshi
showAlert() is removed from the latest SDK. You should use AlertDialog for
dialogs...
See sample code below:
http://code.google.com/android/samples/ApiDemos/src/com/android/samples/app/AlertDialogSamples.html

On Fri, Aug 22, 2008 at 11:08 AM, Mark Hansen [EMAIL PROTECTED] wrote:


 I've been going over a bunch of examples and for the life of me can't
 figure out how to get showAlert to generate a dialog.

 I'm fairly new to both Android and Java development so I could easily
 be missing something, but I'm stumped.

 This is the menu option selected override in a class that is
 overriding ListActivity (I'm wondering if that isn't the issue?)

 Thanks,
 Mark


@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId()) {
case 0:
showAlert(Menu Item,New
 Post,ok,null,false,null);
return true;
case 1:
showAlert(Menu
 Item,Refresh,ok,null,false,null);
fillDataSAX();
return true;
case 2:
showAlert(Menu
 Item,Settings,ok,null,false,null);
return true;
}
return false;
}

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity Question

2008-08-22 Thread Justin (Google Employee)

I've replicated the behavior you're seeing, and it seems anomalous, so
I'll keep looking at it.

Cheers,
Justin
Android Team @ Google

On Aug 22, 12:20 pm, Gil [EMAIL PROTECTED] wrote:
 It turns out that singleTask is what I need in my app for my main
 (LAUNCHER) activity otherwise sometimes I end up with multiple
 instances of my activities.

 On Aug 22, 10:33 am, Gil [EMAIL PROTECTED] wrote:

  If I use singleTop for both activities the code works as expected.
  The singleTask launchMode is causing the behavior described
  above.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: showAlert in latest SDK

2008-08-22 Thread Randy McEoin

What follows is how I did it.   The part that was not obvious from the
sample code was the need for show().  Note that you can skip the
setIcon() and it'll use a default one.  And you can skip the
setPositiveButton(), but then the user needs to hit the back button to
clear the dialog.   showAlert() was nice, but AlertDialog is much more
versatile.

 public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case 0:
Dialog about = new AlertDialog.Builder(CIDRCalculator.this)
.setIcon(R.drawable.icon)
.setTitle(R.string.about_dialog_title)
.setPositiveButton(R.string.about_dialog_ok, null)
.setMessage(CIDR Calc\nCopyright 2008\nRandy McEoin)
.create();
about.show();
 return true;
}
 return false;
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Can MediaRecoder record audio in wave format?

2008-08-22 Thread Justin (Google Employee)

Output formats are in the documentation at
http://code.google.com/android/reference/android/media/MediaRecorder.OutputFormat.html
I think you probably can't test this in the emulator.

Cheers,
Justin
Android Team @ Google

On Aug 22, 9:50 am, april [EMAIL PROTECTED] wrote:
 How to set the MediaRecorder to record in specified format? such as
 wav format. In emulator, how can we test record functionality without
 hardware?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Images from Google Chart API

2008-08-22 Thread Justin (Google Employee)

Yes.

import java.net.URL;
import android.graphics.Bitmap;
import android.widget.ImageView;

URL img = new URL(http://chart.apis.google.com/chart?
chs=460x230chd=t:62cht=pchl=Google);
ImageView imgViewer = new ImageView(this);
imgViewer.setImageBitmap(Bitmap.decodeStream(img.openStream());

Cheers,
Justin
Android Team @ Google

On Aug 22, 9:52 am, dai [EMAIL PROTECTED] wrote:
 Ciao, can anyhone get image files from Google Chart API?
 I'm trying to get image 
 fromhttp://chart.apis.google.com/chart?chs=460x230chd=t:62cht=pchl=Google,
 but I could not do well..

 Any hints on this...?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons

2008-08-22 Thread Justin (Google Employee)

I don't really understand what you want to do here. If you want a view
with an EditText area and a couple of Buttons, just create a view with
those things in them.

I'm not sure why this needs to be an AlertDialog. The AlertDialog is
really just a convenience class for for creating a common type of
view. I haven't looked at the Browser source, but my guess is that its
not using the AlertDialog class, it creating its own view that just
looks similar.

Cheers,
Justin
Android Team @ Google

On Aug 22, 10:37 am, webmonkey [EMAIL PROTECTED] wrote:
 Hello Justin,

 Thanks for your response, but I already checked these samples and I
 know how to build dialogs using the AlertDialog class. The thing is, I
 usually call AlertDialog inside an existing activity, for example to
 create a delete confirmation dialog. But now I want the entire
 activity to be the dialog. ( so I can handle an ACTION_EDIT intent
 that works on my custom content provider )

 From the logs, I can tell that the Browser app calls a separate intent
 to add a bookmark, but the entire bookmark activity is displayed as a
 dialog, complete with title and buttons panel. How do I do this?

 I hope you understand what I am trying to achieve.

 Thanks

 On Aug 22, 7:09 pm, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:

  APIDemos  App  Dialog

  Cheers,
  Justin
  Android Team @ Google

  On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote:

   How do I create a dialog activity that looks exactly the same as when
   you build a dialog with the AlertDialog class, including the buttons
   panel at the bottom.

   Basically, I want the same sort of activity that you get when you add
   a Bookmark in the Browser app.

   I checked the APIDemos  Activity  Dialog sample but it is missing
   the panel with the buttons.

   Thanks- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: More camera misery with SDK 0.9 beta

2008-08-22 Thread blindfold

Thanks Megha. So the byte[] data provided by onPreviewFrame() is
effectively useless, because there is no efficient means of converting
into a format that the rest of Android understands. Strange API
design...

I have now successfully used onPictureTaken() instead of
onPreviewFrame(), because that one does have proper image format
support, but this is likely going to run much less efficiently on real
phones because it is meant for (slow) megapixel snapshots, and I need
to take a (small) snapshot every second. Please reconsider the image
formats used in onPreviewFrame() in relation to the image formats that
Android supports, because it is quite weird to offer data in a format
that cannot be used, and for which the format is not even documented
(so every phone manufacturer can pick an arbitrary format that we
developers then need to reverse engineer).

 To draw the preview frames, you can call Camera.startPreview() and the system 
 takes care of the drawing.

I'm after computer vision applications, so mere drawing is not enough.
BTW, as I reported before, the camera preview is stuck at the top left
of the screen because there is no method for specifying its location.
I wished the API designers had a look at J2ME first.

Thanks.

On Aug 23, 12:10 am, Megha Joshi [EMAIL PROTECTED] wrote:
 There is no way to convert the preview frames that come as YUV data from
 Camera.SetPrivewCallBack() into a bitmap.To draw the preview frames, you can
 call Camera.startPreview() and the system takes care of the drawing.
 CameraPreview sample code in ApiDemos is updated to use startPreview() now.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Overlay

2008-08-22 Thread Peter Stevenson

hi

I trying to work out how Overlay works,
any help would be greatly appreciated

Peter

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Images from Google Chart API

2008-08-22 Thread dai

Thank you for your sample code, justin. It's working well ;)


On 8月23日, 午前8:57, Justin (Google Employee) [EMAIL PROTECTED] wrote:
 Yes.

 import java.net.URL;
 import android.graphics.Bitmap;
 import android.widget.ImageView;

 URL img = new URL(http://chart.apis.google.com/chart?
 chs=460x230chd=t:62cht=pchl=Google);
 ImageView imgViewer = new ImageView(this);
 imgViewer.setImageBitmap(Bitmap.decodeStream(img.openStream());

 Cheers,
 Justin
 Android Team @ Google

 On Aug 22, 9:52 am, dai [EMAIL PROTECTED] wrote:

  Ciao, can anyhone get image files from Google Chart API?
  I'm trying to get image 
  fromhttp://chart.apis.google.com/chart?chs=460x230chd=t:62cht=pchl=Google,
  but I could not do well..

  Any hints on this...?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: showAlert in latest SDK

2008-08-22 Thread Mark Hansen

Ahh ok, thanks guys, works great..

On Aug 22, 7:39 pm, Randy McEoin [EMAIL PROTECTED] wrote:
 What follows is how I did it.   The part that was not obvious from the
 sample code was the need for show().  Note that you can skip the
 setIcon() and it'll use a default one.  And you can skip the
 setPositiveButton(), but then the user needs to hit the back button to
 clear the dialog.   showAlert() was nice, but AlertDialog is much more
 versatile.

  public boolean onOptionsItemSelected(MenuItem item){
         switch (item.getItemId()) {
         case 0:
                 Dialog about = new AlertDialog.Builder(CIDRCalculator.this)
                         .setIcon(R.drawable.icon)
                         .setTitle(R.string.about_dialog_title)
                         .setPositiveButton(R.string.about_dialog_ok, null)
                         .setMessage(CIDR Calc\nCopyright 2008\nRandy McEoin)
                         .create();
                 about.show();
          return true;
         }
      return false;
     }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: [v0.9 beta] text color won't change for TextView.setEnabled(false)

2008-08-22 Thread samlu

This is the TextView object defined in layout file.

TextView android:id=@+id/txtResults
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:background=#A0
  android:textColor=#FF /

In addition, no theme specified for activity in Manifest.xml. I only
use the default theme.
Sam

On Aug 23, 5:29 am, Jeff Hamilton [EMAIL PROTECTED] wrote:
 How did you define the TextView in your layout file? Are you using one
 of the standard textAppearance values?

 -Jeff

 On Fri, Aug 22, 2008 at 2:17 AM, samlu [EMAIL PROTECTED] wrote:

  When I called setEnabled(false) for a TextView object on m5-rc15, the
  text color will be changed to gray (or dim).

  After switching to v0.9, it seems that all view object won't change
  color when I call setEnabled(false).

  Does anyone know how to fix this problem?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Multipart Messages - Is there an example how to get them work now. (Uploading to a web API)

2008-08-22 Thread shotwave

thank you, guys

On Aug 22, 3:01 am, code_android_festival_way
[EMAIL PROTECTED] wrote:
 Hello!

 I have done it the following way:

 http://paste.pocoo.org/show/GwHe8LrG9DCnq4zuphmK/

 (note that this is just a sample code the HttpClient needs some
 setup)

 Using it this way multipart messages work quite fine.

 Regards!

 On 22 Aug., 07:16, shotwave [EMAIL PROTECTED] wrote:

  I also have problems with multipart entities, so I have followed the
  recomendations given here and added mime4j and httpmime as the
  libraries to my eclipse project, however once I have started the app
  and tried to upload some data I have got an exception

  08-22 01:11:12.672: WARN/dalvikvm(229): VFY: unable to resolve new-
  instance 255 (Lorg/apache/commons/io/output/ByteArrayOutputStream;) in
  Lorg/apache/http/entity/mime/HttpMultipart;
  08-22 01:11:12.682: WARN/dalvikvm(229): VFY:  rejecting opcode 0x22 at
  0x0031
  08-22 01:11:12.692: WARN/dalvikvm(229): VFY:  rejected Lorg/apache/
  http/entity/mime/HttpMultipart;.getTotalLength ()J
  08-22 01:11:12.692: WARN/dalvikvm(229): Verifier rejected class Lorg/
  apache/http/entity/mime/HttpMultipart;
  08-22 01:11:12.722: WARN/System.err(229): java.lang.VerifyError:
  org.apache.http.entity.mime.HttpMultipart
  08-22 01:11:12.782: WARN/System.err(229):     at
  org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
  76)
  08-22 01:11:12.852: WARN/System.err(229):     at
  org.apache.http.entity.mime.MultipartEntity.init(MultipartEntity.java:
  99)
  08-22 01:11:12.862: WARN/System.err(229):     at
  com.sphericbox.jigsaw.LoginActivity
  $YesClickListener.onClick(LoginActivity.java:78)
  08-22 01:11:12.862: WARN/System.err(229):     at
  android.view.View.performClick(View.java:2068)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.View.onTouchEvent(View.java:3453)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.widget.TextView.onTouchEvent(TextView.java:4347)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.View.dispatchTouchEvent(View.java:3108)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.872: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.902: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.902: WARN/System.err(229):     at
  android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
  08-22 01:11:12.912: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow
  $DecorView.superDispatchTouchEvent(PhoneWindow.java:1552)
  08-22 01:11:12.912: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
  1059)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.app.Activity.dispatchTouchEvent(Activity.java:1872)
  08-22 01:11:12.932: WARN/System.err(229):     at
  com.android.internal.policy.impl.PhoneWindow
  $DecorView.dispatchTouchEvent(PhoneWindow.java:1536)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1088)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.os.Handler.dispatchMessage(Handler.java:88)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.os.Looper.loop(Looper.java:123)
  08-22 01:11:12.932: WARN/System.err(229):     at
  android.app.ActivityThread.main(ActivityThread.java:3708)
  08-22 01:11:12.962: WARN/System.err(229):     at
  java.lang.reflect.Method.invokeNative(Native Method)
  08-22 01:11:12.972: WARN/System.err(229):     at
  java.lang.reflect.Method.invoke(Method.java:492)
  08-22 01:11:12.972: WARN/System.err(229):     at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:734)
  08-22 01:11:12.972: WARN/System.err(229):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
  08-22 01:11:12.972: WARN/System.err(229):     at
  dalvik.system.NativeStart.main(Native Method)

  could you pls help me with that?

  On Aug 18, 8:11 pm, Justin (Google Employee) [EMAIL PROTECTED]
  wrote:

   Looks like you also need the Apache Commons IO library which you can
   get fromhttp://commons.apache.org/io/.

   Cheers,
   Justin
   Android Team @ Google

   On Aug 18, 3:19 pm, code_android_festival_way

   [EMAIL PROTECTED] wrote:
So I'm back with a question. I've imported the libraries mentioned
above and got the following setup:

   http://paste.pocoo.org/show/82631/

Now I get an error while executing the POST method with the
HttpClient. Am I doing sth. wrong or what do I have to change to get
it working. (the paste above is cutted 

  1   2   >