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

2008-11-05 Thread [EMAIL PROTECTED]

Yes that's what I see everywhere. but, i can't change my API or
cartificate...
So I'm destine to search  search solution...

I try to put a certificate in keystore, and to load it from my app.
but i have an IOexception : Wrong verion of Key Store.
I really don't understand.

Source :
KeyStore trustStore  =
KeyStore.getInstance(KeyStore.getDefaultType());//
KeyStore.getDefaultType()
FileInputStream in =  new FileInputStream(new File(data/data/
com.alu.myic.android/my.trustore3));
try {
  trustStore.load(in, coucou.toCharArray());
} finally {
  in.close();
}
SSLSocketFactory socketFactory = new SSLSocketFactory(trustStore);
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme(https, socketFactory, 443));


regards,
SC

On 4 nov, 10:09, Guillaume Perrot [EMAIL PROTECTED] wrote:
 We have a trusted one at our software company which is working but I wanted
 to add an option to trust self signed certificate in the application.
 I still don't have a solution for that, except using URLConnection API which
 works well with the AllowAllHostnameVerifier. The problem is with the
 HTTPClient API.

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



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

  thx

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

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

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

2008/10/23 Sean Sullivan [EMAIL PROTECTED]

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

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

 Sean

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

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

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

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

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

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

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

  I have the following exception in stack trace:

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

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

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

2008-11-05 Thread hackbod

On Nov 4, 8:06 pm, for android [EMAIL PROTECTED] wrote:
 Also i would like to know what you mean by the view heirarchy is too
 big..I have assumed that the view heirarchy can any be as complex as it can
 get.Is it a fair assumption.

No, calls go down the view hierarchy, so a very deep hierarchy can
overflow the stack.  You also want to keep your hierarchy as simple as
possible just for plain performance reasons.

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



[android-developers] Re: Creating libraries for android

2008-11-05 Thread hackbod

Sorry, this isn't really supported.  You can only create static
libraries, without resources, that are bundled into each .apk that
uses them.

On Nov 4, 8:50 pm, fabcasa [EMAIL PROTECTED] wrote:
 What is the easiest way to create libraries to share across my android
 applications.  I have been creating a simple java project; however I
 do not get a default res folder for holding assets.  I want library
 project to hold assets for layouts, and media for skinning.  I any
 architecture advice is greatly appreciated, thanks :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2008-11-05 Thread for android
So how exactly do I decide that the hierarchy is very deep or not? is it
something quantifiable?


Thanks


On Wed, Nov 5, 2008 at 1:35 PM, hackbod [EMAIL PROTECTED] wrote:


 On Nov 4, 8:06 pm, for android [EMAIL PROTECTED] wrote:
  Also i would like to know what you mean by the view heirarchy is too
  big..I have assumed that the view heirarchy can any be as complex as it
 can
  get.Is it a fair assumption.

 No, calls go down the view hierarchy, so a very deep hierarchy can
 overflow the stack.  You also want to keep your hierarchy as simple as
 possible just for plain performance reasons.

 


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



[android-developers] Re: startService() fails

2008-11-05 Thread donm

Hi Hackbod,

thanks for your reply. I finally made it work. The Component name was
wrong and
also s.th. with the packages. Checking the logs was a good advice!

So long,

Martin

On Oct 29, 5:19 pm, hackbod [EMAIL PROTECTED] wrote:
 Whatever is going on has nothing to do with AIDL, since apparently you
 aren't even connecting to the service.  There are two service examples
 in API demos that you can look at for help.

 You should always look in the log when getting errors to see if there
 are more details printed about what happened.

 Btw, the package name dom.da is probably not correct for you to
 use.  You need to use a package name for some domain you have control
 over.


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



[android-developers] Re: Improved support for camera on Android emulator.

2008-11-05 Thread blindfold

Amen! Moreover, there are important and undocumented differences
between emulator and G1 with respect to camera based image processing.
I think that currently every Android developer who is using the camera
for input is heavily frustrated, while the Android Team has not given
any hint of when the various camera related problems will be fixed.
I've had to pull my camera app off the market because of too many
problems with the G1 camera.

Regards

On Nov 5, 2:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I was wondering if anyone has any information on when we could expect
 improved camera support for the Android emulator, ie being able to
 capture pictures and video input on the emulator. I know this is a
 critical issue for many of us. Thanks in advance.

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



[android-developers] Permission Denied

2008-11-05 Thread ssk

Hi All,
  I am invoking a new activity ACTION_MAIN from my app.Now
using SendKeySync() function from Instrumentation api's iam sending
some key strokes,but iam getting some error
like..WindowManager:Permission Denied:injecting key event from pid
233 uid 10017 to window Window {} owned by uid 1000.

I am running my app using Eclipse and Emulator.Please let me know how
do i tackle this.

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



[android-developers] Re: Improved support for camera on Android emulator.

2008-11-05 Thread blindfold

BTW Mark, since you are with Qualcomm, you should be able to find out
more about the QualcommCameraHardware messages that we see in G1 crash
logs? It is only most recently that I learnt that camera preview on
the T-Mobile G1 uses some YUV 411 encoding instead of the emulators
single supported format which is a YUV 422 variant. These kinds of
surprises are killing for our camera based apps, and as a result
also killing for our developer reputation with end users (they blame
us for broken apps). My own camera app runs fine on the emulator but
breaks and shows scrambled previews on the G1, at least in part due to
this new find about the undocumented use of an 411 encoding that I
still need to account for by writing a dedicated preview decoder. Who
is sitting on this kind of vital developer information? Is it Google,
T-Mobile or Qualcomm?

More about reporting about the ongoing struggle with the G1
QualcommCameraHardware at

http://code.google.com/p/android/issues/detail?id=1129 and at
http://groups.google.com/group/android-developers/browse_thread/thread/6e070855723aede0/

Any help is appreciated!

Peter

On Nov 5, 2:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I was wondering if anyone has any information on when we could expect
 improved camera support for the Android emulator, ie being able to
 capture pictures and video input on the emulator. I know this is a
 critical issue for many of us. Thanks in advance.

         Mark

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



[android-developers] Re: Where does the emulator look for the SD Card Image File ?

2008-11-05 Thread AndroidKid

Hi All,

I'm also facing the same issue.

1. mksdcard 2048M d:\Program Files\myandroid\sdcard.img

2. emulator -sdcard d:\Program Files\myandroid\sdcard.img
While executing this second command I got warning message as ###
WARNING: SD Card files must be at least 8 MB, ignoring 'd:\Program
Files\myandroid\sdcard.img'

3. adb push E:\A.R Hits\airtel.mp3 /sdcard

 failed to copy 'C:\airtel.mp3' to '/sdcard/airtel.mp3': Read-only
file system


Please any body ready to share your knowledge. Past 1 day, I'm
struggling with this issue. I've tried many ways but no use :(

Thanks in advance!!!

Thanks adgain!
Yasmin

On Oct 11, 4:25 pm, Ludwig [EMAIL PROTECTED] wrote:
 The mksdcard utility creates the SD card image whereever you specify it. It
 is just a normalxamp file on your host computer file system. The ls command
 will show you when it has been created. At that point the emulator does not
 know anything about it and you can create many SDCard images if you
 want._After_
 it has been created you will need to start your emulator again with the
 location where it is on your host file system. (I do not think it would auto
 refresh this if it did not exist there in the first place). The emulator
 will now mount the file on the host computer as a filesystem under /sdcard.
 _Then_ your emulator has a writable file system under /sdcard (better use
 the environment to get it as it could change for devices), so any push
 operation will go to /sdcard/myfile.

 I can see in the example code below that you are trying to push with the
 name of file on the host file system (D:...etc). That does not exist on the
 emulator. The emulator has /sdcard/  etc.

 HTH.

 Ludwig

 2008/10/10 guru [EMAIL PROTECTED]





  I have been trying to push an mp3 file for quite a while but i am
  getting the error.

  ---­
  D:\android-sdk-windows-1.0_r1\toolsmksdcard 1024M sdcard.img

  D:\android-sdk-windows-1.0_r1\toolsadb push D:/android-sdk-
  windows-1.0_r1/tools/anirudh.mp3 /sdcard
  530 KB/s (0 bytes in 4031977.007s)

  D:\android-sdk-windows-1.0_r1\toolsadb push D:/android-sdk-
  windows-1.0_r1/tools/anirudh.mp3 \sdcard
  failed to copy 'D:/android-sdk-windows-1.0_r1/tools/anirudh.mp3' to
  '\sdcard': Read-only file system

  ---­

  When i see in the emulator,I dont see the file i have pushed.Thanks
  for your help.

  Thanks
  Guru

  On Sep 24, 2:50 pm, Sudha [EMAIL PROTECTED] wrote:
   in addition to the above mail

   I tried  to pull out the default image coming the camera
   folder( apperas in the pictures in the emulator) and tried to push teh
   same back to /sdcar/dcim/camera.
   now also teh image appreas liek red block and blank screen when
   selected..

   Nothing is happening with the 1.0- Hide quoted text -

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



[android-developers] Re: Drawing on MapView

2008-11-05 Thread Peter Stevenson

Peter Wrote
What is the Question
 do you what to display the description for each Geopoint





Prestes wrote:
 Hi all,

 How do I that when every GeoPoint displays a description ?
 can someone help me?

 On 29 set, 21:11, Prash [EMAIL PROTECTED] wrote:
   
 Thanks Peter for the post! I was lost with getting a basic Map display
 - turns out its an issue with the uses-permission in the
 AndroidManifest.xml file which seems to be a fairly new development.

 In the Location based API documentation, it would help if they add the
 fact that these permissions should be setup before you can do
 something useful.

 - Prash

 On Sep 29, 2:21 am, Peter Stevenson [EMAIL PROTECTED] wrote:

 
 Peter Wrote
 hope this help   if not email me again  and I see if I  can  help
 Also add a screen shot
   
 You should be able to load data on to your map  based on this code
 use a dbHelper Class to help with database control
   
 Peter
   
 package com.cyberspace.testing.out;
   
 import android.graphics.Canvas;
 import android.graphics.drawable.Drawable;
   
 import java.io.DataOutputStream;
 import java.io.OutputStream;
 import java.lang.reflect.Array;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.Vector;
 import org.apache.http.protocol.HTTP;
 import android.os.Bundle;
 import android.view.*;
 import com.google.android.maps.GeoPoint;
 import com.google.android.maps.MapActivity;
 import com.google.android.maps.MapView;
   
 public class prueba extends MapActivity {
   
  WhereAmIOverlayWhereAmIOverlay;
  View zoomView;
  Drawable defaultMarker;
  MapView map;
   
GeoPoint Point = new GeoPoint((int) (-1.416402 * 100), (int)
(-78.025078 * 100));
   
GeoPoint Point1 = new GeoPoint((int) (-1.616402 * 100), (int)
(-78.025078 * 100));
GeoPoint Point2 = new GeoPoint((int) (-1.516402 * 100), (int)
(-78.025078 * 100));
GeoPoint Point3 = new GeoPoint((int) (-1.716402 * 100), (int)
(-78.025078 * 100));
   
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 map = (MapView) findViewById(R.id.map);
 defaultMarker =
 getResources().getDrawable(R.drawable.mappin_red);
 defaultMarker.setBounds(0,
 0,defaultMarker.getIntrinsicWidth(), defaultMarker.getIntrinsicHeight());
   
// map.getController().setCenter(Point);
  //  map.getController().animateTo(Point);
 //map.displayZoomControls(false);
 //map.getController().setZoom(7);
  }
 public boolean onKeyDown(int keyCode, KeyEvent event) {
 switch(keyCode){
 case KeyEvent.KEYCODE_I:
 int level = map.getZoomLevel();
 map.getController().setZoom(level + 1);
 return true;
 case KeyEvent.KEYCODE_O:
 int level2 = map.getZoomLevel();
 map.getController().setZoom(level2 + 1);
 return true;
 case KeyEvent.KEYCODE_S:
 map.setSatellite(true);
 return true;
 case KeyEvent.KEYCODE_T:
 map.setSatellite(false);
 return true;
 }
 return false;
 }
   
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
 super.onCreateOptionsMenu(menu);
 menu.add(0,1,2, My Location);
 //menu 1
 SubMenu sub1 = menu.addSubMenu(3, 2, 3,Vistas);
 sub1.add(3,3,1, Satelite);
 sub1.add(3,4,2, Trafico);
 //menu 2
 SubMenu sub = menu.addSubMenu(2, 5, 1,Zoom);
 sub.add(2,6,1, In);
 sub.add(2,7,2, Out);
 return true;
 }
 @Override
 public boolean onMenuItemSelected(int featureId, MenuItem item) {
 super.onMenuItemSelected(featureId, item);
 switch (item.getItemId()) {
 case 1:
WhereAmIOverlay= newWhereAmIOverlay(this,defaultMarker);
 map.getController().animateTo(Point);
 map.getOverlays().add(WhereAmIOverlay);
 zoomView = map.getZoomControls();
 zoomView.setLayoutParams(new ViewGroup.LayoutParams
 (ViewGroup.LayoutParams.WRAP_CONTENT,
 ViewGroup.LayoutParams.WRAP_CONTENT));
 map.addView(zoomView);
 map.displayZoomControls(true);
map.getController().setZoom(10);
map.setClickable(true);
map.setEnabled(true);
map.invalidate();  
 return true;
 case 3:
 map.setSatellite(true);
 return true;
 case 4:
 map.setSatellite(false);
 return true;
 case 6:
 int level = map.getZoomLevel();
 

[android-developers] Re: Where does the emulator look for the SD Card Image File ?

2008-11-05 Thread for android
u need to restart the emulator again after pushing the image...

On Wed, Nov 5, 2008 at 3:01 PM, AndroidKid [EMAIL PROTECTED] wrote:


 Hi All,

 I'm also facing the same issue.

 1. mksdcard 2048M d:\Program Files\myandroid\sdcard.img

 2. emulator -sdcard d:\Program Files\myandroid\sdcard.img
While executing this second command I got warning message as ###
 WARNING: SD Card files must be at least 8 MB, ignoring 'd:\Program
 Files\myandroid\sdcard.img'

 3. adb push E:\A.R Hits\airtel.mp3 /sdcard

 failed to copy 'C:\airtel.mp3' to '/sdcard/airtel.mp3': Read-only
 file system


 Please any body ready to share your knowledge. Past 1 day, I'm
 struggling with this issue. I've tried many ways but no use :(

 Thanks in advance!!!

 Thanks adgain!
 Yasmin

 On Oct 11, 4:25 pm, Ludwig [EMAIL PROTECTED] wrote:
  The mksdcard utility creates the SD card image whereever you specify it.
 It
  is just a normalxamp file on your host computer file system. The ls
 command
  will show you when it has been created. At that point the emulator does
 not
  know anything about it and you can create many SDCard images if you
  want._After_
  it has been created you will need to start your emulator again with the
  location where it is on your host file system. (I do not think it would
 auto
  refresh this if it did not exist there in the first place). The emulator
  will now mount the file on the host computer as a filesystem under
 /sdcard.
  _Then_ your emulator has a writable file system under /sdcard (better use
  the environment to get it as it could change for devices), so any push
  operation will go to /sdcard/myfile.
 
  I can see in the example code below that you are trying to push with the
  name of file on the host file system (D:...etc). That does not exist on
 the
  emulator. The emulator has /sdcard/  etc.
 
  HTH.
 
  Ludwig
 
  2008/10/10 guru [EMAIL PROTECTED]
 
 
 
 
 
   I have been trying to push an mp3 file for quite a while but i am
   getting the error.
 
  
 ---­
   D:\android-sdk-windows-1.0_r1\toolsmksdcard 1024M sdcard.img
 
   D:\android-sdk-windows-1.0_r1\toolsadb push D:/android-sdk-
   windows-1.0_r1/tools/anirudh.mp3 /sdcard
   530 KB/s (0 bytes in 4031977.007s)
 
   D:\android-sdk-windows-1.0_r1\toolsadb push D:/android-sdk-
   windows-1.0_r1/tools/anirudh.mp3 \sdcard
   failed to copy 'D:/android-sdk-windows-1.0_r1/tools/anirudh.mp3' to
   '\sdcard': Read-only file system
 
  
 ---­
 
   When i see in the emulator,I dont see the file i have pushed.Thanks
   for your help.
 
   Thanks
   Guru
 
   On Sep 24, 2:50 pm, Sudha [EMAIL PROTECTED] wrote:
in addition to the above mail
 
I tried  to pull out the default image coming the camera
folder( apperas in the pictures in the emulator) and tried to push
 teh
same back to /sdcar/dcim/camera.
now also teh image appreas liek red block and blank screen when
selected..
 
Nothing is happening with the 1.0- Hide quoted text -
 
  - Show quoted text -
 


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



[android-developers] Re: Succeeded porting Xerces DOM parser

2008-11-05 Thread Jakob Sachse

hello,

that seems very interesting. How do you obtain an instance of the
SAXParserFactory?
For what i suspect the abstract class SAXParserFactory is a member of
javax.xml.parsers
and the one way of getting a SAXParser Instance. Please correct me if
I am wrong.

I want to use Xerces since the SAXParserImpl Android uses throws
SAXExceptions[DOMExceptions] that I can't explain and didn't occur in
a J2SE/Xerces environment.





On 21 Okt., 09:04, Anders Rundgren [EMAIL PROTECTED] wrote:
 Today I managed to port apache's Xerces java XML DOM parser.  I
 unfortunately had to give it completely new package names since SDK
 1.0 R1 is lagging with respect to org.w3c.dom and probably in other
 ways as well.

 Anyway, the performence seems quite reasonable on the emulator, so I
 urge Google to (gradually) deprecate the pull-parser for Xerces.

 MSFT's .NET CF has full schema validation and XML security as well.

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



[android-developers] Problem with onActivityResult

2008-11-05 Thread Prestes

Hi all,

I have a problem with onActivityResult. My class Activity can not
return a result for this method.

My class A
[syntax=java]
public class ClassTestA {
private Button btOk;
private Intent bus;

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

btOk = (Button) findViewById(R.id.btTeste);
bus = new Intent(AndTeste.this, Buscador.class);

btOk.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
bus = new Intent(AndTeste.this, Buscador.class);
startActivityForResult(bus, RESULT_OK);
}

});
}

// Listen for results.
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
// See which child activity is calling us back.
switch (resultCode) {
   case RESULT_OK:
setTitle(Result Ok);
   default:
break;
}
}
}
[/syntax]

Class B
[syntax=java]
public class ClassB {
private Button btBus;
private EditText end;
private Geocoder buscador;
private ListView list;

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

btBus = (Button) findViewById(R.id.btBuscar);
end = (EditText) findViewById(R.id.tiEnd);
buscador = new Geocoder(this);
list = (ListView) findViewById(R.id.listEnd);

btBus.setOnClickListener(mCorkyListener);
}

private OnClickListener mCorkyListener = new OnClickListener() {
public void onClick(View v) {
setResult(RESULT_OK);
finish();
}
};
}
[/syntax]

Manifest.xml
[syntax=xml]
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.maps
  android:versionCode=1
  android:versionName=1.0.0

application android:icon=@drawable/icon
android:label=testeando tudo
activity android:name=.ClassA android:label=Testeando a
And
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

activity android:name=.ClassB android:label=TESTEANDO
intent-filter
action android:name=android.intent.action.VIEW /
category
android:name=android.intent.category.DEFAULT /
/intent-filter
/activity
/application
/manifest
[/syntax]
My class B to return to class A, but o method onActivityResult is not
called.
Someone can help me ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: question about build android (2)

2008-11-05 Thread Mark Murphy

hunter wrote:
 Hi, all:
 I tried to build android, but met following errors:
 ==
 frameworks/base/../../dalvik/libcore/concurrent/src/main/java/java/
 util/concurrent/locks/UnsafeAccess.java:26: warning: sun.misc.Unsafe
 is Sun proprietary API and may be removed in a future release
 /*package*/ static final Unsafe THE_ONE = Unsafe.getUnsafe();
  ^
 Could not load 'clearsilver-jni'
 java.library.path = out/host/linux-x86/lib
 make: *** [out/target/common/docs/framework-timestamp] Error 45
 
 ===
My java version is :
 $ java -version
 java version 1.6.0_10
 Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
 Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
 
 
 $ which java
 ~/dev-tools/jdk1.6.0_10/bin/java
 
Can anyone tell what is going wrong?

I wrote this before when you posted to [android-beginners].

You are posting your question on a list (this time, 
[android-developers]) that is not designed for your question. This is 
for application developers, not framework developers or people doing ports.

You can find the roster of lists for the source code at:

http://source.android.com/discuss

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.4 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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: The application project(process package name) has stopped unexpectedly.please try again.force close

2008-11-05 Thread Michael


Without any real detail I'm sure we've got no idea what you're
doing.  Perhaps you should be watching the debug log (run 'adb
logcat') to see where your application crashes.

As for starting one activity from another... well, read the API docs
on 'Activity' - see 'startActivity()' and the other related methods.

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



[android-developers] Getting GPS Location Crashes

2008-11-05 Thread Bobbie

I've posted with no help, please help me out.  I am trying to figure
out how to get the GPS location of my device.  However, when I use the
code below (see CODE TO GET LOCATION) my Android application
crashes.  I am developing on the G1 phone.  If I change the provider
to network instead of gps, it works perfectly fine.  Here is the
code I am using:

** ANDROID MANIFEST PERMISSIONS **
uses-permission android:name=android.permission.ACCESS_LOCATION /
uses-permission android:name=android.permission.ACCESS_GPS /
uses-permission
android:name=android.permission.ACCESS_COARSE_LOCATION /
uses-permission
android:name=android:permission.ACCESS_FINE_LOCATION /

** CODE TO GET LOCATION **
LocationManager lM = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
LocationProvider lP = lM.getProvider(gps);
Location loc = lM.getLastKnownLocation(lP.getName());

Do I have to somehow tell the GPS to try to get a fix?  If so, how do
I go about that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Icon Creation Software

2008-11-05 Thread Ed Burnette

Those look nice; are the .svg versions available for use as examples/
templates?

On Nov 4, 8:50 am, Peli [EMAIL PROTECTED] wrote:
 We've created our Android icons using Inkscape.http://www.inkscape.org/

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

 Peliwww.openintents.org

 On Nov 2, 4:14 pm, ScottG [EMAIL PROTECTED] wrote:

  Thanks for the insight, Pavel.  I was looking to duplicate look and
  feel of the Android home page icons not just a bunch of icon pixels.

  The folks at

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

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

  Cheers, Scott

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

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

   Thanks for any insight.

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



[android-developers] Re: Getting GPS Location Crashes

2008-11-05 Thread Mark Murphy

Bobbie wrote:
 I've posted with no help, please help me out.  I am trying to figure
 out how to get the GPS location of my device.  However, when I use the
 code below (see CODE TO GET LOCATION) my Android application
 crashes. 

And the error message is...what?

It is difficult to tell you what a crash means without the Java traceback.

You can get this from DDMS or adb logcat.

 LocationManager lM = (LocationManager)
 getSystemService(Context.LOCATION_SERVICE);
 LocationProvider lP = lM.getProvider(gps);
 Location loc = lM.getLastKnownLocation(lP.getName());

At this point, loc is probably null.

 Do I have to somehow tell the GPS to try to get a fix? 

Yes. The device does not keep the GPS radios on all the time, otherwise 
battery life would be worse than it already is. :-(

Try using requestLocationUpdates(). It still may take a while for you to 
get a fix -- I ran a test yesterday and it took ~15 seconds from the 
time my app started until a fix was ready.

This, of course, assumes your device is configured to allow GPS access 
at all:

Settings  Security  Location  Enable GPS satellites

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.4 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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android Icon Creation Software

2008-11-05 Thread Peli

You can find the .svg versions of the OI icons here:

http://code.google.com/p/openintents/source/browse/#svn/images/icons_sdk1

Note that we have not specified the license yet, and were thinking of
some Creative Commons license.
Any advice or suggestion in this direction would be welcome.

Peli
www.openintents.org

On Nov 5, 4:33 pm, Ed Burnette [EMAIL PROTECTED] wrote:
 Those look nice; are the .svg versions available for use as examples/
 templates?

 On Nov 4, 8:50 am, Peli [EMAIL PROTECTED] wrote:

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

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

  Peliwww.openintents.org

  On Nov 2, 4:14 pm, ScottG [EMAIL PROTECTED] wrote:

   Thanks for the insight, Pavel.  I was looking to duplicate look and
   feel of the Android home page icons not just a bunch of icon pixels.

   The folks at

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

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

   Cheers, Scott

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

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

Thanks for any insight.

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



[android-developers] Re: Android Database connectivity program

2008-11-05 Thread Anders Rundgren

Hello Ram,

You could try to import the MSFT JDBC driver.  It is probably very
big.

But I would not.  The best is to create a web-service that talks to
SQL server and returns the stuff you asked for.
Few if anybody connects to SQL server over the Internet even if it is
possible.
Over VPN you can do that securely but direct SQL server access is not
recommendable anyway.

I hope that is of some utility even if it wasn't the answer you asked
for :-)

Anders

On Nov 5, 6:51 am, Nataraaj [EMAIL PROTECTED] wrote:
 Hello guys,

          I want to connect android application with MS - SQL Server,
 where can i get sample code for this?

 Plz provide me with an web link for the source.

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



[android-developers] Maps and M5, impossible??

2008-11-05 Thread Altais

Hi,

We have an application developed with M5-rc15 SDK that uses maps.
Migrate it  to 1.0 its a hard work and application is only for demo
purpose. (we need to show it only one more time!!)

Is there any way to show now a map in M5?

Thanks,

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



[android-developers] Re: Maps and M5, impossible??

2008-11-05 Thread JP

You're out of luck there. In 0.9 and now 1.0, the MapView constructor
has changed to pass the now required Google Maps API key. Manual here:
http://code.google.com/android/toolbox/apis/mapkey.html


On Nov 5, 8:51 am, Altais [EMAIL PROTECTED] wrote:
 Hi,

 We have an application developed with M5-rc15 SDK that uses maps.
 Migrate it  to 1.0 its a hard work and application is only for demo
 purpose. (we need to show it only one more time!!)

 Is there any way to show now a map in M5?

 Thanks,

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



[android-developers] Re: Problem with onActivityResult

2008-11-05 Thread Christine

The proper way to do this is to provide an int value for requestCode
in startActivity. Then in OnActivityResult you have a
switch(requestCode) and within each case you have a switch for
resultCode. You seem to be confusing requestCode and resultCode.

Your requestCode should probably be something like BUS_ACTIVITY that
you give an int value,
then you have
  bus = new Intent(AndTeste.this, Buscador.class);
  startActivityForResult(bus,BUS_ACTIVITY);
.
Intent data) {
// See which child activity is calling us back.
 switch(requestCode){
  case BUS_ACTIVITY:
switch (resultCode) {
   case RESULT_OK:
setTitle(Result Ok);
   default:
break;
}
break;
}

or something along those lines. I think there's plenty of examples in
the api demos.



On Nov 5, 11:39 am, Prestes [EMAIL PROTECTED] wrote:
 Hi all,

 I have a problem with onActivityResult. My class Activity can not
 return a result for this method.

 My class A
 [syntax=java]
 public class ClassTestA {
         private Button btOk;
         private Intent bus;

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

                 btOk = (Button) findViewById(R.id.btTeste);
                 bus = new Intent(AndTeste.this, Buscador.class);

                 btOk.setOnClickListener(new OnClickListener() {

                         public void onClick(View v) {
                                 bus = new Intent(AndTeste.this, 
 Buscador.class);
                                 startActivityForResult(bus, RESULT_OK);
                         }

                 });
         }

         // Listen for results.
         protected void onActivityResult(int requestCode, int resultCode,
 Intent data) {
                 // See which child activity is calling us back.
                 switch (resultCode) {
                    case RESULT_OK:
                         setTitle(Result Ok);
                    default:
                         break;
                 }
         }}

 [/syntax]

 Class B
 [syntax=java]
 public class ClassB {
         private Button btBus;
         private EditText end;
         private Geocoder buscador;
         private ListView list;

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

         btBus = (Button) findViewById(R.id.btBuscar);
         end = (EditText) findViewById(R.id.tiEnd);
         buscador = new Geocoder(this);
         list = (ListView) findViewById(R.id.listEnd);

         btBus.setOnClickListener(mCorkyListener);
     }

     private OnClickListener mCorkyListener = new OnClickListener() {
         public void onClick(View v) {
             setResult(RESULT_OK);
             finish();
         }
     };}

 [/syntax]

 Manifest.xml
 [syntax=xml]
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
       package=com.maps
       android:versionCode=1
       android:versionName=1.0.0

     application android:icon=@drawable/icon
 android:label=testeando tudo
         activity android:name=.ClassA android:label=Testeando a
 And
             intent-filter
                 action android:name=android.intent.action.MAIN /
                 category
 android:name=android.intent.category.LAUNCHER /
             /intent-filter
         /activity

         activity android:name=.ClassB android:label=TESTEANDO
             intent-filter
                 action android:name=android.intent.action.VIEW /
                 category
 android:name=android.intent.category.DEFAULT /
             /intent-filter
         /activity
     /application
 /manifest
 [/syntax]
 My class B to return to class A, but o method onActivityResult is not
 called.
 Someone can help me ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Maps and M5, impossible??

2008-11-05 Thread Altais

We know the changes. The emulator is better, butwe always can make a
Power Point presentation.

Thanks!

On 5 nov, 18:02, JP [EMAIL PROTECTED] wrote:
 You're out of luck there. In 0.9 and now 1.0, the MapView constructor
 has changed to pass the now required Google Maps API key. Manual 
 here:http://code.google.com/android/toolbox/apis/mapkey.html

 On Nov 5, 8:51 am, Altais [EMAIL PROTECTED] wrote:

  Hi,

  We have an application developed with M5-rc15 SDK that uses maps.
  Migrate it  to 1.0 its a hard work and application is only for demo
  purpose. (we need to show it only one more time!!)

  Is there any way to show now a map in M5?

  Thanks,

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



[android-developers] Re: Improved support for camera on Android emulator.

2008-11-05 Thread [EMAIL PROTECTED]


  It seems everyone is having simular problems with the limited camera
support as well as the lack of emulator support for camera input. I'm
more on the application development side, but since this is such a
serious problem I'll see if I can talk to the hardware people here.
I'll see if we can get any feedbackm from the Google team as well.
I'll post back here as I find out more information. Many have come to
the same conclusion about the currrent state of camera support, in
that it isn't sufficient for serious application development yet,
which is currently my problem also. I'll do everything I can to got
more information on the camera issues, without this issue resolved it
will be difficult for Android to be a competitive platform.

On Nov 5, 1:07 am, blindfold [EMAIL PROTECTED] wrote:
 BTW Mark, since you are with Qualcomm, you should be able to find out
 more about the QualcommCameraHardware messages that we see in G1 crash
 logs? It is only most recently that I learnt that camera preview on
 the T-Mobile G1 uses some YUV 411 encoding instead of the emulators
 single supported format which is a YUV 422 variant. These kinds of
 surprises are killing for our camera based apps, and as a result
 also killing for our developer reputation with end users (they blame
 us for broken apps). My own camera app runs fine on the emulator but
 breaks and shows scrambled previews on the G1, at least in part due to
 this new find about the undocumented use of an 411 encoding that I
 still need to account for by writing a dedicated preview decoder. Who
 is sitting on this kind of vital developer information? Is it Google,
 T-Mobile or Qualcomm?

 More about reporting about the ongoing struggle with the G1
 QualcommCameraHardware at

 http://code.google.com/p/android/issues/detail?id=1129and 
 athttp://groups.google.com/group/android-developers/browse_thread/threa...

 Any help is appreciated!

 Peter

 On Nov 5, 2:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:



  I was wondering if anyone has any information on when we could expect
  improved camera support for the Android emulator, ie being able to
  capture pictures and video input on the emulator. I know this is a
  critical issue for many of us. Thanks in advance.

          Mark- Hide quoted text -

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



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

2008-11-05 Thread Amir

Hah...no worries and good check on the permissions query, I'm trying
something new today as well as hard-coding a location to see if my app
can sniff it out.  I'll let everyone know about the outcome!

Amir

On Nov 4, 5:42 pm, C-LIS Keiji Ariyama [EMAIL PROTECTED] wrote:
 Amir, I'm sorry...

  permissions are acquired:
  Network communication (full)
  Your location (fine (GPS), coarse (network-based) location)

 Keiji,



 Amir wrote:
  Hi Guillaume,

  Thanks for your reply and yes the standard map application manager
  does display my location on the G1, but my application doesn't allow
  display to my website just yet.  Any thoughts you may have that might
  help?

  What I see on the device is the GPS icon is turned on when my
  application is running, but no data is transmitted to my Google map
  that's on my website where I can track where I am.

  Cheers
  Amir

  On Nov 4, 12:17 pm, Guillaume Perrot [EMAIL PROTECTED]
  wrote:

  Did you check if the standard map application manages to display your
  location ?

  2008/11/4 Amir [EMAIL PROTECTED]

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

  Here's the revised code I'm using:

  package org.gw.service;

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

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

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

  return 0;
  }
  }

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

  Amir,

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

  I did the following:

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

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

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

  All the best,
  Akbur

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

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

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

  Hi Amir,

  I had encountered a same situation. But my case is about
  getLastKnownLocation(String) 

  cid:part1.07010905.08080...@c-lis.co.jp[EMAIL PROTECTED]

  method on the emulator.
  In that time, I fixed my code below.

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

  -

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

  -

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

  Keiji,

  Amir wrote:

  I'm creating a project that allows for my location to be found

  using

  the android device and communicating with my website as to where my
  Android device is.  When I download the .apk to my phone the

  following

  permissions are acquired:

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

  As of now, on the emulator everything works fine and I can find my
  location (default location on Google Maps), but on the phone the
  

[android-developers] Why must WebView display local files via a ContentProvider?

2008-11-05 Thread Biosopher

In case you hadn't heard, WebView won't display local files directly
via loadUrl(file://YOUR_PATH/file.html).  All the solutions create a
ContentProvider to access the local files and send them to a WebView
using ContentProvider.openFile().

This approach seems less secure than simply sending my locally created
application files files directly to WebView.  My app creates and
stores the files in my sandboxed local file directory so they should
be inaccessible to anyone and thus secure.

I know the standard response for why this is:  That WebView's access
to local files would be insecure.

But why is it safer to wrap files into a ContentProvider and then feed
them to WebView when the purpose of a ContentProviders is mostly to
share content between apps.. .which I won't be doing?

So my questions:
1) What was wrong with the local file solution for WebView.loadUrl().
2) Why is it safer to wrap my local files into a ContentProvider?

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



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

2008-11-05 Thread zl25drexel

well i am answering my own question again. I figured out a working
solution, for those who are interested, see

http://bend-ing.blogspot.com/2008/11/properly-handle-progress-dialog-in.html

On Nov 4, 9:52 am, zl25drexel [EMAIL PROTECTED] wrote:
 Thanks for your reply, any example codes?

 On Nov 3, 8:28 pm, Greg [EMAIL PROTECTED] wrote:

  When you change orientation your Activity is destroyed and then re-
  created.  When you re-create the dialog view object that was sent to
  the background process is no longer valid, thus the error.

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

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

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

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

  Hope this helps,

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



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

2008-11-05 Thread Declan Shanaghy
Well that would imply that the default handling is setup they way i
suggested it should be!  ;-P

@simonsh
There's your answer!



On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote:


 Oh the -default- handling of the green key is this:

private void startCallActivity() {
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
}


 So you can write an activity that implements that action.  You can -
 not- however generally intercept the green key: if the app handles it
 yourself (such as pressing the green key while highlighting a phone
 number to place a call) you won't run.

 On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
  It doesn't seem that way.
  No matter what application I am in if I press the green phone button the
  recent call log comes up.
 
  What about when the user is on the home screen?
 
  On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:
 
   The green phone key is for use by the foreground application.
 
   On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
It shouldnt be stolen but it should be overridable.
Much like the app picker behaves when multiple apps are registered
 for an
Intent.
 
I dont know how the internals of how the off hook button works but
   couldnt
it broadcast an Intent to go off hook which then can be handled
 like
   any
other intent. To avoid the annoying situation of having to choose an
 app
every time a changeable default could be setup.
(Like how RingDroid replaces the default ringtone picker)
 
On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:
 
 Correct, you can't steal it from other apps.  When your apps is in
 the
 foreground, however, you will see the key as a normal key event
 that
 you can process however you want.
 
 On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
  I don't think you would be allowed to remap the phone button that
   would
 force people to use your app even if they didn't want to and my be
 considered malacious. That's just an opinion though
 
  -Original Message-
  From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
  Date: Mon, 3 Nov 2008 13:09:53
  To: Android Developersandroid-developers@googlegroups.com
  Subject: [android-developers] hooking to the PHONE button
 
  Hi,
 
  How can I make my own application run whenever the user presses
 the
  green PHONE button ?
 
  TIA
 


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



[android-developers] Re: Verify Error with HTTPMIME / MIME4J

2008-11-05 Thread Declan Shanaghy
Alvin,
I have successfuly got multipart posts to work using the jars in this zip
file.
http://www.shanaghy.com/wah/httpclient-jars.zip


I also saw a post on another thread, someone provided this set of jars.
http://archive.apache.org/dist/httpcomponents/httpclient/binary/httpcomponents-client-4.0-alpha4-bin-with-dependencies.zip



The jars I'm using are newer,

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



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

2008-11-05 Thread hackbod

It's not the same, you can't steal it from everyone.  This only
happens when the currently focused app doesn't do anything special
with the phone key.  The home key, in contrast, can not be handled by
the foreground app -- it always starts the home activity.

On Nov 5, 10:09 am, Declan Shanaghy [EMAIL PROTECTED] wrote:
 Well that would imply that the default handling is setup they way i
 suggested it should be!  ;-P

 @simonsh
 There's your answer!

 On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote:

  Oh the -default- handling of the green key is this:

     private void startCallActivity() {
         Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         getContext().startActivity(intent);
     }

  So you can write an activity that implements that action.  You can -
  not- however generally intercept the green key: if the app handles it
  yourself (such as pressing the green key while highlighting a phone
  number to place a call) you won't run.

  On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
   It doesn't seem that way.
   No matter what application I am in if I press the green phone button the
   recent call log comes up.

   What about when the user is on the home screen?

   On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:

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

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

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

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

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

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

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

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

   Hi,

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

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



[android-developers] Need help using hat to track down memory usage

2008-11-05 Thread Disco Stu 010

Hello,

While perusing the source code, came across a shell function that  
envsetup.sh defines called runhat. Judging by the parameters, etc.,  
to this function, it allows one to get a heap-dump for a given  
application. This dump can then be analyzed by the tools hat and  
jhat.

Has anyone had any luck running these tools? I tried earlier today and  
consistently get an error message

Started HTTP server on port 7000
Reading from /tmp/t.hat...
java.io.IOException: Version string not recognized at byte 17
at hat.parser.HprofReader.readVersionHeader(HprofReader.java:325)
at hat.parser.HprofReader.read(HprofReader.java:169)
at hat.parser.Reader.readFile(Reader.java:90)
at hat.Main.main(Main.java:149)

I have tried jhat (built into Java SE 6.0) as well as hat (downloaded  
from https://hat.dev.java.net/). Both versions get the same error.

Can anyone help?

Thanks,
DS.





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



[android-developers] Re: Creating libraries for android

2008-11-05 Thread hackbod

On Nov 5, 4:53 am, Anders Rundgren [EMAIL PROTECTED] wrote:
 Is the following workaround possible:
 Having multiple applications in a single APK.
 It seems so by looking at APIExamples but would it be possible to host
 applications in a own-defined tools window (I.e. like where apps
 seem to be installed)?  The docs are rather hard to decipher and there
 are almost no illustrations either

Sorry, I don't really understand what you are asking for.  You can
publish multiple main launcher activities from an .apk, if you want.
Otherwise...  application is a pretty nebulous term on android (see
http://code.google.com/android/intro/appmodel.html) so you'll need to
be more specific abotu waht you want.

 BTW, there are no problems hosting resources in libraries in Android,
 the Java standard getResorceAsStream works as expected.

We don't use Java style resources for Android.

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



[android-developers] Re: Permission Denied

2008-11-05 Thread hackbod

You are trying to inject key events into a window that isn't in your
app, which is not allowed.

On Nov 5, 12:53 am, ssk [EMAIL PROTECTED] wrote:
 Hi All,
           I am invoking a new activity ACTION_MAIN from my app.Now
 using SendKeySync() function from Instrumentation api's iam sending
 some key strokes,but iam getting some error
 like..WindowManager:Permission Denied:injecting key event from pid
 233 uid 10017 to window Window {} owned by uid 1000.

 I am running my app using Eclipse and Emulator.Please let me know how
 do i tackle this.

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



[android-developers] Re: location is always latitude 0 longitude 0 altitude 10 in v0.9

2008-11-05 Thread psaltamontes

Hi,

I have change the Regional and Language options to English (United
States) and DDMS works. Now I can send locations to emulator, thanks.

With KML files the play doesn't work, but If you click in some
location of the list that location is sended to the emulator.


On 29 sep, 19:58, Xavier Ducrohet [EMAIL PROTECTED] wrote:
 Hi,

 yes, the GPX playback does use the time info in each point of a GPX track.

 For the KML, there is no time support in the playback yet. This means
 it'll play Placemark node based on their
 pointcoordinatesvalue/coordinates/point inner node.

 KML routes using PlacemarkMultiGeometryLineStringcoordinates
 with a list of multiple long,lat values will not work at this time.

 Xav

 On Mon, Sep 29, 2008 at 9:40 AM, E.D.I [EMAIL PROTECTED] wrote:

  i have found the problem, there are no
  times for the points during the route and thats why
  when u press play in the ddms it seems like it does nothing, i
  successfuly created a gpx file with times, that sets location
  each minute for 15 minutes and it worked fine, the provider is the
  gps
  by the way, if any one knows how to add time to kml
  files i guess it would be perfect.

  On Sep 28, 3:57 pm, hve.dk [EMAIL PROTECTED] wrote:
  Guillaume, I've just reported it 
  as:http://code.google.com/p/android/issues/detail?id=915

  On 24 Sep., 12:32, Guillaume Perrot [EMAIL PROTECTED] wrote:

   I retested a en_GB locale on my Ubuntu 8.04 LTS with Android v1.0.
   OMFG DDMS controls works with that locale !
   But how to procude KML files with direction but non mutlti coordinates
   tags using Google Earth ?
   I read and tested, multi-coordinates tag is not supported anymore...
   And google earth save directions with this tag.hve.dk, I haven't 
   reported an issue yet, did you ?

   On 4 sep, 14:27, [EMAIL PROTECTED] wrote:

Hi, I had the same problem, also switched locale and it works...
Guess it has nothing do do with the locale itself, more with the way
the OS is formatting date, time, ...
So you have to make sure that not only the language is changed to
english but also the formatting rules.

I'm running MAC OS X and Eclipse 3.4,DDMSvia the Eclipse
perspective.

On Sep 2, 11:09 am, hve.dk [EMAIL PROTECTED] wrote:

 Guillaume, I got same the same problem (i.e.DDMSlocationcontrols
 doesn't reach the emulator - or is set to 0,0).
 Do you file a bug report 
 at:http://code.google.com/p/android/issues/list

 (?) - If you don't I'll do it ;-)

 On 26 Aug., 15:44, Guillaume Perrot [EMAIL PROTECTED] wrote:

  In the standard maps application, my position is always at 
  latitude 0
  and longitude 0, altitude 10.
 Locationcontrols inDDMSin Eclipse seems to do nothing, I tried to
  set manuallocation, using a GPX or a KML, i always get a 0,0
 location...
  The only provider available is gps when I tried programmatically.
  Plus, the documentation tells us about about the geo command but 
  I
  didn't find it in my tools directory nor in adb shell internal
  command
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Application installing with default pre-made database file

2008-11-05 Thread Jisung Jung
Hello fellows,

Is it possible to install application's pre-made database file during the
application's installation time ? If not possible, what's the most
recommended way like doing this in Android platform?

jisung

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



[android-developers] Android Password Management Root Passwords

2008-11-05 Thread staulkor

I have successfully ported dropbear to Android in native C code. I got
everything working and when I go to SSH to the phone (I am doing this
on hardware, not the emulator), it asks for the username and password
like usual. The problem is there isnt supposed to be a root password
(at least I thought there wasn't supposed to be). I have tried
multiple common passwords -- no password, admin, android, 1234, ,
etc. None have granted me access.

Do you have any ideas of what the root password could be?

Also, how does Android even keep track of passwords. I can't find a
normal /etc/passwd or /etc/shadow file. I can barely even find
configuration files. How does Android keep track of everything?

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



[android-developers] how to evoke pv logger

2008-11-05 Thread already

hello, I want to see the pv logs while debug.
I see in pv part, the logger is always printed as:
PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE,
(0,PVAuthorEngine::SetLogAppender));
but can not find how to enable pv log, and where it is printed,
Is there any body knowing about this?

Thank you

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



[android-developers] Re: Windows driver for HTC G1 phone

2008-11-05 Thread B

I was confused because at first Windows saw the device, then today it
didn't, but then I realized I changed some things in my phone.
Go to Settings
Then Select SD card
Then select Use for USB storage

Once I did that, the computer immediately saw my phone.
I didn't have to download anything.

On Nov 4, 2:05 pm, Carpe Noctem [EMAIL PROTECTED] wrote:
 The above thread worked and solutions found therein worked great for
 me! Thanks for the resolution!!

 On Oct 31, 3:17 pm, strazzere [EMAIL PROTECTED] wrote:

  The SDCard should work without any drivers (though mine does not work
  on windowsxp)

  Debugging *should* work with the driver provided higher up in this
  post.

  I seem to be able to work perfect both sdcard mass storage and
  debugging from my linux box.

  On Oct 31, 4:45 am, ReyStevE167 [EMAIL PROTECTED] wrote:

   mines only say thats i need a disc

   im not really into all those complicated situations where

   u have to put in codes and such i jus want my G1 phone to be installed
   on my laptop

   anybody helpp plzz anybody know of a CD !?

   On Oct 30, 3:03 pm, strazzere [EMAIL PROTECTED] wrote:

I get the same issue...

Following instructions here;

   http://code.google.com/android/intro/develop-and-debug.html#developin...

But the device stays as a Unrecognized usb device, anyone figure
this one out?

On Oct 23, 7:46 pm, Jonathan Herriott [EMAIL PROTECTED] wrote:

 Hi,

 The Found New Hardware Wizard is unable to detect the drivers after
 I already specified exactly which directory to look.  Has anyone else
 run into these issues?

 Thanks

 On Oct 22, 1:32 am, Beau Gunderson [EMAIL PROTECTED] wrote:

  Here's the link from the other thread on this topic:

 http://dl.google.com/android/android_usb_windows.zip

  Beau

  On Oct 17, 11:13 am, RonS [EMAIL PROTECTED] wrote:

   Any idea where can I get the USB driver so that adb will see the 
   G1?

   RonS- Hide quoted text -

  - Show quoted text -

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



[android-developers] removing preference file and its implication

2008-11-05 Thread [EMAIL PROTECTED]

Hi,
I noticed an interesting but unexpected behaviour with preference
processing in Android. Here’s what I’m trying to do.
My app needs to perform some specific tasks when it is launched for
the first time after installation. I use an element named
“firstLaunch” for this purpose. I set its value to false in the first
launch so that subsequent launches will see it properly.

Here’s the piece of code:

package com.example;
SharedPreferences prefs = getSharedPreferences(pref,
MODE_PRIVATE);
isFirstTimeLaunch = prefs.getBoolean(firstLaunch, true);
Log.d(readPreferences, read first time launch value:  +
isFirstTimeLaunch);

SharedPreferences.Editor editorPrefs = prefs.edit();
editorPrefs.putBoolean(firstLaunch, false);
editorPrefs.commit();

So far so good. Everything works as expected. However, I wanted to
test its behavior when the preference file is removed. I removed the
file '/data/data/com.example/shared_prefs/pref.xml' and relaunched the
app within the emulator. To my surprise I found that my technique
fails -- the variable 'isFirstTimeLaunch' will be false, even if I
remove the preferences file.I repeated removing and launching the app
many times and I see the same result every time.

However, if I run the program from within Eclise IDE or if I do an
'adb install' from the shell, things work as expected.Obviously these
methods clear the app data. Isn't simply removing the preference file
same as removing data since my app doesn't use anything else?

Am I missing something here? Can someone explain what's wrong with my
program?

Thanks
Devi Prasad

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



[android-developers] Customizing builtin applications

2008-11-05 Thread Karra

Tried without luck at android-beginners...

Is there any documentation on the built-in applications and how they
can be extended? I have a couple of ideas for features that I would
love to have as
part the default address book application, but make little sense as a
full blown application. Can someone point me in the right direction?

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



[android-developers] help needed here in code for battery life code...

2008-11-05 Thread Devadath .C.M.
sir/mam,
 i 'm new to the programming side and just curious to build some mobile
applications for android,
can you please provide me with details/codes/any helpful material for
following technologies/services in android.
please give which API is to be used to to get that.
they are:

   1. battery power(remaining)
   2. UMTS (voice and data)
   3. Event: Call Start
   4. call end
   5.  Event: Dropped Call
   6. Downlink ARFCN or Frequency Band
   7. Serving CPICH RSCP (dBm)
   8. Serving Ec/Io (dB)
   9. Serving Rxqual

thank you sir for spending some time here...
looking forward for your reply,
thanking you,
yours faithfully,
brother dev646  :)

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



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

2008-11-05 Thread Fish Kungfu
Maybe we need a Self Help section. ;-)
Thanks for posting your self-answers, since they still help everyone.


On Wed, Nov 5, 2008 at 1:08 PM, zl25drexel [EMAIL PROTECTED] wrote:


 well i am answering my own question again. I figured out a working
 solution, for those who are interested, see


 http://bend-ing.blogspot.com/2008/11/properly-handle-progress-dialog-in.html

 On Nov 4, 9:52 am, zl25drexel [EMAIL PROTECTED] wrote:
  Thanks for your reply, any example codes?
 
  On Nov 3, 8:28 pm, Greg [EMAIL PROTECTED] wrote:
 
   When you change orientation your Activity is destroyed and then re-
   created.  When you re-create the dialog view object that was sent to
   the background process is no longer valid, thus the error.
 
   There are probably several ways to handle this but the first that
   comes to my mind is:
 
   1) The background thread should not be trying to manipulate views
   directly.  Have it send a 'cancel' message to a handler in one of your
   UI classes (like the main activity).  The UI class can then take the
   appropriate action to cancel the dialog.
 
   2) If orientation can change while you have the dialog up (which it
   can), then you need to save that state when the activity is stopped
   and have your restart handler take care of recreating the dialog and
   displaying it when the activity is restarted (after orientation
   change).
 
   Your message handler should then take the cancel message from the
   background thread and dismiss the dialog if it exists.
 
   Hope this helps,
 
   Greg
 


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



[android-developers] File permission about MediaPlayer

2008-11-05 Thread pa018

Code first:
InputStream is = ;//some mixed audio
byte buf[] = new byte[1024];

System.out.println(tempDir.getAbsolutePath());
File temp = File.createTempFile(aaa, .mp3, 
this.getCacheDir());

FileOutputStream out = new FileOutputStream(temp);
do {
int numread = is.read(buf);
if (numread = 0)
break;
out.write(buf, 0, numread);
} while (true);
out.flush();
out.close();

MediaPlayer mp = new MediaPlayer();
mp.setDataSource(temp.getAbsolutePath());
mp.prepare();
mp.start();

I want to make some audio fragments to one audio file, and
MediaPlayer could not play with byte or stream, so I have to use
tempfile.
upper code would: 11-05 05:47:37.512: WARN/System.err(3934):
java.io.IOException: Prepare failed.: status=0xFFFC.
But, if I copy the temp file aaa.mp3 out by File Explore, and copy
it into cache directory, the aaa.mp3 could be played.
The temp file created by app in linux is : -rw--- app_18
app_18  2868352 2008-11-05 03:54 aaa13710.mp3
The file copyed into cache is : -rw-rw-rw- root root
2868352 2008-11-05 04:20 aaa13710.mp3
The fiile copyed into sdcard is:rw-rw- system   system
2868352 2008-11-05 05:12 aaa13710.mp3

   so, I guess MediaPlayer play audio files with root account.
Although creating temp file into sdcard is one solution, but i don't
think it is a good method for slow efficiency. MediaPlay should be
able to play with stream or byte, and it is a strange thing that I
could create an audio file but play it.
I saw other developers post this error, google wishes developer
create temp files into sdcard, in fact, creating temp file into sdcard
cann't solve anything.

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



[android-developers] Access assets from within ParcelFileDescriptor / ContentProvider

2008-11-05 Thread effzehn

Hi together,

Since a few days we are struggling with accessing asset files. Pretty
early I found out that accessing assets is not directly possible with
the file:/// Uri.
Now my colleague wrote a ContentProvider class.

Within the ParcelFileDescriptor from the ContentProvider we use the
openFile method to directly access a css file when the pfd is called
from within HTML with the content:// scheme.
Unfortunately, the css had no effect on the HTML and I found out with
File.exists() that this file does not exist under file:///
android_asset/ + filename, although the file is obviously under
assets/Resources in my package exlplorer.

My presentiment is that it's all just a minor misuse of URI paths.

Thanks in Advance for any help.


Cheers,


Andre

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



[android-developers] Re: SharedPreferences: editor.commit() always false even though it commits

2008-11-05 Thread polo777

Hi Jason,

Thanks a lot for your answer.

Regarding the security stuff, I created a md5 function that I apply on
the password to then store it within the preferences file. As you
said, at least it won't be stored plaintext.

Again, thank you
Bye




On Nov 4, 11:23 pm, Jason Parekh [EMAIL PROTECTED] wrote:
 Yup, the returning of false was a bug and you'll find it fixed in a future
 update.

 Re: storing credentials.  Is there any way you can get by without storing
 the actual password?  Perhaps use the password to get some token from the
 service?  If you absolutely have to store the password, I'd suggest at least
 encrypting it with a key that's hard coded in your app (yes, this is still
 not secure, but at least it won't be stored plaintext).

 jason

 On Tue, Nov 4, 2008 at 1:51 PM, polo777 [EMAIL PROTECTED] wrote:

  Hi everyone,

  Almost everything is in the title. I am trying to save username and
  password into the sharedpreferences file. I used the little function
  below to do so:
  Everything works (The data are written correctly, I can read them
  afterward) but the editor.commit() always returns false even though
  the commit works(). Is that a bug?

         private void saveCredential(String username, String password)
         {
                 // Restore or Create preferences if it doesn't exist
                 SharedPreferences settings =
  getSharedPreferences(Common.PREFS_NAME,
  MODE_PRIVATE);
                 // We need an Editor object to make changes in the
  preferences file
                 SharedPreferences.Editor editor = settings.edit();
                 // Then we add the login and the password
                 editor.putString(Common.PREF_USERNAME,username);
                 editor.putString(Common.PREF_PASSWORD,password);
                 // We don't forget to commit our edits
                 if (editor.commit())
                          Log.v(DEBUG_TAG, (Username:  + username + ) ;
  (password :  + password + ) correctly added into file  +
  Common.PREFS_NAME);
                else
                        // not good
         }

  If anyone has a solution, an answer, anything, that would be great ;)

  Also in term of security, is that fine? Should I store the credential
  into a database or anything else?

  Thanks a lot.
  Polo



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



[android-developers] Re: Missing Import android.provider.Telephony

2008-11-05 Thread Fish Kungfu
If you have the disk space available (8GB-10GB to allow Ubuntu and some
working room), I'd recommend setting up your pc as dual boot with your
Windows and Ubuntu.  Always BACKUP your important data first!  I'm not
affiliated with psychocats.net, but it has a very straightforward guide with
screenshots: http://www.psychocats.net/ubuntu/installing

And remember...Have fun! ~~Fish~~


On Wed, Nov 5, 2008 at 1:54 AM, Protocol-X [EMAIL PROTECTED] wrote:


 Unfort at the moment i dont have a pc running linux so i have no way
 to look at the source.

 On Nov 5, 1:35 am, Andrew Stadler [EMAIL PROTECTED] wrote:
  This is a good opportunity to remind readers of the difference between
  the SDK and the open source release.
 
  The SDK presents a set of APIs which is supported, documented, and
  most importantly, guarantees compatibility across a wide range of
  Android-based devices.
 
  The open source release are the tools to build and modify the Android
  platform itself, as well as many of the applications that we be a part
  of many Android devices.
 
  The class you're looking for, android.provider.Telephony, is a perfect
  example of the difference.  Yes, as pointed out, you can find it in
  the open source release and use it to better understand the workings
  of the platform.  No, it *does not* appear in the SDK, and this means
  you should not try to use it from your applications.
 
  If you look carefully at the .java file in the open source release,
  you'll notice that the class documentation includes the annotation
  @hide.  This means it will not appear in the SDK, either as a class
  you can compile against, or Javadoc.
 


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



[android-developers] Re: WPA support

2008-11-05 Thread fiziks

 you won't find EAP/PEAP support because Cisco themselves (the
 developers of PEAP) have not only stopped developing and supporting
 it, but are warning away from it's use due to false sense of security
 that it brings. Cisco's recommendations are to use other connections
 types and session based authentication if needed. If your school or
 business is still using PEAP, refer them to Cisco's website.

You made that up.  Supporting a protocol is not dependent on the
vendor's preferences, unless they are actively refusing to license its
use -- which they are not.

EAP support is necessary for corporate networks who want to use EAP-
TTLS wrappers for AD authentication, and I do not believe it's
unsupported because Cisco said so.

-C


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



[android-developers] bionic

2008-11-05 Thread ecabrera

I have several questions regarding bionic:

I am writing code for functionality that will reside on the kernel
side rather than the user side.  Will I still need to use bionic
libc?  Can I use glibc?

I understand that bionic is a subset of glibc.  Where can I find which
system call functions are included in bionic?

Is there a web site where I can download bionic?


Thanks

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



[android-developers] Re: Missing Import android.provider.Telephony

2008-11-05 Thread john

 you can see the code in Windows, just pull down the code from git.

On Nov 5, 2:54 pm, Protocol-X [EMAIL PROTECTED] wrote:
 Unfort at the moment i dont have a pc running linux so i have no way
 to look at the source.

 On Nov 5, 1:35 am, Andrew Stadler [EMAIL PROTECTED] wrote:

  This is a good opportunity to remind readers of the difference between
  the SDK and the open source release.

  The SDK presents a set of APIs which is supported, documented, and
  most importantly, guarantees compatibility across a wide range of
  Android-based devices.

  The open source release are the tools to build and modify the Android
  platform itself, as well as many of the applications that we be a part
  of many Android devices.

  The class you're looking for, android.provider.Telephony, is a perfect
  example of the difference.  Yes, as pointed out, you can find it in
  the open source release and use it to better understand the workings
  of the platform.  No, it *does not* appear in the SDK, and this means
  you should not try to use it from your applications.

  If you look carefully at the .java file in the open source release,
  you'll notice that the class documentation includes the annotation
  @hide.  This means it will not appear in the SDK, either as a class
  you can compile against, or Javadoc.

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



[android-developers] Re: Customizing builtin applications

2008-11-05 Thread Mark Murphy

Karra wrote:
 I want to be able to create and distribute an application that will
 'patch' the built-in Contacts application - i.e. augment its
 functionality in a certain way. I would imagine that a programmable
 extensible platform should enable such a thing to be easily
 achievable.

Don't confuse a platform with an application. Android is a programmable 
extensible platform. That doesn't necessarily imply that the Contacts 
application -- which is an Android application like any other Android 
application -- necessarily takes advantage of such capabilities.

For example, Android has hooks to allow one to declare activities that 
can appear in another application's menu...if said other application is 
written to look for such activities. I have no idea if Contacts is or is 
not written that way.

 So if the Contacts were an Emacs package, I would have added my custom
 function to, say, 'android-contacts-pre-call-hook' to do some
 processing on a phone number before a call is placed.

Android tends to be somewhat more coarse-grained than that and puts more 
emphasis on inbound hooks than outbound ones, in part because it is 
somewhat more content-focused than function-focused.

Case in point: the WikiNotes sample application. WikiNotes is set up 
such that you can either launch the main app or launch a specific page 
or even drive straight to editing a specific page, all just via the 
public API in the form of accepted Intents. However, you can't replace 
the WikiNotes editor widget from some other app, or decide that you want 
to support {{{text}}} as preformatted text, or something like that, 
because WikiNotes (AFAIK) doesn't try asking around for third-party 
assistance in editing or formatting the actual wikitext.

  An example of
 what I would perform in such a hook would be, to check if the friend
 is online on gtalk and place call only if she is not. 

It is conceivable that the Contacts app is written in a way that you can 
intercept the place-a-call action and handle it yourself if the friend 
is available on IM. Android has the means to support such things. That 
does not mean Contacts was written to use it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.4 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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] TextView.SavedState example?

2008-11-05 Thread Craig

I would like to use onSaveInstanceState/onRestoreInstanceState in my
class that extends TextView, but I don't see how to do it. TextView's
implementation of onSaveInstanceState returns null, I couldn't find a
way of instantiating a TextView.SavedState, and onRestoreState, which
must be called, throws a ClassCastException if you call it with
something other than a TextView.SavedState.

There must be a simple way to use this functionality - the api docs
mention this functionality explicitly:

http://code.google.com/android/reference/android/view/View.html#onSaveInstanceState()

Some examples of things you may store here: the current cursor
position in a text view...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: TextView.SavedState example?

2008-11-05 Thread Mark Murphy

Craig wrote:
 TextView's implementation of onSaveInstanceState returns null

You're subclassing it, so you should be able to return whatever 
Parcelable you want. If, in some future Android implementation, the 
superclass returns something, you'll need to tuck that within your 
Parcelable as well.

 I couldn't find a way of instantiating a TextView.SavedState

Don't do that. Return a Parcelable of your choosing.

 and onRestoreState, which
 must be called, throws a ClassCastException if you call it with
 something other than a TextView.SavedState.

You can't get a ClassCastException on null. Since you got null from 
TextView#onSaveInstanceState(), you should be passing null to 
onRestoreInstanceState(), I would imagine.

These are educated guesses -- I haven't used View-level save/restore 
instance state, only at the activity level.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.4 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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Listing Folders and Files

2008-11-05 Thread gjs

Hi,

Have a look at this, for example -

http://www.anddev.org/android_filebrowser__v20-t101.html

- you will need to adapt it for V1.0

Regards

On Nov 5, 8:49 pm, parani kumar [EMAIL PROTECTED] wrote:
 Dear All,

 Now I am working to get the folders list and files list.Can you suggest me
 how to get the list of Folders and files in the Emulator or Mobile ?

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



[android-developers] Change active AlarmManager event

2008-11-05 Thread hve.dk

Is it possible to change a repeating AlarmManager event - after the
Activity, that scheduled the intent has finished. I like to change
both the time for next event and the intervals between repeats.

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



[android-developers] App idea for a developer: Translate Voice to Text for SMS while driving

2008-11-05 Thread DigiJeff

I think it would be very beneficial for someone to make an application
that translate voice to text for sms messages.  Example: When I'm
driving I dont want to take my eyes off the road when I want to reply
to a text, so if there was an easy way to respond back via sms with
voice that would be so convenient.  The iphone has this application,
which my friend with an iphone said, the app is called JOTT.

Can someone get this made for the G1?

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



[android-developers] Re: Favorites list

2008-11-05 Thread Romain Guy

The favorites list does not contain the name of all people you
call/that call you. It contains the name of the people you call *the
most*.

On Wed, Nov 5, 2008 at 1:12 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 Hi all

 I was wondering if anyone can point me in the right direction, I have
 come across a very annyoing feature in the default dialer, it seem to
 want to add anyone you call from your contacts list to the favorites
 list, even if you call this person once, worse yet if the person calls
 you and there name is in the phone book, they get added to your
 favorites. Is there a way to programitcly access the Favorites list in
 the dialer program and clear and or remove the names from that list.


 any help would be appreciated.. Thanks

 




-- 
Romain Guy
www.curious-creature.org

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



[android-developers] Re: Android Password Management Root Passwords

2008-11-05 Thread Brian Beattie

On Wed, 2008-11-05 at 04:20 -0800, staulkor wrote:
 I have successfully ported dropbear to Android in native C code. I got
 everything working and when I go to SSH to the phone (I am doing this
 on hardware, not the emulator), it asks for the username and password
 like usual. The problem is there isnt supposed to be a root password
 (at least I thought there wasn't supposed to be). I have tried
 multiple common passwords -- no password, admin, android, 1234, ,
 etc. None have granted me access.

Comment out the password check.

 
 Do you have any ideas of what the root password could be?
 
 Also, how does Android even keep track of passwords. I can't find a
 normal /etc/passwd or /etc/shadow file. I can barely even find
 configuration files. How does Android keep track of everything?
 
  
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting a bad thing?

Brian Beattie   LFS12947 | Honor isn't about making the right choices.
[EMAIL PROTECTED] | It's about dealing with the consequences.
www.beattie-home.net | -- Midori Koto


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



[android-developers] Re: App idea for a developer: Translate Voice to Text for SMS while driving

2008-11-05 Thread DigiJeff

awesome thanks for the response, didnt know!

On Nov 5, 9:40 pm, Wesley [EMAIL PROTECTED] wrote:
 too bad...
 Speech Recognition API not available yet. so I think... TTS or STT still
 impossible at this stage...
 but... according to some video... out there(youtube)...
 they claim that speech recognition is part of the component... but yet until
 now still not available...

 I also looking forward for this feature... waiting for this API...

 wesley.

 On Thu, Nov 6, 2008 at 10:55 AM, DigiJeff [EMAIL PROTECTED] wrote:

  I think it would be very beneficial for someone to make an application
  that translate voice to text for sms messages.  Example: When I'm
  driving I dont want to take my eyes off the road when I want to reply
  to a text, so if there was an easy way to respond back via sms with
  voice that would be so convenient.  The iphone has this application,
  which my friend with an iphone said, the app is called JOTT.

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



[android-developers] Re: Bash, C, or Korn Shell?

2008-11-05 Thread Bill Zimmerly

What do you mean? What kind of browser?

If you mean a HTML browser, it shouldn't be too difficult to port a
text browser like lynx to the emulator's shell, but WHY? (The
emulator's Webkit GUI browser works great already.)

On Oct 30, 1:18 pm, Ro9u3 [EMAIL PROTECTED] wrote:
 off topic... how do i access a browser thru the shell

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



[android-developers] Wrap Text around ImageView

2008-11-05 Thread Beginner

Hi,

I asked this in the begginer's group, without much success. So I'm
going to try it here as well...


I'm trying to get a pretty standard effect. An image (in an ImageView)
on the the top-left corner of the screen, with text (in a TextView)
that wraps around it. (So part of it is on the right of the image, and
the rest is on the bottom.

Could someone tell me how to achieve this? Is there a wrapper View I
could use?

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



[android-developers] Re: Can't return View derived class for BaseExpandableListAdapter? (used to work)

2008-11-05 Thread Jason Parekh
Hi Mark,

The problem is when you do:

 mcv.setLayoutParams(new
 LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
 LayoutParams.WRAP_CONTENT));

A view's layout parameters should be the type its parent expects to see
(because those parameters are really used for the layout (parent) to store
metadata for that child).  So, in this case, this mcv view wlil eventually
go into a ListView, but you're saying to use LinearLayout.LayoutParams.
Instead, try using ListView.LayoutParams.

jason



On Wed, Nov 5, 2008 at 1:09 PM, Mark Wyszomierski [EMAIL PROTECTED] wrote:


 Hi Jason,

 Could you show me the code of the View you're returning, to see if
 that'll work for me instead?

 Thanks

 On Nov 4, 2:14 am, Mark Wyszomierski [EMAIL PROTECTED] wrote:
  Hi Jason,
 
  Thanks for the help, I'll post the stack trace below. Maybe I'm
  creating the view incorrectly. I tried something like:
 
  public class MyChildView extends LinearLayout
  {
  public MyChildView(Context context)
  {
  super(context);
  }
  }
 
  // Inside my BaseExpandableListAdapter extended class:
  public View getChildView(int groupPosition,
   int childPosition,
   boolean isLastChild,
   View convertView,
   ViewGroup parent)
  {
  MyChildView mcv = new
  MyChildView(MyAdapter.this.getContext());
  mcv.setLayoutParams(new
  LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
  LayoutParams.WRAP_CONTENT));
  mcv.setOrientation(LinearLayout.HORIZONTAL);
  mcv.addView(new ImageView(...));
  mcv.addView(new TextView(...));
  return mcv;  // -- exception after return.
  }
 
  Returning a TextView like in the API sample works ok. Here's the stack
  trace:
 
  11-04 02:01:23.602: ERROR/AndroidRuntime(190): Uncaught handler:
  thread main exiting due to uncaught exception
  11-04 02:01:23.851: ERROR/AndroidRuntime(190):
  java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.ListView.setupChild(ListView.java:1646)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.ListView.makeAndAddView(ListView.java:1619)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.ListView.fillDown(ListView.java:601)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.ListView.fillSpecific(ListView.java:1189)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.ListView.layoutChildren(ListView.java:1454)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.AbsListView.onLayout(AbsListView.java:937)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.FrameLayout.onLayout(FrameLayout.java:294)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.layoutVertical(LinearLayout.java:999)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.onLayout(LinearLayout.java:920)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.FrameLayout.onLayout(FrameLayout.java:294)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.layoutVertical(LinearLayout.java:999)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.LinearLayout.onLayout(LinearLayout.java:920)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.widget.FrameLayout.onLayout(FrameLayout.java:294)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.View.layout(View.java:5637)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.ViewRoot.performTraversals(ViewRoot.java:771)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.os.Handler.dispatchMessage(Handler.java:88)
  11-04 02:01:23.851: ERROR/AndroidRuntime(190): at
  android.os.Looper.loop(Looper.java:123)
  11-04 02:01:23.851: 

[android-developers] Re: removing preference file and its implication

2008-11-05 Thread Jason Parekh
The SharedPreferences keep a cache in memory.  So, when you remove the file,
it ends up using the cached value (false) from memory.

Try rm'ing the file, killing your process (from Devices tab in eclipse), and
then relaunching.

jason


On Wed, Nov 5, 2008 at 3:30 AM, [EMAIL PROTECTED] [EMAIL PROTECTED]wrote:


 Hi,
 I noticed an interesting but unexpected behaviour with preference
 processing in Android. Here's what I'm trying to do.
 My app needs to perform some specific tasks when it is launched for
 the first time after installation. I use an element named
 firstLaunch for this purpose. I set its value to false in the first
 launch so that subsequent launches will see it properly.

 Here's the piece of code:

 package com.example;
SharedPreferences prefs = getSharedPreferences(pref,
 MODE_PRIVATE);
isFirstTimeLaunch = prefs.getBoolean(firstLaunch, true);
Log.d(readPreferences, read first time launch value:  +
 isFirstTimeLaunch);

SharedPreferences.Editor editorPrefs = prefs.edit();
editorPrefs.putBoolean(firstLaunch, false);
editorPrefs.commit();

 So far so good. Everything works as expected. However, I wanted to
 test its behavior when the preference file is removed. I removed the
 file '/data/data/com.example/shared_prefs/pref.xml' and relaunched the
 app within the emulator. To my surprise I found that my technique
 fails -- the variable 'isFirstTimeLaunch' will be false, even if I
 remove the preferences file.I repeated removing and launching the app
 many times and I see the same result every time.

 However, if I run the program from within Eclise IDE or if I do an
 'adb install' from the shell, things work as expected.Obviously these
 methods clear the app data. Isn't simply removing the preference file
 same as removing data since my app doesn't use anything else?

 Am I missing something here? Can someone explain what's wrong with my
 program?

 Thanks
 Devi Prasad

 


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



[android-developers] Re: removing preference file and its implication

2008-11-05 Thread Devi Prasad

Hi jason,
that works!
Thanks for pointing me to it.

On Thu, Nov 6, 2008 at 10:40 AM, Jason Parekh [EMAIL PROTECTED] wrote:
 The SharedPreferences keep a cache in memory.  So, when you remove the file,
 it ends up using the cached value (false) from memory.

 Try rm'ing the file, killing your process (from Devices tab in eclipse), and
 then relaunching.

 jason


 On Wed, Nov 5, 2008 at 3:30 AM, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

 Hi,
 I noticed an interesting but unexpected behaviour with preference
 processing in Android. Here's what I'm trying to do.
 My app needs to perform some specific tasks when it is launched for
 the first time after installation. I use an element named
 firstLaunch for this purpose. I set its value to false in the first
 launch so that subsequent launches will see it properly.

 Here's the piece of code:

 package com.example;
SharedPreferences prefs = getSharedPreferences(pref,
 MODE_PRIVATE);
isFirstTimeLaunch = prefs.getBoolean(firstLaunch, true);
Log.d(readPreferences, read first time launch value:  +
 isFirstTimeLaunch);

SharedPreferences.Editor editorPrefs = prefs.edit();
editorPrefs.putBoolean(firstLaunch, false);
editorPrefs.commit();

 So far so good. Everything works as expected. However, I wanted to
 test its behavior when the preference file is removed. I removed the
 file '/data/data/com.example/shared_prefs/pref.xml' and relaunched the
 app within the emulator. To my surprise I found that my technique
 fails -- the variable 'isFirstTimeLaunch' will be false, even if I
 remove the preferences file.I repeated removing and launching the app
 many times and I see the same result every time.

 However, if I run the program from within Eclise IDE or if I do an
 'adb install' from the shell, things work as expected.Obviously these
 methods clear the app data. Isn't simply removing the preference file
 same as removing data since my app doesn't use anything else?

 Am I missing something here? Can someone explain what's wrong with my
 program?

 Thanks
 Devi Prasad




 


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



[android-developers] Re: Thread Question

2008-11-05 Thread joshbeck

I'm fairly new at this and just to the point where threading makes
sense.
So, my my main process is also considered a thread?


True --- False

I write a simple HelloWorld.java program.
This program has 1 thread, the main flow of execution.

?

Thanks,
Josh


On Nov 5, 7:26 pm, hackbod [EMAIL PROTECTED] wrote:
 If the thread takes a while to complete, your main application thread
 probably shouldn't wait for it to complete...  otherwise, what's the
 point of putting that work in the thread, if you're just going to
 block on it at some point.

 Instead, consider using a Handler to post a message back to the main
 thread when the background thread has finished its work.

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

  I have a function that utilizes a thread.

  A variable the is needed for the program is populated after the thread
  call is made.

  The thread takes a while to complete.

  How can I make the program wait for a thread to complete before moving
  on?

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



[android-developers] Re: Bash, C, or Korn Shell?

2008-11-05 Thread Fish Kungfu
One indirect way is to ssh to a remote Linux box using ConnectBot and run
Lynx or whatever you like from that machine.  I've done just that and it
works fine.
Cheers...~~Fish~~


On Wed, Nov 5, 2008 at 11:51 PM, Bill Zimmerly [EMAIL PROTECTED]wrote:


 What do you mean? What kind of browser?

 If you mean a HTML browser, it shouldn't be too difficult to port a
 text browser like lynx to the emulator's shell, but WHY? (The
 emulator's Webkit GUI browser works great already.)

 On Oct 30, 1:18 pm, Ro9u3 [EMAIL PROTECTED] wrote:
  off topic... how do i access a browser thru the shell

 


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



[android-developers] Re: Listing Folders and Files

2008-11-05 Thread parani kumar
Dear gjs,

It was a great help to me..I will dig it and come up with a solution. Thanks
for your response.

-- 
Thanks,
parani
  On Thu, Nov 6, 2008 at 8:07 AM, gjs [EMAIL PROTECTED] wrote:


 Hi,

 Have a look at this, for example -

 http://www.anddev.org/android_filebrowser__v20-t101.html

 - you will need to adapt it for V1.0

 Regards

 On Nov 5, 8:49 pm, parani kumar [EMAIL PROTECTED] wrote:
  Dear All,
 
  Now I am working to get the folders list and files list.Can you suggest
 me
  how to get the list of Folders and files in the Emulator or Mobile ?
 
  --
  Thanks,
  parani
 


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



[android-developers] How to set up as a straight vertical display

2008-11-05 Thread dailyLife
Hi,EveryOne.
  Today, I finally had to buy the G1, I have to write the software installed on 
the G1 above to see results, every time I open the keyboard, software, images 
are also displayed along with change.

Who can tell me how to set up as a straight vertical display shows that even 
open the keyboard show the same way.

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



[android-developers] Re: Updating /system/etc/hosts has no effect

2008-11-05 Thread Anders Rundgren

Sorry but I found out that the carriage return characters left by
Notepad is incompatible with Linux.
Lessons learned: Windows != Linux :-)

On Nov 4, 7:37 am, Anders Rundgren [EMAIL PROTECTED] wrote:
 I managed through help from Google (thanks!) make /system writeable by
 issuing adb remount.
 I also managed updating /system/etc/hosts so that the magical address
 10.0.2.2 would point to my hosts symbolic name.

 ping to the magical address works
 ping to the symbolic address does not - unknownhost

 What am I missing here?

 Since these changes are only temporary, restart of the emulator is not
 an option either.

 Any help would be very much appreciated!

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



[android-developers] Re: Creating libraries for android

2008-11-05 Thread Anders Rundgren

Dear Hackbod,
Sorry for being a bit off with the terminology but Android is new to
me and to most other developers as well.

What I asked for, was how the thing you have called the drawer could
be reused.
I.e. I want to put a folder in the main drawer (must it be app
rather?) and when hitting that open a new drawer only containing my
main apps.  I don't like the APIDemos style of drawer (list) and I
don't want to write one myself.

Regarding the Java resources and Android, there is quite a bunch of
libraries that depend on local resources and there is no point (or
reason) to change them to use the Android resource scheme which is
more suitable for apps.  In my own work, I store XML Schema files
together with the Java objects that serialize and de-serialize
instance documents. Please do not remove this capability!

Anders

On Nov 5, 8:18 pm, hackbod [EMAIL PROTECTED] wrote:
 On Nov 5, 4:53 am, Anders Rundgren [EMAIL PROTECTED] wrote:

  Is the following workaround possible:
  Having multiple applications in a single APK.
  It seems so by looking at APIExamples but would it be possible to host
  applications in a own-defined tools window (I.e. like where apps
  seem to be installed)?  The docs are rather hard to decipher and there
  are almost no illustrations either

 Sorry, I don't really understand what you are asking for.  You can
 publish multiple main launcher activities from an .apk, if you want.
 Otherwise...  application is a pretty nebulous term on android 
 (seehttp://code.google.com/android/intro/appmodel.html) so you'll need to
 be more specific abotu waht you want.

  BTW, there are no problems hosting resources inlibrariesin Android,
  the Java standard getResorceAsStream works as expected.

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



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

2008-11-05 Thread hackbod

On Nov 5, 5:38 pm, marc0047 [EMAIL PROTECTED] wrote:
 I hope this will change! Consider this Google/Android: what if I want
 to put Android in my refrigerator or light fixture???

Well you can take the source code and modify it for your device.

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



[android-developers] Re: Change active AlarmManager event

2008-11-05 Thread hackbod

Well you can unschedule the old alarm and schedule a new one.

On Nov 5, 6:46 pm, hve.dk [EMAIL PROTECTED] wrote:
 Is it possible to change a repeating AlarmManager event - after the
 Activity, that scheduled the intent has finished. I like to change
 both the time for next event and the intervals between repeats.

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



[android-developers] Re: Thread Question

2008-11-05 Thread hackbod

http://code.google.com/android/intro/appmodel.html

The last section is on threads, though it's strongly recommended you
read the whole thing.

On Nov 5, 9:58 pm, joshbeck [EMAIL PROTECTED] wrote:
 I'm fairly new at this and just to the point where threading makes
 sense.
 So, my my main process is also considered a thread?

 True --- False

 I write a simple HelloWorld.java program.
 This program has 1 thread, the main flow of execution.

 ?

 Thanks,
 Josh

 On Nov 5, 7:26 pm, hackbod [EMAIL PROTECTED] wrote:

  If the thread takes a while to complete, your main application thread
  probably shouldn't wait for it to complete...  otherwise, what's the
  point of putting that work in the thread, if you're just going to
  block on it at some point.

  Instead, consider using a Handler to post a message back to the main
  thread when the background thread has finished its work.

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

   I have a function that utilizes a thread.

   A variable the is needed for the program is populated after the thread
   call is made.

   The thread takes a while to complete.

   How can I make the program wait for a thread to complete before moving
   on?

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