[android-developers] Re: Cursor position in the edit text

2009-07-16 Thread glory

Hi ,

As appears from your Pic you need to apply  gravity parameter to your
editText i.e android:gravity=top

Hope this works
Regards,
Glory
On Jul 16, 10:43 am, sheik sheik...@gmail.com wrote:
 Hi.
  kindly help me on it .. i am not getting any help while searching on
 internet regarding this query .. so i posted here...

 pls take a look..

 regards
 sheik

 On Jul 15, 11:03 am, sheik ahmed sheik...@gmail.com wrote:



  Hi developers,

    i was going through the notepad tutorials  the cursor was placed
  in the middle of edit text ..i tried to make the cursor to point in
  the first line as shown in the pic but not able to find the solution
  for it...

  Kindly look at the pic and give favorable reply..

  thanks
  regards
  Sheik Ahmed j

   edit text cursor.bmp
  1047KViewDownload- Hide quoted text -

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



[android-developers] Lot of unused code is generated when aidl tool is run againt a .aidl file.

2009-07-16 Thread krr_android

Hi

This is my aidl file.
IRemoteCounterServiceCallback.aidl

package com.training;

import com.training.IRemoteCounterServiceCallback;
import com.training.myCounter;

interface IRemoteCounterService {
  // Remote service interfaces
  int StartCounters(in myCounter counter);

  void registerCallback(IRemoteCounterServiceCallback cb);
  void unregisterCallback(IRemoteCounterServiceCallback cb);
}
---

The aidl generates

public static abstract class Stub extends android.os.Binder implements
com.training.IRemoteCounterService
{

}

containing an inner class

public static abstract class Stub extends android.os.Binder implements
com.training.IRemoteCounterService
{

}

here the abstract class Stub contains:
1. Impl for public boolean onTransact(int code, android.os.Parcel
data, android.os.Parcel reply, int flags) throws
android.os.RemoteException
(this is never invoked)

2. an inner class, private static class Proxy implements
com.training.IRemoteCounterService, which implemeted the following the
methods which are never invoked whent the program is run:
  a. public int StartCounters(com.training.myCounter
counter) throws android.os.RemoteException

  b. public void registerCallback
(com.training.IRemoteCounterServiceCallback cb) throws
android.os.RemoteException
  c. public void unregisterCallback
(com.training.IRemoteCounterServiceCallback cb) throws
android.os.RemoteException


My Application runs fine even if I remove the above mentioned unused
code from Stub class.

Now the Stub has just 3 methods,

public abstract class Stub extends android.os.Binder implements
IRemoteCounterService
{
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
public static IRemoteCounterService asInterface(android.os.IBinder
obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = (android.os.IInterface)
obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)(iin instanceof
com.training.IRemoteCounterService))) {
return ((com.training.IRemoteCounterService)iin);
}
return null;
}
public android.os.IBinder asBinder()
{
return this;
}
}

Why does the aidl generate code for

1. onTransact() inside Stub class??
2. inner class Proxy ??

Pls clarify. Thansk in advance.

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



[android-developers] no permission to read the sync settings

2009-07-16 Thread T_sky

Dear All:
   When I  install the sync.apk(from G2) to the emulator(SDK1.5),
install success, but when run the sync,the log as follows:
ERROR/DatabaseUtils(581): java.lang.SecurityException: no permission
to read the sync settings: Neither user 10022 nor current process has
android.permission.READ_SYNC_SETTINGS.

 How can I do to solve the problem?
 Thank you !

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



[android-developers] Re: Cursor position in the edit text

2009-07-16 Thread sheik


Thank you very much... i was searching a lot on net but turned out be
so simple..
just added  android:gravity=top  as u said...

thanks again for ur reply..



regards,
sheik

glory wrote:
 Hi ,

 As appears from your Pic you need to apply  gravity parameter to your
 editText i.e android:gravity=top

 Hope this works
 Regards,
 Glory
 On Jul 16, 10:43 am, sheik sheik...@gmail.com wrote:
  Hi.
   kindly help me on it .. i am not getting any help while searching on
  internet regarding this query .. so i posted here...
 
  pls take a look..
 
  regards
  sheik
 
  On Jul 15, 11:03 am, sheik ahmed sheik...@gmail.com wrote:
 
 
 
   Hi developers,
 
     i was going through the notepad tutorials  the cursor was placed
   in the middle of edit text ..i tried to make the cursor to point in
   the first line as shown in the pic but not able to find the solution
   for it...
 
   Kindly look at the pic and give favorable reply..
 
   thanks
   regards
   Sheik Ahmed j
 
    edit text cursor.bmp
   1047KViewDownload- Hide quoted text -
 
  - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getDeviceId returns null

2009-07-16 Thread MCON Dev
Mark,
Good ideas.. I went by your suggestion to move ahead. But this is a
potential risk (small one I guess).  I assumed that the emulator testing
would be enough atleast for the android application. Are there cases where
the product has worked well on the emulator but worked differently on the
actual product ?
Siddharth

On Wed, Jul 15, 2009 at 6:51 PM, Mark Murphy mmur...@commonsware.comwrote:


 MCON Dev wrote:
  Would it be a bad idea to expect the android
  guys to provide a valid deviceid, simcard number and phone number with
  their emulator.

 They may not be allowed to, depending how the telecommunications
 regulations surrounding deviceid, simcard number and phone number are
 written. And bear in mind that there may be a couple hundred sets of
 such regulations, one per country with cellular infrastructure.

  With options to change country and correspondingly get
  appropriate test bed ?

 I could certainly see having some emulator command-line switches to
 allow *you* to put in fake data.

 Besides, you can do this yourself. Just wrap your calls to getDeviceId()
 and kin in some class that detects the null values and substitutes in
 values read off of an SD card image, or some local file, or a value read
 off of the network. In production, you will use the real values; on
 emulators, you will use your test data.



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

 Android Development Wiki: http://wiki.andmob.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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2009-07-16 Thread Kaj Bjurman

What is file_name set to? Does it also include a path to the sdcard?


On 13 Juli, 23:53, doubleminus doublemi...@gmail.com wrote:
 Romain is?  I don't understand. Is there something I should be doing
 to avoid filenotfound exception?

 On Jul 13, 12:40 am, 郑伟 loveheaven_zheng...@hotmail.com wrote:



  You are right...

   Date: Sun, 12 Jul 2009 21:29:28 -0700
   Subject: [android-developers] Re: Unable to write text file to sdcard on  
   physical G1 device
   From: romain...@google.com
   To: android-developers@googlegroups.com

   Hi,

   Instead of:

FileOutputStream file_out = openFileOutput
(file_name,MODE_WORLD_READABLE);

   Just use:

   FileOutputStream file_out = new FileOutputStream(file_name);

   This should work.

   On Sun, Jul 12, 2009 at 8:10 PM, doubleminusdoublemi...@gmail.com wrote:

I need to write a fairly simple .csv file to the device's sdcard (so
it can then be emailed via Intent). The below code does not write the
file.

File file1 = new File(Environment.getExternalStorageDirectory(),
file_name);
FileOutputStream file_out = openFileOutput
(file_name,MODE_WORLD_READABLE);
BufferedOutputStream buf = new BufferedOutputStream(file_out);
OutputStreamWriter out_stream = new OutputStreamWriter(buf);

 // write fields in first row of spreadsheet then a new line
 for (int i = 0; i  FIELDS.length; i++)
 {
if (i != FIELDS.length - 1)
   out_stream.write(FIELDS[i] + ,);
else
   out_stream.write(FIELDS[i]);
 }

 out_stream.write(\n);

// more code here

I flush and close out_stream. I can even seem to be able to read from
the file on the device (printing above output, using fileinputstream,
to an edittext.

How can I get to this file on the sdcard?

Thanks!

double

   --
   Romain Guy
   Android framework engineer
   romain...@android.com

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

  _
  MSN 表情魔法书,改变你的对话时代!http://im.live.cn/emoticons/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2009-07-16 Thread Kaj Bjurman

I can't see that you are using file1 after that line. You are using
file_name.


On 14 Juli, 18:09, doubleminus doublemi...@gmail.com wrote:
 Isn't that what the first lines of code do?

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

 On Jul 13, 3:02 pm, Streets Of Boston flyingdutc...@gmail.com wrote:



  Simple. :-)
  The error says that the file does not exist... that means you should
  create it.
  Use File#createNewFile().

  On Jul 13, 5:53 pm, doubleminus doublemi...@gmail.com wrote:

   Romain is?  I don't understand. Is there something I should be doing
   to avoid filenotfound exception?

   On Jul 13, 12:40 am, 郑伟 loveheaven_zheng...@hotmail.com wrote:

You are right...

 Date: Sun, 12 Jul 2009 21:29:28 -0700
 Subject: [android-developers] Re: Unable to write text file to sdcard 
 on  physical G1 device
 From: romain...@google.com
 To: android-developers@googlegroups.com

 Hi,

 Instead of:

  FileOutputStream file_out = openFileOutput
  (file_name,MODE_WORLD_READABLE);

 Just use:

 FileOutputStream file_out = new FileOutputStream(file_name);

 This should work.

 On Sun, Jul 12, 2009 at 8:10 PM, doubleminusdoublemi...@gmail.com 
 wrote:

  I need to write a fairly simple .csv file to the device's sdcard (so
  it can then be emailed via Intent). The below code does not write 
  the
  file.

  File file1 = new File(Environment.getExternalStorageDirectory(),
  file_name);
  FileOutputStream file_out = openFileOutput
  (file_name,MODE_WORLD_READABLE);
  BufferedOutputStream buf = new BufferedOutputStream(file_out);
  OutputStreamWriter out_stream = new OutputStreamWriter(buf);

   // write fields in first row of spreadsheet then a new line
   for (int i = 0; i  FIELDS.length; i++)
   {
  if (i != FIELDS.length - 1)
 out_stream.write(FIELDS[i] + ,);
  else
 out_stream.write(FIELDS[i]);
   }

   out_stream.write(\n);

  // more code here

  I flush and close out_stream. I can even seem to be able to read 
  from
  the file on the device (printing above output, using 
  fileinputstream,
  to an edittext.

  How can I get to this file on the sdcard?

  Thanks!

  double

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

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

_
MSN 表情魔法书,改变你的对话时代!http://im.live.cn/emoticons/-Hidequoted text -

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



[android-developers] error while building the android code using make

2009-07-16 Thread Asif k

Hi all,

  I have downloaded the code successfully using repo sync on my
linux system and now I want to buld it using make but it fails and
telling that


frameworks/policies/base/PolicyConfig.mk:22:*** No module defined
for
the given PRODUCT_POLICY (android.policy_phone) . stop.  


So can  anyone plz tell me regarding this problem


Thanks,
Asif



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



[android-developers] Why the system kill my process?

2009-07-16 Thread Ivy

I have  many contacts in my G1,much as 2000.
When i call sb, the system will find this one is in my contacts or
not.Is there any posibilities that  the system  will stop searching
this contact and kill this process because this search will take a
relatively long time ?

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



[android-developers] about use notification to goto other activity

2009-07-16 Thread tstanly

hi all,

can use notification to goto other activity??
eg: from a to b use c.

my a.java code is:

Intent notifyIntent=new Intent(this,c.class);
notifyIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent appIntent=PendingIntent.getActivity(a.this,
0,notifyIntent,0);

Notification mNoti=new Notification();
mNoti.icon=iconId;
myNoti.tickerText=text;
myNoti.setLatestEventInfo(a.this,hi,text,appIntent);
myNotiManager.notify(0,mNoti);

===
and c is:

Intent i=new Intent();
i.setClass(c.this,a.class);
astartActivity(i);
===

but it dosen't work?
or my method is too stupid?
can somebody help me?

thanks!!!



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



[android-developers] Re: Lot of unused code is generated when aidl tool is run againt a .aidl file.

2009-07-16 Thread Dianne Hackborn
All of that code is used for IPC marshalling and unmarshalling.  If you are
never going to use the interface across processes, there is little reason to
use aidl in the first place.

On Wed, Jul 15, 2009 at 11:10 PM, krr_android k.rajire...@gmail.com wrote:


 Hi

 This is my aidl file.
 IRemoteCounterServiceCallback.aidl
 
 package com.training;

 import com.training.IRemoteCounterServiceCallback;
 import com.training.myCounter;

 interface IRemoteCounterService {
  // Remote service interfaces
  int StartCounters(in myCounter counter);

  void registerCallback(IRemoteCounterServiceCallback cb);
  void unregisterCallback(IRemoteCounterServiceCallback cb);
 }

 ---

 The aidl generates

 public static abstract class Stub extends android.os.Binder implements
 com.training.IRemoteCounterService
 {

 }

 containing an inner class

 public static abstract class Stub extends android.os.Binder implements
 com.training.IRemoteCounterService
 {

 }

 here the abstract class Stub contains:
 1. Impl for public boolean onTransact(int code, android.os.Parcel
 data, android.os.Parcel reply, int flags) throws
 android.os.RemoteException
 (this is never invoked)

 2. an inner class, private static class Proxy implements
 com.training.IRemoteCounterService, which implemeted the following the
 methods which are never invoked whent the program is run:
  a. public int StartCounters(com.training.myCounter
 counter) throws android.os.RemoteException

  b. public void registerCallback
 (com.training.IRemoteCounterServiceCallback cb) throws
 android.os.RemoteException
  c. public void unregisterCallback
 (com.training.IRemoteCounterServiceCallback cb) throws
 android.os.RemoteException


 My Application runs fine even if I remove the above mentioned unused
 code from Stub class.

 Now the Stub has just 3 methods,

 public abstract class Stub extends android.os.Binder implements
 IRemoteCounterService
 {
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
public static IRemoteCounterService asInterface(android.os.IBinder
 obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = (android.os.IInterface)
 obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)(iin instanceof
 com.training.IRemoteCounterService))) {
return ((com.training.IRemoteCounterService)iin);
}
return null;
}
public android.os.IBinder asBinder()
{
return this;
}
 }

 Why does the aidl generate code for

 1. onTransact() inside Stub class??
 2. inner class Proxy ??

 Pls clarify. Thansk in advance.

 Regards,
 



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

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

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



[android-developers] Re: what is the meaning of dumpsys meminfo PID output

2009-07-16 Thread Dianne Hackborn
There is no exact amount of memory usage, there is just various ways of
interpreting the way pages are mapped to the process.  The pss field is the
same pss you would see in procrank, shared dirty are dirty pages (unable to
be paged from disk) that are shared with other processes, and private dirty
are dirty pages entirely private to the process.  The last is the only ones
you are guaranteed to have freed when the process goes away.

On Wed, Jul 15, 2009 at 8:41 PM, arvind aravinda@gmail.com wrote:


 hi all,

 which is the exact amount of memory used by the process in dumpsys
 output
 native or dalvik or total?

 Sample output of dumsys command
 dumpsys meminfo 53
 Currently running services:
  meminfo
 
 DUMP OF SERVICE meminfo:
 Applications Memory Usage (kB):

 ** MEMINFO in pid 53 [system] **
  native   dalvikothertotal
size:   3788 5575  N/A 9363
   allocated: 3177 3624  N/A 6801
free:  302 1951  N/A 2253
   (Pss): 1592 3505 654011637
  (shared dirty): 1076 2900 1744 5720
(priv dirty): 1484 3196 1092 5772

  Objects
   Views:   79ViewRoots:5
 AppContexts:8   Activities:0
  Assets:4AssetManagers:4
   Local Binders:   47Proxy Binders:   52
 Death Recipients:   18
  OpenSSL Sockets:0

  SQL
heap:  192  dbFiles:0
   numPagers:3   inactivePageKB:  123
activePageKB:0

 Regards
 Aravinda
 



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

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

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



[android-developers] Re: Problem of vertical alignment in a RelativeLayout

2009-07-16 Thread elDoudou

Thank you for taking so much care, but unfortunately, the problem is
still not solved with your advice of setting the widgets 1 and 3
height to fill_parent (they were actually formerly set to
wrap_content). I'm kind of thinking that I should open up a
challenge for the person who solves this problem ;)

I must already mention that the RelativeLayout I'm working on is
actually a row in a  ListView. Here is a paste bin with the Eclipse
Android project, which should enable anyone to play around with that
problem: http://filebin.ca/zyvuwf/TestRelativeLayout.zip. This is a
zip which also contains a TestRelativeLayout folder where three
screenshot images are available:

 - wrap_content.png (also available at http://imagebin.ca/view/h4D3vm.html):
what I get before following Mark's advice. This is not what I expect,
because the widget 3 (the one in the middle) top border should be
bound to the parent widget top border ;
 - fill_parent.png (also available at http://imagebin.ca/view/TL_4Mpep.html):
what I get before once Mark's advice applied. This is not what I
expect, because the widget occupy too much vertical space ;
 - expected.png  (also available at http://imagebin.ca/view/DJcNguVD.html):
what I'd love to get!

Android layout experts are very welcome! Thank you for your time and
supports.
Regards,
Édouard


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



[android-developers] Are Binder objects leaked ?

2009-07-16 Thread Guillaume Perrot

I am developing an android service using aidl.
I realized that the objects returned in Service.onBind() are never
freed (e.g. finalize() is never called) even after onUnbind() and
onDestroy() and playing with the eclipse GC button.
I checked that the memory leak did not come from my Binder
implementation (by using an intermediate stub class, the finalize() is
actually called on the proxied instance).
Even if I return something like
return new Binder()
{
  @Override
  protected void finalize() throws Throwable
  {
 Log.v(tmp, finalizing binder);
 super.finalize();
  }
};
in onBind(), finalize is never called.
As a workaround I use a pool for binder objects wrapping real
implementations, and I reuse it but I wonder if it's safe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2009-07-16 Thread quill

Er...it makes me headache:) (Let's simplify it, there is only one
object, and we don't need to determine which object is touched.)
So do you use Euler Angle to rotate your gube or do you use Axis
Angle?
(I learn it from internet, it seems Euler Angle means rotating objects
around X, Y, Z axis, like this:
glRotatef( ax, 1,0,0 );
glRotatef( ay, 0,1,0 );
glRotatef( az, 0,0,1);

and Axis Angle seems like this:
axis = normalize( cross(v0, v1) );
angle = acosf( v0,v1);
glRotatef(angle, axis.x, axis.y, axis.z);)

I think my given idea is something like the Axis Angle method, I
caculate the angle as follows:
mAngle = ds * TOUCH_SCALE_FACTOR;
Because this mAngle is not defined as total angle(total angle means
defined like this: mAngle += ds * TOUCH_SCALE_FACTOR; in this case I
can't use total angle, because the axis is changable), every time when
I draw the GL world I need to get the previous state of the modelview,
and then rotate.
I use gl.glLoadMatrixf(mModelViewMatrix, 0) to reach the previous
state, but it works not so good.

If you use Axis Angle to rotate, how do you get the previous state?
I hope you can understand my poor English :)

On Jul 15, 10:00 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 Aha... you mean 'how to rotate using the touchscreen'.

 You're on the right track :-)

 However, i found that gluUnProject in the api did not work for some
 reason. I wrote my own (do a search on this forum).

 Handling swipes and translate them into rotations is not trivial. I
 wrote the app The Gube, a 3D rubix cube, and handling the user input
 (touch screen, trackball) is what i spent most my time on. It can not
 be explained in just a post here (without giving away my code).

 Some pointers:
 -On ACTION_DOWN, determine which patch/object your finger is touching.
 -On a swipe (onFling/onScroll on GestureDetector) and given the
 earlier found patch/object, determine which direction the swipe is
 happening in 3D space.
 -Using the patch/object's normal determine the relation of the swipe
 relative to the patch and rotate the patch/object accordingly.

 - To have a smooth interaction with swiping the screen and actually
 rotating the objects; don't do all the 3D math and such in your main
 GUI thread. Instead post user-action objects to a queue that is
 handled by your opengl rendering-thread. The rendering-thread not only
 renders your cube, but also reads the user-action objects from the
 queue and does the appropriate 3D handling and instructs the rendering
 engine how to modify the view/model accordingly.

 It took me a few months to get this right...

 On Jul 14, 11:25 pm, quill quill...@163.com wrote:



  I have read the API Demo code.
  I have come up an idea to do it like this:
  1)Map the touch point to 3D coordinates, and we can get a line when
  touch point moved, as Line1;
  2)Also we can get another line which is vertical to the screen. Signed
  as Line2: gluunproject(x,y,0)--gluunproject(x,y,1);
  3)Line1 and Line2 can form a plane, and we can get the plane's normal
  line, it is just the rotation axis;
  4)With a proper angle according to the touch point's moving distant,
  we can rotate the object.
  But this idea has come up a problem. how can I know the previous state
  of the object? I can't use the total angle to rotate because the axis
  is changable. I use gl.glLoadMatrixf(mModelViewMatrix, 0) to reach the
  previous state and then do glRotatef, it can work when I slip my
  finger quickly, but it works bad when I slip slowly.

  On Jul 14, 11:34 pm, Streets Of Boston flyingdutc...@gmail.com
  wrote:

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

   On Jul 14, 11:23 am, quill quill...@163.com wrote:

In the api demo, there is an example for how to rotate a cube, but it
can only rotate about X axis or Y axis, without Z-Axis Rotation.
So how to perform 3D Rotation? Any advice is appreciated.- Hide quoted 
text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[android-developers] how to put image(button) on the webview or mapview???

2009-07-16 Thread tstanly

hi all,

is there have api that can put image or imagebutton on the webview or
mapview??

because I just want to use a little space to put my image,
but use linearlayout, they must occupied a raw or a column,
not a little space.


how can do that???


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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread John Smith
Thanks to the help from David of the bouncycastle dev list I found out the
bc libs version is 1.34, which is now over 3 years old, is a slightly newer
version likely to be put into newer SDKs?

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



[android-developers] Re: Are Binder objects leaked ?

2009-07-16 Thread Guillaume Perrot

I eventually saw finalize() (just once) on the Binder object after
many tests.
My guess is that it's a soft reference, when using a WeakHashMap to
keep the binders in a pool, I realized that the pool was emptied after
each put meaning no hard reference has been kept. So I dropped the
pool solution.
However I thought soft references were freed only when the VM is near
out of memory which was not my case in my test (only 2MB allocated,
4MB in total heap).
Could anyone explain me the life cycle of a binder object ?

On Jul 16, 10:16 am, Guillaume Perrot guillaume.p...@gmail.com
wrote:
 I am developing an android service using aidl.
 I realized that the objects returned in Service.onBind() are never
 freed (e.g. finalize() is never called) even after onUnbind() and
 onDestroy() and playing with the eclipse GC button.
 I checked that the memory leak did not come from my Binder
 implementation (by using an intermediate stub class, the finalize() is
 actually called on the proxied instance).
 Even if I return something like
 return new Binder()
     {
       @Override
       protected void finalize() throws Throwable
       {
          Log.v(tmp, finalizing binder);
          super.finalize();
       }
     };
 in onBind(), finalize is never called.
 As a workaround I use a pool for binder objects wrapping real
 implementations, and I reuse it but I wonder if it's safe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] No coarse location in emulator

2009-07-16 Thread String

I'm working on an app which only requires approximate location, so
naturally, I've requested this in my manifest:

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

This works fine on an actual device (G1), but on the emulator, I can't
find a way to get any location data. Not only is there no
NETWORK_PROVIDER, but requesting an ACCURACY_COARSE provider returns
null:

final LocationManager lm =
  (LocationManager) getSystemService(Context.LOCATION_SERVICE);
final Criteria criterion = new Criteria();
criterion.setAccuracy(Criteria.ACCURACY_COARSE);
String provider = lm.getBestProvider(criterion, false);

And when working from this manifest, even requesting *any* provider
returns an empty list:

final LocationManager lm =
  (LocationManager) getSystemService(Context.LOCATION_SERVICE);
final ListString providers = lm.getProviders(false);

Which tells me that the emulator has no coarse location provider at
all.

My code works fine if I use android.permission.ACCESS_FINE_LOCATION
and send a mock location through DDM, no problems there. And of
course, a workaround is to keep it like that during development, and
only switch over to ACCESS_COARSE_LOCATION for release. But I'd really
like to avoid that step - it's a PITA, I have little doubt that I'll
forget to do it someday. :^/

Thanks for any ideas,

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



[android-developers] Re: Are Binder objects leaked ?

2009-07-16 Thread Guillaume Perrot

It appears that I have to wait some minutes before I can see the
finalize trace of my binder, but it eventually happens.
Maybe some sort of timeout in android code.

2009/7/16 Guillaume Perrot guillaume.p...@gmail.com:

 I eventually saw finalize() (just once) on the Binder object after
 many tests.
 My guess is that it's a soft reference, when using a WeakHashMap to
 keep the binders in a pool, I realized that the pool was emptied after
 each put meaning no hard reference has been kept. So I dropped the
 pool solution.
 However I thought soft references were freed only when the VM is near
 out of memory which was not my case in my test (only 2MB allocated,
 4MB in total heap).
 Could anyone explain me the life cycle of a binder object ?

 On Jul 16, 10:16 am, Guillaume Perrot guillaume.p...@gmail.com
 wrote:
 I am developing an android service using aidl.
 I realized that the objects returned in Service.onBind() are never
 freed (e.g. finalize() is never called) even after onUnbind() and
 onDestroy() and playing with the eclipse GC button.
 I checked that the memory leak did not come from my Binder
 implementation (by using an intermediate stub class, the finalize() is
 actually called on the proxied instance).
 Even if I return something like
 return new Binder()
     {
       @Override
       protected void finalize() throws Throwable
       {
          Log.v(tmp, finalizing binder);
          super.finalize();
       }
     };
 in onBind(), finalize is never called.
 As a workaround I use a pool for binder objects wrapping real
 implementations, and I reuse it but I wonder if it's safe.
 


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



[android-developers] Re: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-16 Thread Ted Chien

in /platform/packages/apps/Phone/src, check com/android/phone/
InCallScreen.java.

For listening to the phone change state, check com/android/phone/
CallNotifier.java.

Hope this helps.

On Jul 16, 11:37 am, Ivy ytang1...@gmail.com wrote:
 When a call in or out,what does the android do ?Get the changed state
 and turn to the default screen?
 Where is it in th source code?I cant find it ...In which class?

 On 7月16日, 上午9时33分, Jason Proctor jason.android.li...@gmail.com
 wrote:



  if you bring up an Activity with UI when the phone state listener
  goes off, the call UI appears on top of it. you can hit the back
  button to get back to your Activity, but, again, there is no current
  way to override the call UI.

  you have to live with it for now.

  Could i just intercept the incoming and ourgoing calls then let my
  screen be top of the screen?
  Or i just need to listen the phone's state?

  I don't want to modify the firmware.That's really a huge work.I'm just
  learing Android for 10 days

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



[android-developers] Re: Brightness change is not smooth

2009-07-16 Thread LD

If I will use the approach of brightness change present in android
sources with IHardware interface, what do you think, will it possibly
improve brightness transition?

On 15 Лип, 20:11, Dianne Hackborn hack...@android.com wrote:
 If you just change the brightness directly to what you want, the window
 manager will do a smooth ramp from the current to your new brightness (as
 much as it can with the hardware, many devices don't have a lot of possible
 screen brightness levels).





 On Wed, Jul 15, 2009 at 6:00 AM, LD lyubomyr.du...@gmail.com wrote:

  Hi,

  I am trying to resolve following task: smooth change of brightness
  from 100% to 0%, but can't gain effect of smoothness.

  Want to emphasize that I am using following approach of brightness
  change. The recommended one.

  WindowManager.LayoutParams lp = window.getAttributes();
  lp.screenBrightness = floatPercent;  // 0 - 1
  window.setAttributes(lp);

  Well, it obviously works, but not smooth.
  I will describe logic:

  I have a thread that changes brightness:

                 while (isRunning()) {
                     Thread.sleep(sleepTime);
                     spentTime+=sleepTime;
                     view.post(new Runnable() {
                         public void run() {
                             changeBrightness();
                         }
                     });
                 }

  We have duration of brightness change, for example 10 seconds.
  I calculate next value of floatPercent (see code snippet above) the
  way, sleepTime should always be less than 50ms.
  So looks like it had to be smooth.

  But I always get not smooth transition. It relates specially the range
  of 0% - 5% of brightness. Smoothness is completely lost on this
  brightness range.
  What can you propose?

  Thanks,
  Lyubomyr

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-16 Thread Ted Chien

However, com.android.phone is an system class and will be the first
class to be loaded in the phone (before the home screen is been
loaded). That means it's in firmware. If you want to change any screen
in it, you need to change the firmware, as other people stated.

I don't know if you can write your own phone class in the phone. If
it's been allowed in the Android system, when the phone is booting up,
it might prompt a screen to ask you if you want to use your own phone
class as the default class to replace com.android.phone. But to write
(and maintain) your own phone class would be a big task to do. If you
still wish to do so, I would say good luck.

If what I wrote here is not correct, please correct me. :)

Regards.

On 7月16日, 下午6時02分, Ted Chien hsiangtai.ch...@gmail.com wrote:
 in /platform/packages/apps/Phone/src, check com/android/phone/
 InCallScreen.java.

 For listening to the phone change state, check com/android/phone/
 CallNotifier.java.

 Hope this helps.

 On Jul 16, 11:37 am, Ivy ytang1...@gmail.com wrote:



  When a call in or out,what does the android do ?Get the changed state
  and turn to the default screen?
  Where is it in th source code?I cant find it ...In which class?

  On 7月16日, 上午9时33分, Jason Proctor jason.android.li...@gmail.com
  wrote:

   if you bring up an Activity with UI when the phone state listener
   goes off, the call UI appears on top of it. you can hit the back
   button to get back to your Activity, but, again, there is no current
   way to override the call UI.

   you have to live with it for now.

   Could i just intercept the incoming and ourgoing calls then let my
   screen be top of the screen?
   Or i just need to listen the phone's state?

   I don't want to modify the firmware.That's really a huge work.I'm just
   learing Android for 10 days

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



[android-developers] Re: error while building the android code using make

2009-07-16 Thread Mark Murphy

Asif k wrote:
 Hi all,
 
   I have downloaded the code successfully using repo sync on my
 linux system and now I want to buld it using make but it fails and
 telling that
 
 
 frameworks/policies/base/PolicyConfig.mk:22:*** No module defined
 for
 the given PRODUCT_POLICY (android.policy_phone) . stop.  
 
 
 So can  anyone plz tell me regarding this problem

That's probably a better question to ask of the Android open source project:

http://source.android.com/discuss

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

_Android Programming Tutorials_ Version 1.0 In Print!

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



[android-developers] Re: getDeviceId returns null

2009-07-16 Thread Mark Murphy

MCON Dev wrote:
 Mark,
 Good ideas.. I went by your suggestion to move ahead. But this is a
 potential risk (small one I guess).  I assumed that the emulator testing
 would be enough atleast for the android application. Are there cases
 where the product has worked well on the emulator but worked differently
 on the actual product ?

The closer you get to actual hardware, the less the emulator is real.
So sensors, camera, microphone, WiFi, GPS, SIM cards, and things like
that are all either unavailable or very fake on the emulator.

Similarly, the emulator lacks graphic hardware acceleration that may be
available on some devices (G1, HTC Magic), which may affect graphics
rendering rates.

For application logic that depends less on the hardware, the emulator is
great and generally seems to behave the way real devices do.

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

_Android Programming Tutorials_ Version 1.0 In Print!

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



[android-developers] Re: Direct access to GEARS geolocation without going through the browser interface

2009-07-16 Thread Mark Murphy

alexdonnini wrote:
 I have searched this group's archives, and several other sources for
 information on direct access to GEARS geolocation functions from an
 Android application. To date, I have not found any.

Google Gears is available for the Browser application, but it is not
part of the SDK for use by Java applications.

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

_Android Programming Tutorials_ Version 1.0 In Print!

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



[android-developers] How to Convert this Response into Map Object or into List View

2009-07-16 Thread android.vinny

Hi

How to Convet this response int o MAP Object or List View

Plz help me regarding this 

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

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



[android-developers] nio_char Charset is differnt

2009-07-16 Thread sachmi2

Hi,

Do android runtime has different charset then JVM as dalvik/tests/062-
character-encoding tests fails because the expected output has
different set of charset then actually.
Any information in this regard is appreciated

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



[android-developers] Re: error while building the android code using make

2009-07-16 Thread Ask

Hi Mark,

  I had asked the same question to android platform forum earlier but
nobody was  responding to that. This is the problem that I am facing
when just following the steps showing at http://source.android.com/download
. So even I dont know should I report it as bug ???

Regards,

Asif

On Jul 16, 3:21 pm, Mark Murphy mmur...@commonsware.com wrote:
 Asif k wrote:
  Hi all,

    I have downloaded the code successfully using repo sync on my
  linux system and now I want to buld it using make but it fails and
  telling that

  frameworks/policies/base/PolicyConfig.mk:22:*** No module defined
  for
  the given PRODUCT_POLICY (android.policy_phone) . stop.  

  So can  anyone plz tell me regarding this problem

 That's probably a better question to ask of the Android open source project:

 http://source.android.com/discuss

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

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



[android-developers] Re: error while building the android code using make

2009-07-16 Thread Ask

This is the link on android platform group,

http://groups.google.com/group/android-platform/browse_thread/thread/208c760eab587239/4974176be9b4ed03?hl=en#4974176be9b4ed03

On Jul 16, 3:46 pm, Ask asifk1...@gmail.com wrote:
 Hi Mark,

   I had asked the same question to android platform forum earlier but
 nobody was  responding to that. This is the problem that I am facing
 when just following the steps showing athttp://source.android.com/download
 . So even I dont know should I report it as bug ???

 Regards,

 Asif

 On Jul 16, 3:21 pm, Mark Murphy mmur...@commonsware.com wrote:



  Asif k wrote:
   Hi all,

     I have downloaded the code successfully using repo sync on my
   linux system and now I want to buld it using make but it fails and
   telling that

   frameworks/policies/base/PolicyConfig.mk:22:*** No module defined
   for
   the given PRODUCT_POLICY (android.policy_phone) . stop.  

   So can  anyone plz tell me regarding this problem

  That's probably a better question to ask of the Android open source project:

 http://source.android.com/discuss

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

  _Android Programming Tutorials_ Version 1.0 In Print!- Hide quoted text -

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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread John Smith
2009/7/16 Mark Murphy mmur...@commonsware.com


 This list is for the SDK. While it sure would be nice if they would
 re-add Bouncy Castle to the SDK, it's not there now...


re-add bouncy castle to SDK?

I'm looking at 1.5 code and some bc code is deff in there, mostly to do with
ssl/tls/smime but no JCE or OpenPGP.

$ ls
/usr/src/android/dalvik/libcore/security/src/main/java/org/bouncycastle/
asn1  crypto  i18n  jce  openssl  util  x509

Running this line of code:

System.out.println(+Security.getProvider(BC).getVersion());

Spits out 1.34 on Android 1.5...

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



[android-developers] Re: error while building the android code using make

2009-07-16 Thread Mark Murphy

Ask wrote:
   I had asked the same question to android platform forum earlier but
 nobody was  responding to that. This is the problem that I am facing
 when just following the steps showing at http://source.android.com/download

All I can tell you is that this list is for people developing on the
SDK, and that the list you originally asked your question on
(android-platform) is a better choice.

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

_Android Programming Tutorials_ Version 1.0 In Print!

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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread Mark Murphy

John Smith wrote:
 re-add bouncy castle to SDK?

By which I mean having all the classes be public, documenting the
version number, including them in the SDK documentation, etc. I haven't
used Bouncy Castle in years, but I seem to recall it offered more than
just the provider interface. I could be mistaken.

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

_Android Programming Tutorials_ Version 1.0 In Print!

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



[android-developers] Re: How to get the video stream from MediaRecorder?

2009-07-16 Thread zeeshan


how are you saving file on server side?

On Jul 13, 11:12 am, manoj manojkumar.m...@gmail.com wrote:
 I can able to view the video in vlc player if I change the video
 encoder to VideoEncoder.MPEG_4_SP and output format to
 OutputFormat.MPEG_4. But the video is playing very fastly not in usual
 speed.

 If I tried to open it in quicktime player, I am getting -2048 error.

 can you please help me to solve this.

 Thanks,
 Manoj.

 On Jul 13, 2:54 pm, manoj manojkumar.m...@gmail.com wrote:

  Hi Gergely Kis ,

  Thanks for your reply.

  I followed your blog, and able tostreamit.

  On the server side, I have written a socket which reads the data and
  writes it into the local file system.

  The server able to save the file.

  But when I tried to play the file, it showing some error message that
  the file is corrupted.

  Am I doing some mistake? can you please guide me. its very urgent.

  Thanks,
  Manoj.

  On Jul 11, 12:00 am, Gergely Kis gergely@gmail.com wrote:

   Hi,

   We wrote a blog about this a few days 
   ago:http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-an...

   Best Regards,
   Gergely

   On júl. 10, 17:44, manoj manojkumar.m...@gmail.com wrote:

hi,

I want togetthestreamand send it to server directly by using
   MediaRecorder.

Actually, I am able to record thevideo,and able to store it into
sdcard. Now I want to it tostream(livestream) to server rather than
storing it.

Can any one please suggest me how to do it?

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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread John Smith
2009/7/16 Mark Murphy mmur...@commonsware.com


 John Smith wrote:
  re-add bouncy castle to SDK?

 By which I mean having all the classes be public, documenting the
 version number, including them in the SDK documentation, etc. I haven't
 used Bouncy Castle in years, but I seem to recall it offered more than
 just the provider interface. I could be mistaken.


The problem with the current state things are in, it's difficult if not
impossible to use the libs from their site without a lot of effort, and I'm
sure it's not ideal to use the old code due to bugs and what not so things
are really in a state of disrepair for trying to use additional BC
functionality.

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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread Urs Grob

I think at some point the plan was to throw BC out and implement all
the crypto stuff using OpenSSL which is also on the device and should
be faster than the pure java impls in BC. (this might still be the
plan, not sure though)

Also BC is huge and was already reduced in size by throwing out many
algorithms due to space restrictions. (Can be seen in the
BouncyCastleProvider that should register all the algorithms)

http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=libcore/security/src/main/java/org/bouncycastle/jce/provider/BouncyCastleProvider.java;hb=HEAD

I don't think this crippled BC will be part of the api.

Someone who needs algorithms from BC would have to include it with the
app. I guess this would fail right now. This makes it much harder to
use BC stuff that has been dropped in the current BC version included
in the core libs. Dropping BC from the core libs would fix this
problem.

-- Urs

On Thu, Jul 16, 2009 at 12:58 PM, John Smithdeltafoxtrot...@gmail.com wrote:


 2009/7/16 Mark Murphy mmur...@commonsware.com

 John Smith wrote:
  re-add bouncy castle to SDK?

 By which I mean having all the classes be public, documenting the
 version number, including them in the SDK documentation, etc. I haven't
 used Bouncy Castle in years, but I seem to recall it offered more than
 just the provider interface. I could be mistaken.

 The problem with the current state things are in, it's difficult if not
 impossible to use the libs from their site without a lot of effort, and I'm
 sure it's not ideal to use the old code due to bugs and what not so things
 are really in a state of disrepair for trying to use additional BC
 functionality.


 


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



[android-developers] Re: BouncyCastle code in dalvik/libcore

2009-07-16 Thread John Smith
2009/7/16 Urs Grob grob@gmail.com


 Someone who needs algorithms from BC would have to include it with the
 app. I guess this would fail right now. This makes it much harder to
 use BC stuff that has been dropped in the current BC version included
 in the core libs. Dropping BC from the core libs would fix this
 problem.



I'm trying to get OpenPGP support into K-9, I agree that the BC code is
bloated and would love an alternate option but short of porting GnuPG or
similar I don't see any other options at the moment.

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



[android-developers] Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Ivy

i have some static variables and some registerListeners.
Do i need to release them all and remove these listeners?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Sujay Krishna Suresh
Yes, it is best to do that...
But i tried adding this as a ShutdownHook, but it failed to execute on app
exit...
I'd suggest that u release resources used by an activity in its onDestroy
method.

On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:


 i have some static variables and some registerListeners.
 Do i need to release them all and remove these listeners?
 



-- 
Regards,
Sujay
Lenny Bruce http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
- Communism is like one big phone company.

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



[android-developers] Re: getDeviceId returns null

2009-07-16 Thread MCON Dev
What would a android phone cost me. Is there a place I should look for 2nd
hand ones :).

On Thu, Jul 16, 2009 at 3:55 PM, Mark Murphy mmur...@commonsware.comwrote:


 MCON Dev wrote:
  Mark,
  Good ideas.. I went by your suggestion to move ahead. But this is a
  potential risk (small one I guess).  I assumed that the emulator testing
  would be enough atleast for the android application. Are there cases
  where the product has worked well on the emulator but worked differently
  on the actual product ?

 The closer you get to actual hardware, the less the emulator is real.
 So sensors, camera, microphone, WiFi, GPS, SIM cards, and things like
 that are all either unavailable or very fake on the emulator.

 Similarly, the emulator lacks graphic hardware acceleration that may be
 available on some devices (G1, HTC Magic), which may affect graphics
 rendering rates.

 For application logic that depends less on the hardware, the emulator is
 great and generally seems to behave the way real devices do.

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

 _Android Programming Tutorials_ Version 1.0 In Print!

 


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



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Ivy

I register a SensorListener,where should i unregister it?
In which method?
And how to release statics?

On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
wrote:
 Yes, it is best to do that...
 But i tried adding this as a ShutdownHook, but it failed to execute on app
 exit...
 I'd suggest that u release resources used by an activity in its onDestroy
 method.

 On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:

  i have some static variables and some registerListeners.
  Do i need to release them all and remove these listeners?

 --
 Regards,
 Sujay
 Lenny Bruce http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
 - Communism is like one big phone company.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getDeviceId returns null

2009-07-16 Thread Mark Murphy

MCON Dev wrote:
 Is there a place I should look for 2nd hand ones :).

eBay has many T-Mobile G1's available. You can probably win one for
between 200-300 USD. A Google Ion (HTC Magic with flashable firmware)
would be closer to 400-500 USD.

There are probably other places to pick up a used one as well -- eBay is
just easy for me to search...

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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Sujay Krishna Suresh
primitive statics will be taken care. jus make others null.
in onPause() unregister  in onResume register again.

2009/7/16 Ivy ytang1...@gmail.com


 I register a SensorListener,where should i unregister it?
 In which method?
 And how to release statics?

 On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
 wrote:
  Yes, it is best to do that...
  But i tried adding this as a ShutdownHook, but it failed to execute on
 app
  exit...
  I'd suggest that u release resources used by an activity in its onDestroy
  method.
 
  On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:
 
   i have some static variables and some registerListeners.
   Do i need to release them all and remove these listeners?
 
  --
  Regards,
  Sujay
  Lenny Bruce 
 http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
  - Communism is like one big phone company.
 



-- 
Regards,
Sujay
Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html  -
If God had wanted man to play soccer, he wouldn't have given us arms.

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



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Ivy

Thank  you for answer, but i have another question...

How to release these static methods...

And can i use the finalize to unregister the listener?

On 7月16日, 下午7时53分, Sujay Krishna Suresh sujay.coold...@gmail.com
wrote:
 primitive statics will be taken care. jus make others null.
 in onPause() unregister  in onResume register again.

 2009/7/16 Ivy ytang1...@gmail.com







  I register a SensorListener,where should i unregister it?
  In which method?
  And how to release statics?

  On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
  wrote:
   Yes, it is best to do that...
   But i tried adding this as a ShutdownHook, but it failed to execute on
  app
   exit...
   I'd suggest that u release resources used by an activity in its onDestroy
   method.

   On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:

i have some static variables and some registerListeners.
Do i need to release them all and remove these listeners?

   --
   Regards,
   Sujay
   Lenny Bruce 
 http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
   - Communism is like one big phone company.

 --
 Regards,
 Sujay
 Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html  -
 If God had wanted man to play soccer, he wouldn't have given us arms.- 
 隐藏被引用文字 -

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



[android-developers] Can not start Media Player Service

2009-07-16 Thread MikaSue

In LogCat, I see

E   542   MediaPlayerService   Couldn't open fd for 
content://settings/system/ringtone

E   761   MediaPlayer unable to create media player


Any help would be appreciated.  Im trying to play a mp3 file.

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



[android-developers] Re: extending parcelables

2009-07-16 Thread Bart van Wissen

 2. Use a generic Parcelable class type, in which case the marshalling code
 will inspect the class type, included that in the marshalled data, and use
 that to re-construct it on the other side.


I don't understand this.

My program deals with Condition objects, which can be put in a list to
specify a series of search conditions. There are specific classes like
StringCondition, TimeCondition, LocationCondition, etc. They are all
subclasses of Condition, but they all have their specific sets of
fields.

A list of those has to be passed to a service. Now how would I use a
generic Parcelable class for this? To be honest I don't have much
experience with generic classes.

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



[android-developers] Re: Direct access to GEARS geolocation without going through the browser interface

2009-07-16 Thread alexdonnini

Mark,

Thanks. I am aware of that. My question was different. Have you looked
into the GEARS geolocation class? If you have, you will have seen the
three Android Java classes I refer to below. My question is about the
purpose and intended use of those classes.

Given that Google has removed all of the MASF related functions from
the SDK, very few ways are left for accessing location information
starting from WIFI, GPS, or cell data. Fortunately, it appears that
the http://www.google.com/glm/mmap interface is still accessible (for
how long???). GEARS geolocation offers a way to derive location
information starting from GPS, WIFI, or radio information. However, it
would be incorrect to assume that access via a browser is optimal, or
appropriate for all applications.

The fact that geolocation includes Android-specific public Java
classes to access GPS, WIFI, and radio information leads me to believe
that, in fact, there is (should be) a way to directly access
geolocation functions from an Android application without going
through the browser.

If you are not familiar with this area, that's OK, just say so.

Thanks.

Alex Donnini

On Jul 16, 6:26 am, Mark Murphy mmur...@commonsware.com wrote:
 alexdonniniwrote:
  I have searched this group's archives, and several other sources for
  information on direct access to GEARS geolocation functions from an
  Android application. To date, I have not found any.

 Google Gears is available for the Browser application, but it is not
 part of the SDK for use by Java applications.

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

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



[android-developers] Re: Setting Ringer From Resource?

2009-07-16 Thread Donn Felker

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



[android-developers] Re: Direct access to GEARS geolocation without going through the browser interface

2009-07-16 Thread Mark Murphy

alexdonnini wrote:
 Thanks. I am aware of that. My question was different. Have you looked
 into the GEARS geolocation class? If you have, you will have seen the
 three Android Java classes I refer to below. My question is about the
 purpose and intended use of those classes.

Then you should be asking your question on a list that pertains to the
Android open source code:

http://source.android.com/discuss

This list is primarily for SDK development, not the inner workings of
the open source code.

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.0 Available!

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



[android-developers] Help in the HelloMapView tuto

2009-07-16 Thread sweet

Hi, I'm new to android programming and i want to do the HelloMapView
tuto (at the URL: 
http://developer.android.com/intl/fr/guide/tutorials/views/hello-mapview.html
).
I've a problem when they said :

5.Now open the HelloMapView.java file. For this Activity, we're going
to extend the special sub-class of Activity called MapActivity, so
change the class declaration to extend MapActicity, instead of
Activity:

public class HelloMapView extends MapActivity {

When i've done this Eclipse say: MapActivity cannot be resolved to a
type

Somebody can help me please ?

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



[android-developers] TextView

2009-07-16 Thread Mr.No

Hello,
how can i make the text in a textview wrap the tail into ... if the
textviews width is not enough for the text?
Like this:
Text: Hello World.
Assumed  that the text is too long for the textview, then the textview
should display this:
Wraped text: Hello ...

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



[android-developers] Re: java.net.ConnectException: localhost/127.0.0.1:8000

2009-07-16 Thread Zeeshan Muhammad
Hi Dear,

i got the same problem when i run my code below:

InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
Socket socket =   new Socket(serverAddr , 8088 );

i changed the port but same result.
anybody help plz


On Sat, Apr 18, 2009 at 1:25 AM, Hunter Peress hunt...@gmail.com wrote:


 I'm getting:java.net.ConnectException: localhost/127.0.0.1:8000 -
 Connection refused


 and...i have
 uses-permission  android:name=android.permission.INTERNET /
 declared in my manifest.xml

 What am I missing?


 


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



[android-developers] Re: TextView

2009-07-16 Thread Saurav Mukherjee
use this:

tv.setEllipsize(TruncateAt.END);

hope this helps u...

cheers!

On Thu, Jul 16, 2009 at 6:31 PM, Mr.No f.hi...@arcor.de wrote:


 Hello,
 how can i make the text in a textview wrap the tail into ... if the
 textviews width is not enough for the text?
 Like this:
 Text: Hello World.
 Assumed  that the text is too long for the textview, then the textview
 should display this:
 Wraped text: Hello ...

 thx folks in advance
 


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



[android-developers] Re: Server/Client in different machines

2009-07-16 Thread Zeeshan Muhammad
i have the similar problem,

my main java class listening a server socket at port 8088


now when my client (android) try to connect a socket it refused the
conenction

InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
Socket socket =   new Socket(serverAddr , 8088 );

  java.net.ConnectException:
/127.0.0.1:8088http://192.168.0.173/192.168.0.173:7000
Connection refused

anybody help plz

On Sun, Apr 26, 2009 at 7:53 PM, Rande Arievilo Moreira 
randeariev...@gmail.com wrote:


 Hi Ask,

 I'm developing the same application with Lillian. After debugging a
 little bit, I found out that we're receiving the following exception:

java.net.ConnectException: 192.168.0.173/192.168.0.173:7000 -
 Connection refused

 192.168.0.173 is the IP of my machine (the server) in the Local
 Network.
 Any suggestion?

 Thanks.


 On Apr 7, 9:21 am, Ask asifk1...@gmail.com wrote:
  Can you send the exception you are getting or some code snippets,
 
  it can be some io exception...
 
  On Apr 7, 4:58 pm,LillianBrandão lbrolive...@gmail.com wrote:
 
   I've already done at the server machines:
   redir add tcp:7000:7000.
 
   --
  LillianBrandão
 
   On Tue, Apr 7, 2009 at 8:47 AM, Ask asifk1...@gmail.com wrote:
 
Have you done port forwarding at server machine??
 
Any message which is coming to the server should be redirected
 towards
the emulator port : 7000
 
On Apr 7, 4:35 pm,LillianBrandão lbrolive...@gmail.com wrote:
 Hi all,
 
 I have an application client/server and I want to install this
application
 in differente machines. The server is located in IP_SERVER,
 listening
port
 7000.
 I want to start a cliente in another machine with IP_Y and connect
 to the
 server on the different machine.
 
 I've started the server and I've created the socket like this:
 ... new ServerSocket(7000);
 
 I've started the client and I've created the socket like this:
 ...new Socket(SERVER_IP, 7000)
 
 But the client did not connect to the server. I've already set the
 INTERNET_PERMISSION.
 Any suggestions how to do it?
 Anybody else have already done a client/server application that
communicate
 between differente machines?
 
 Thanks in advance,
LillianBrandão.- Hide quoted text -
 
   - Show quoted text -
 


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



[android-developers] com.android.phone not responding

2009-07-16 Thread Ash

I have added a new service (through SystemServer.java), my service get
started successfully but the problem is after adding my new service, I
keep on getting the popup which says com.android.phone needs to be
closed.

When I remove my service it doesnot complain about it.

What could be the problem?

Ash

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



[android-developers] Re: java.net.ConnectException: localhost/127.0.0.1:8000

2009-07-16 Thread Urs Grob

127.0.0.1 is the device, or the emulator. So as long as you don't have
a server listening on that port on the emulator/device itself you
won't be able to connect. If you want to connect to to a server
running on the host, then you'll have to connect to 10.0.2.2 (or
something like that)

If already know this then you need to explain a bit more or it will be
hard to find somebody that can help you.

-- Urs

On Thu, Jul 16, 2009 at 3:13 PM, Zeeshan Muhammadgenx...@gmail.com wrote:
 Hi Dear,

 i got the same problem when i run my code below:

 InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
 Socket socket =   new Socket(serverAddr , 8088 );

 i changed the port but same result.
 anybody help plz


 On Sat, Apr 18, 2009 at 1:25 AM, Hunter Peress hunt...@gmail.com wrote:

 I'm getting:java.net.ConnectException: localhost/127.0.0.1:8000 -
 Connection refused


 and...i have
 uses-permission  android:name=android.permission.INTERNET /
 declared in my manifest.xml

 What am I missing?





 


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



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Sujay Krishna Suresh
Never use finalize for anything
i dont no if u can release static METHODS...

2009/7/16 Ivy ytang1...@gmail.com


 Thank  you for answer, but i have another question...

 How to release these static methods...

 And can i use the finalize to unregister the listener?

 On 7月16日, 下午7时53分, Sujay Krishna Suresh sujay.coold...@gmail.com
 wrote:
  primitive statics will be taken care. jus make others null.
  in onPause() unregister  in onResume register again.
 
  2009/7/16 Ivy ytang1...@gmail.com
 
 
 
 
 
 
 
   I register a SensorListener,where should i unregister it?
   In which method?
   And how to release statics?
 
   On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
   wrote:
Yes, it is best to do that...
But i tried adding this as a ShutdownHook, but it failed to execute
 on
   app
exit...
I'd suggest that u release resources used by an activity in its
 onDestroy
method.
 
On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:
 
 i have some static variables and some registerListeners.
 Do i need to release them all and remove these listeners?
 
--
Regards,
Sujay
Lenny Bruce 
  http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
- Communism is like one big phone company.
 
  --
  Regards,
  Sujay
  Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html
  -
  If God had wanted man to play soccer, he wouldn't have given us arms.-
 隐藏被引用文字 -
 
  - 显示引用的文字 -
 



-- 
Regards,
Sujay
Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html
- Computers are useless. They can only give you answers.

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



[android-developers] Re: unknownhostexception in my app on device

2009-07-16 Thread biAji



On Jul 14, 1:19 pm, ravi ramkrishan.r...@gmail.com wrote:
 Hi Vinod,
 I have given Internet permission in Manifest.xml file. Currently
 problem is 40% times it work fine 60% time it gives unknown host
 exception. I don't why it it happens few times only?

It looks the DNS server you are using for test not act properly.

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



[android-developers] Re: android:scrollbars in programmatic way

2009-07-16 Thread Tim

Thanks, nice man :)


On Jul 15, 12:45 pm, Romain Guy romain...@google.com wrote:
 You can:

 http://developer.android.com/reference/android/view/View.html#setHori...)http://developer.android.com/reference/android/view/View.html#setVert...)

 On Tue, Jul 14, 2009 at 6:32 PM, Timtim.ka...@gmail.com wrote:

  Hi, android:scrollbars are used in XML layout file to declare
  whether a view having scrollbar. I would like do it programmatic.
  Anyone know how?
  Btw, according to api doc, there seems no direct peer method. Should I
  have to read a attr xml file?
 http://developer.android.com/reference/android/view/View.html

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] tabhost disappearing randomly

2009-07-16 Thread Pablo Szyrko

I have an application that has two tabs:
-First tab contains contacts
-Second tab contains chats

Some times when I select the second tab it dissapears and a black
background is shown.
This issue does't happen when the first tab is shown
You can find a picture of the issue here:
http://1.bp.blogspot.com/_2UoVsSnv2Gk/Sl8u2o-tvzI/AJc/RMUMfKUB7X4/s1600-h/chat.JPG
This issue happens randomly and i can't reproduce it consistenly.
Could you help me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Avoid Failed Binder Transaction

2009-07-16 Thread biAji



On Jul 13, 1:47 pm, Don Tran arro...@gmail.com wrote:
 My application is getting a failed binder transaction, which causes it
 to completely hang,  when I do the following:

 Process process = Runtime.getRuntime().exec(SOME COMMAND);
 BufferedReader br = new BufferedReader(new InputStreamReader
 (process.getInputStream());
 While(read the content using br.readLine())

I count the same issue, and try a lot to eliminate it but not
success..

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



[android-developers] Re: Avoid Failed Binder Transaction

2009-07-16 Thread biAji



On Jul 13, 1:47 pm, Don Tran arro...@gmail.com wrote:
 My application is getting a failed binder transaction, which causes it
 to completely hang,  when I do the following:

 Process process = Runtime.getRuntime().exec(SOME COMMAND);
 BufferedReader br = new BufferedReader(new InputStreamReader
 (process.getInputStream());
 While(read the content using br.readLine())

I count the same issue, and try a lot to eliminate it but not
success.. And the most important thing is:  I can not repeat the
error,
it's happened randomly.


I guess it's not thread safe.~


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



[android-developers] Re: Tabhost Disappearing List view

2009-07-16 Thread Pablo Szyrko

I have posted a new entry (tabhost disappearing randomly) and it
looks like a similar issue.

On 6 jul, 12:56, Georgios Galyfos yorg...@gmail.com wrote:
 Hello, did you by any chance found out what was causing this behavbiour? I
 am facing a similar situation:

 I set setCurrentTab(0) initially and even though the listView under the
 first tab has contents, they are not displayed. This happend all time though
 for me..

 Should the listView have already contents before calling the addTab()? I
 have tried both ways anyway and still nothing...

 Any ideas?

 On Sat, May 2, 2009 at 3:13 PM, cre cretcheu2...@gmail.com wrote:

  Mark,

  Thanks.

  Will do both.

  On May 1, 9:05 pm, Mark Murphy mmur...@commonsware.com wrote:
   cre wrote:
I didn't answer your previous question.  No, there are not problems
with other Adapters only the ones in TabHost.
I went back and looked at the Hierarchyviewer property values and it
shows an item count of 3, which is the number of items in this
ListView that should be visible but are not.  I am sure I will see the
same thing with getCount() next time it fails. So I would say that the-
adapter-thinks-its-empty theory is negative.  It thinks it has 3 items
but has lost the pointer to them somehow.

I also didn't make it clear that this problem only occurs after
leaving the activity and returning. As long as I remain in the
activity there is no problem with the ListViews.  That is why I
suggested putting the code in onResume().

At this point I firmly believe that this is a bug.

   That is quite likely. The question is, a bug in what?

   I recommend you try replacing ArrayAdapter.createFromResource() with
   some other constructed Adapter (e.g., new ArrayAdapter()) and see if the
   problem persists. If the problem goes away, then the problem is fairly
   well narrowed down, and you have a workaround. I suspect that
   createFromResource() is not the most popular way of creating adapters,
   so it is possible the difficulty lies there.

   Also, is this on 1.5 final, or some other edition? If you are not on 1.5
   final, you probably should try it there, since the issue might have been
   resolved.

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

   _The Busy Coder's Guide to Android Development_ Version 2.0 Available!-
  Hide quoted text -

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



[android-developers] Re: java.net.ConnectException: localhost/127.0.0.1:8000

2009-07-16 Thread Zeeshan Muhammad
thanks for reply Grob,

i tried it on both emulator and on my real device (connected to my pc) but i
got the same exception both time
 java.net.ConnectException: 127.0.0.1:8088 http://127.0.0.1:8000/ -
  Connection refused

i changed the connection to

Socket socket =   new Socket(10.0.2.2 , 8088 );


now i got no route to host exception.

i have a main java class as a server socket (listening on port 8088) running
on same pc which i want to connect to.

i am testing client(android ) and  server on same pc at the moment but
ideally server would be a remote later



On Thu, Jul 16, 2009 at 2:26 PM, Urs Grob grob@gmail.com wrote:


 127.0.0.1 is the device, or the emulator. So as long as you don't have
 a server listening on that port on the emulator/device itself you
 won't be able to connect. If you want to connect to to a server
 running on the host, then you'll have to connect to 10.0.2.2 (or
 something like that)

 If already know this then you need to explain a bit more or it will be
 hard to find somebody that can help you.

 -- Urs

 On Thu, Jul 16, 2009 at 3:13 PM, Zeeshan Muhammadgenx...@gmail.com
 wrote:
  Hi Dear,
 
  i got the same problem when i run my code below:
 
  InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
  Socket socket =   new Socket(serverAddr , 8088 );
 
  i changed the port but same result.
  anybody help plz
 
 
  On Sat, Apr 18, 2009 at 1:25 AM, Hunter Peress hunt...@gmail.com
 wrote:
 
  I'm getting:java.net.ConnectException: localhost/127.0.0.1:8000 -
  Connection refused
 
 
  and...i have
  uses-permission  android:name=android.permission.INTERNET /
  declared in my manifest.xml
 
  What am I missing?
 
 
 
 
 
  
 

 


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



[android-developers] Re: java.net.ConnectException: localhost/127.0.0.1:8000

2009-07-16 Thread Zeeshan Muhammad
i am able to connect on emulator but no route to host exception when i try
to connect on real device

On Thu, Jul 16, 2009 at 3:16 PM, Zeeshan Muhammad genx...@gmail.com wrote:

 thanks for reply Grob,

 i tried it on both emulator and on my real device (connected to my pc) but
 i got the same exception both time
  java.net.ConnectException: 127.0.0.1:8088 http://127.0.0.1:8000/ -
 Connection refused

 i changed the connection to

 Socket socket =   new Socket(10.0.2.2 , 8088 );


 now i got no route to host exception.

 i have a main java class as a server socket (listening on port 8088)
 running on same pc which i want to connect to.

 i am testing client(android ) and  server on same pc at the moment but
 ideally server would be a remote later




 On Thu, Jul 16, 2009 at 2:26 PM, Urs Grob grob@gmail.com wrote:


 127.0.0.1 is the device, or the emulator. So as long as you don't have
 a server listening on that port on the emulator/device itself you
 won't be able to connect. If you want to connect to to a server
 running on the host, then you'll have to connect to 10.0.2.2 (or
 something like that)

 If already know this then you need to explain a bit more or it will be
 hard to find somebody that can help you.

 -- Urs

 On Thu, Jul 16, 2009 at 3:13 PM, Zeeshan Muhammadgenx...@gmail.com
 wrote:
  Hi Dear,
 
  i got the same problem when i run my code below:
 
  InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
  Socket socket =   new Socket(serverAddr , 8088 );
 
  i changed the port but same result.
  anybody help plz
 
 
  On Sat, Apr 18, 2009 at 1:25 AM, Hunter Peress hunt...@gmail.com
 wrote:
 
  I'm getting:java.net.ConnectException: localhost/127.0.0.1:8000 -
  Connection refused
 
 
  and...i have
  uses-permission  android:name=android.permission.INTERNET /
  declared in my manifest.xml
 
  What am I missing?
 
 
 
 
 
  
 

 



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



[android-developers] Re: How to send MMS in Android Mobile

2009-07-16 Thread Jimmy Huang

Anyone know it ?



On Jul 12, 10:03 pm, Jimmy Huang huan...@gmail.com wrote:
 Does anyone can help me ?

 Thanks
 Jimmy

 On Jul 10, 10:38 pm, Jimmy Huang huan...@gmail.com wrote:



  Thanks John,

  Does I only import thisMMSgit to my application, I can have my
  application sendMMSprobably? please give me tips. thanks very much!

  Regards,
  Jimmy

  On Jul 10, 7:47 pm, john john4...@gmail.com wrote:

   You could send it programatically but you would probably need to look
   deep within the messaging application code.

   Start here -

  http://android.git.kernel.org/?p=platform/packages/apps/Mms.git;a=tre...

   good luck!

   On 7月10日, 上午9時47分, Jimmy Huang huan...@gmail.com wrote:

Thank Yusuf. Yes, I known this, but it will open up the messaging page
to ask user to select the receipient and send.  I will like to send
   MMSdirectly from my application, don't need to popup the window
request the receipient, any idea?

Thanks,
Jimmy

On Jul 10, 8:47 am, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote:

 GIYFhttp://jtribe.blogspot.com/2008/12/sending-mms-with-android.html

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

 On Jul 9, 2:45 am, Jimmy Huang huan...@gmail.com wrote:

  Dear All,

  I would like to develop an  Android Application to allow the user to
  sendMMSon Mobile, does anyone know which API should be used?

  Thanks,
  Jimmy- Hide quoted text -

 - Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[android-developers] Re: Content rendering for WebView

2009-07-16 Thread m8

Thanks.

But my use case is I would know the MIME type of the data only after I
get the data. So using WebViewClient won't help me. As I would not
know the MIME when user has selected the link...

On Jul 15, 1:40 pm, Jason Proctor jason.android.li...@gmail.com
wrote:
 Hi

 Can anyone help me to understand how WebView decided which content it
 can render and which it can't? For example I am inside a webview
 select a link and if the link sends an XML file I want my application
 to handle to data instead of WebView,

 Is this possible?

 Thanks,

 -Amit

 install a WebViewClient in your WebView and override
 shouldOverrideUrlLoading(). you can then decide what to do about a
 particular link and return whether the WebView should do anything
 about it or not.

 this works most of the time for me. the only problem is that the link
 handler is *not* called when you reload the same URL - and the same
 URL in this instance means the same host and path, regardless of
 parameters. it's logged as an issue.

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



[android-developers] How do I launch the GMail client programmatically?

2009-07-16 Thread Flying Coder


I know I can do this:

Intent intent = pm.getLaunchIntentForPackage(com.google.android.gm);

startActivity(intent);

But, are there any generic intents that will launch gmail?  For
instance, I can use ACTION_SEND to send an email, but what similar
intent will simply launch gmail?

Thanks,
Steve

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



[android-developers] stopService slow to act

2009-07-16 Thread nuno

Hi all,

I am starting a service from a broadcast receiver, using
android:process=:remote,  which from what I understand means unbind.
That BR dies.
The service is runs some TTS (text2speach) in a cycle until a second
broadcast receiver comes into action and executes stopService.

I am using action names to start and stop the service.

The problem I am having is that after the stopService is executed the
service is still alive for a good 20 seconds when finally dies from
timeout. The other think I notice is that onDestroy()  is never
called.

Am I doing something silly (I know the answer is yes!) :)

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



[android-developers] Re: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-16 Thread Fred Grott(shareme)

Ted,

You probably cannot I did research on this for a potential startup its
not possible currently

Fred Grott
http://mobilebytes.wordpress.com

On Jul 16, 5:12 am, Ted Chien hsiangtai.ch...@gmail.com wrote:
 However, com.android.phone is an system class and will be the first
 class to be loaded in the phone (before the home screen is been
 loaded). That means it's in firmware. If you want to change any screen
 in it, you need to change the firmware, as other people stated.

 I don't know if you can write your own phone class in the phone. If
 it's been allowed in the Android system, when the phone is booting up,
 it might prompt a screen to ask you if you want to use your own phone
 class as the default class to replace com.android.phone. But to write
 (and maintain) your own phone class would be a big task to do. If you
 still wish to do so, I would say good luck.

 If what I wrote here is not correct, please correct me. :)

 Regards.

 On 7月16日, 下午6時02分, Ted Chien hsiangtai.ch...@gmail.com wrote:

  in /platform/packages/apps/Phone/src, check com/android/phone/
  InCallScreen.java.

  For listening to the phone change state, check com/android/phone/
  CallNotifier.java.

  Hope this helps.

  On Jul 16, 11:37 am, Ivy ytang1...@gmail.com wrote:

   When a call in or out,what does the android do ?Get the changed state
   and turn to the default screen?
   Where is it in th source code?I cant find it ...In which class?

   On 7月16日, 上午9时33分, Jason Proctor jason.android.li...@gmail.com
   wrote:

if you bring up an Activity with UI when the phone state listener
goes off, the call UI appears on top of it. you can hit the back
button to get back to your Activity, but, again, there is no current
way to override the call UI.

you have to live with it for now.

Could i just intercept the incoming and ourgoing calls then let my
screen be top of the screen?
Or i just need to listen the phone's state?

I don't want to modify the firmware.That's really a huge work.I'm just
learing Android for 10 days

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



[android-developers] Re: error while building the android code using make

2009-07-16 Thread Fred Grott(shareme)

simple  google search usually turns up the solution ..it did fro my
build error on ubunut

On Jul 16, 5:48 am, Ask asifk1...@gmail.com wrote:
 This is the link on android platform group,

 http://groups.google.com/group/android-platform/browse_thread/thread/...

 On Jul 16, 3:46 pm, Ask asifk1...@gmail.com wrote:

  Hi Mark,

    I had asked the same question to android platform forum earlier but
  nobody was  responding to that. This is the problem that I am facing
  when just following the steps showing athttp://source.android.com/download
  . So even I dont know should I report it as bug ???

  Regards,

  Asif

  On Jul 16, 3:21 pm, Mark Murphy mmur...@commonsware.com wrote:

   Asif k wrote:
Hi all,

  I have downloaded the code successfully using repo sync on my
linux system and now I want to buld it using make but it fails and
telling that

frameworks/policies/base/PolicyConfig.mk:22:*** No module defined
for
the given PRODUCT_POLICY (android.policy_phone) . stop.  

So can  anyone plz tell me regarding this problem

   That's probably a better question to ask of the Android open source 
   project:

  http://source.android.com/discuss

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

   _Android Programming Tutorials_ Version 1.0 In Print!- Hide quoted text -

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



[android-developers] Re: Uploading/Downloading/Listing files online from application

2009-07-16 Thread biAji



On Jul 12, 8:25 pm, jonne jonne.z...@gmail.com wrote:
 Dear developers,

 And I used the below code.
 The problem with this code is I get an IOException Unable to connect
 to server: {0}.

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



[android-developers] Why does DDMS sometimes only show one line of logs?

2009-07-16 Thread Anna PS

... usually happens after a force close. Instead of showing the usual
30 lines or so of logs + scrollable history, it only shows a single
line or a couple of lines. Very annoying!

The only fix that I can find is to restart DDMS.

Anyone have any ideas?

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



[android-developers] no route to host Exception on Socket

2009-07-16 Thread zeeshan

Hi Experts,

i am working on a client server program in android.
i have a Main java class running on my pc as a server socket listening
to the port 8626 and i am trying to connect android client (on real
device ) to that server.

Socket socket =   new Socket(IP , 8626 );

i tried my local ip and it gives me no route to host exception
please suggset which ip i need.

if i use ip 10.0.2.2 and run on emulator it succeeds but not on real
device.

client and server both are on same pc, and android device is attached
to my pc as well.

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



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

2009-07-16 Thread dan raaka
in the short run, samsung may host the compatible adb on their site

-Dan


On Wed, Jul 15, 2009 at 7:38 AM, Kitagua m.wuerth...@googlemail.com wrote:


 That are quite good news. I always have the Samsung Galaxy phone and
 planned to do some development using it. I really hope it will not
 take too long to get this SDK update.


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

 


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



[android-developers] why this code can't work

2009-07-16 Thread tstanly

hi all,

originall I have a zoomcontrol that can work,
the code is:
=
  ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);
  zoom.addView(mWebView1.getZoomControls());
==
and then,
I want to change the zoom controls to a imagebutton,
I think it's should work, but didn't!
the code is:

 ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom);
  zoom.addView((View)findViewById(R.id.mImageButton1));


can somebody tell me how to edit or how to do?

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



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

2009-07-16 Thread johnny

I'm running into the same problem but i have Vodafone's Htc Magic...do
i require a different version of the adb tool as well?

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



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

2009-07-16 Thread David Turner
No, the magic should be supported out of the box with the 1.5 SDK.

What exact platform are you on?

On Thu, Jul 16, 2009 at 6:22 PM, johnny johnny.ra...@gmail.com wrote:


 I'm running into the same problem but i have Vodafone's Htc Magic...do
 i require a different version of the adb tool as well?

 


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



[android-developers] Re: stopService slow to act

2009-07-16 Thread Dianne Hackborn
I would guess you are doing long-running work on the main thread of the
service.

And any particular reason you are running it in a separate process?  There
is very rarely a need to do so.  (Actually doing this probably hid the
problem with blocking the main thread, since there is much less going on in
that process, so much less chance for the system to detect a problem.)

On Thu, Jul 16, 2009 at 8:15 AM, nuno nba...@gmail.com wrote:


 Hi all,

 I am starting a service from a broadcast receiver, using
 android:process=:remote,  which from what I understand means unbind.
 That BR dies.
 The service is runs some TTS (text2speach) in a cycle until a second
 broadcast receiver comes into action and executes stopService.

 I am using action names to start and stop the service.

 The problem I am having is that after the stopService is executed the
 service is still alive for a good 20 seconds when finally dies from
 timeout. The other think I notice is that onDestroy()  is never
 called.

 Am I doing something silly (I know the answer is yes!) :)

 Thanks for the help.
 



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

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

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



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Yusuf T. Mobile

You don't need to release the static variable. For the finalize-is-
discouraged and other Android code style rules, see:
http://source.android.com/submit-patches/code-style-guide



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



On Jul 16, 6:32 am, Sujay Krishna Suresh sujay.coold...@gmail.com
wrote:
 Never use finalize for anything
 i dont no if u can release static METHODS...

 2009/7/16 Ivy ytang1...@gmail.com







  Thank  you for answer, but i have another question...

  How to release these static methods...

  And can i use the finalize to unregister the listener?

  On 7月16日, 下午7时53分, Sujay Krishna Suresh sujay.coold...@gmail.com
  wrote:
   primitive statics will be taken care. jus make others null.
   in onPause() unregister  in onResume register again.

   2009/7/16 Ivy ytang1...@gmail.com

I register a SensorListener,where should i unregister it?
In which method?
And how to release statics?

On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
wrote:
 Yes, it is best to do that...
 But i tried adding this as a ShutdownHook, but it failed to execute
  on
app
 exit...
 I'd suggest that u release resources used by an activity in its
  onDestroy
 method.

 On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:

  i have some static variables and some registerListeners.
  Do i need to release them all and remove these listeners?

 --
 Regards,
 Sujay
 Lenny Bruce 
   http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
 - Communism is like one big phone company.

   --
   Regards,
   Sujay
   Mike Ditka http://www.brainyquote.com/quotes/authors/m/mike_ditka.html
   -
   If God had wanted man to play soccer, he wouldn't have given us arms.-
  隐藏被引用文字 -

   - 显示引用的文字 -

 --
 Regards,
 Sujay
 Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html
 - Computers are useless. They can only give you answers.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Do i need to release the static variable and remove the listener when the app is closed?

2009-07-16 Thread Dianne Hackborn
You really probably shouldn't be putting actively registered listeners in
statics.  It should be associated with your activity, in which class it is
very clear when to unregister.

2009/7/16 Ivy ytang1...@gmail.com


 I register a SensorListener,where should i unregister it?
 In which method?
 And how to release statics?

 On 7月16日, 下午7时39分, Sujay Krishna Suresh sujay.coold...@gmail.com
 wrote:
  Yes, it is best to do that...
  But i tried adding this as a ShutdownHook, but it failed to execute on
 app
  exit...
  I'd suggest that u release resources used by an activity in its onDestroy
  method.
 
  On Thu, Jul 16, 2009 at 5:03 PM, Ivy ytang1...@gmail.com wrote:
 
   i have some static variables and some registerListeners.
   Do i need to release them all and remove these listeners?
 
  --
  Regards,
  Sujay
  Lenny Bruce 
 http://www.brainyquote.com/quotes/authors/l/lenny_bruce.html
  - Communism is like one big phone company.
 



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

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

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



[android-developers] Re: extending parcelables

2009-07-16 Thread Dianne Hackborn
Just use ArrayListParcelable as your data type.

On Thu, Jul 16, 2009 at 5:31 AM, Bart van Wissen bartvanwis...@gmail.comwrote:


  2. Use a generic Parcelable class type, in which case the marshalling
 code
  will inspect the class type, included that in the marshalled data, and
 use
  that to re-construct it on the other side.
 

 I don't understand this.

 My program deals with Condition objects, which can be put in a list to
 specify a series of search conditions. There are specific classes like
 StringCondition, TimeCondition, LocationCondition, etc. They are all
 subclasses of Condition, but they all have their specific sets of
 fields.

 A list of those has to be passed to a service. Now how would I use a
 generic Parcelable class for this? To be honest I don't have much
 experience with generic classes.

 



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

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

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



[android-developers] auto mount the usb mass storage?

2009-07-16 Thread jonathan

when connecting the device to pc, it prompts to mount it as usb mass
storage, is there a way to force it to auto mount? thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Server/Client in different machines

2009-07-16 Thread Yusuf T. Mobile

Connection refused is a standard TCP error, not Android-specific. So
see if you can telnet into the same IP address and port, using a PC on
the same subnet as your phone, if possible. For example, if you can
put both the PC and phone are on the same WiFi network.


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




On Jul 16, 6:19 am, Zeeshan Muhammad genx...@gmail.com wrote:
 i have the similar problem,

 my main java class listening a server socket at port 8088

 now when my client (android) try to connect a socket it refused the
 conenction

 InetAddress serverAddr = InetAddress.getByName(127.0.0.1);
 Socket socket =   new Socket(serverAddr , 8088 );

   java.net.ConnectException:
 /127.0.0.1:8088http://192.168.0.173/192.168.0.173:7000
 Connection refused

 anybody help plz

 On Sun, Apr 26, 2009 at 7:53 PM, Rande Arievilo Moreira 



 randeariev...@gmail.com wrote:

  Hi Ask,

  I'm developing the same application with Lillian. After debugging a
  little bit, I found out that we're receiving the following exception:

     java.net.ConnectException: 192.168.0.173/192.168.0.173:7000 -
  Connection refused

  192.168.0.173 is the IP of my machine (the server) in the Local
  Network.
  Any suggestion?

  Thanks.

  On Apr 7, 9:21 am, Ask asifk1...@gmail.com wrote:
   Can you send the exception you are getting or some code snippets,

   it can be some io exception...

   On Apr 7, 4:58 pm,LillianBrandão lbrolive...@gmail.com wrote:

I've already done at the server machines:
redir add tcp:7000:7000.

--
   LillianBrandão

On Tue, Apr 7, 2009 at 8:47 AM, Ask asifk1...@gmail.com wrote:

 Have you done port forwarding at server machine??

 Any message which is coming to the server should be redirected
  towards
 the emulator port : 7000

 On Apr 7, 4:35 pm,LillianBrandão lbrolive...@gmail.com wrote:
  Hi all,

  I have an application client/server and I want to install this
 application
  in differente machines. The server is located in IP_SERVER,
  listening
 port
  7000.
  I want to start a cliente in another machine with IP_Y and connect
  to the
  server on the different machine.

  I've started the server and I've created the socket like this:
  ... new ServerSocket(7000);

  I've started the client and I've created the socket like this:
  ...new Socket(SERVER_IP, 7000)

  But the client did not connect to the server. I've already set the
  INTERNET_PERMISSION.
  Any suggestions how to do it?
  Anybody else have already done a client/server application that
 communicate
  between differente machines?

  Thanks in advance,
 LillianBrandão.- Hide quoted text -

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



[android-developers] Re: auto mount the usb mass storage?

2009-07-16 Thread Dianne Hackborn
Sorry I don't believe you can do this without modifying the platform.

On Thu, Jul 16, 2009 at 9:54 AM, jonathan topcod...@gmail.com wrote:


 when connecting the device to pc, it prompts to mount it as usb mass
 storage, is there a way to force it to auto mount? thanks
 



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

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

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



[android-developers] Re: Best Practice for overriding both Theme and Theme.Dialog correctly in an app?

2009-07-16 Thread Robert Green

Surely there is a good solution for this.  Anyone?

On Jul 15, 1:10 pm, Robert Green rbgrn@gmail.com wrote:
 I use themes in my apps, which generally just extend android:Theme and
 then set a bunch of styles.

 I use dialogs made from layouts, but since I set the theme for the
 application, they have inherited all of the regular styles and no
 longer carry a border, etc.

 My question is:  How do I say, I want everything to use this theme
 which extends Theme, except dialogs, which should use this other theme
 that extends Theme.Dialog  ?  It seems like that's how things work by
 default but when you set the theme to your own, you lose the dialog
 theme!

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



[android-developers] Re: Are Binder objects leaked ?

2009-07-16 Thread Dianne Hackborn
Yeah, the system process holds a reference on it, which won't be released
until it GCs.

On Thu, Jul 16, 2009 at 2:46 AM, Guillaume Perrot
guillaume.p...@gmail.comwrote:


 It appears that I have to wait some minutes before I can see the
 finalize trace of my binder, but it eventually happens.
 Maybe some sort of timeout in android code.

 2009/7/16 Guillaume Perrot guillaume.p...@gmail.com:
 
  I eventually saw finalize() (just once) on the Binder object after
  many tests.
  My guess is that it's a soft reference, when using a WeakHashMap to
  keep the binders in a pool, I realized that the pool was emptied after
  each put meaning no hard reference has been kept. So I dropped the
  pool solution.
  However I thought soft references were freed only when the VM is near
  out of memory which was not my case in my test (only 2MB allocated,
  4MB in total heap).
  Could anyone explain me the life cycle of a binder object ?
 
  On Jul 16, 10:16 am, Guillaume Perrot guillaume.p...@gmail.com
  wrote:
  I am developing an android service using aidl.
  I realized that the objects returned in Service.onBind() are never
  freed (e.g. finalize() is never called) even after onUnbind() and
  onDestroy() and playing with the eclipse GC button.
  I checked that the memory leak did not come from my Binder
  implementation (by using an intermediate stub class, the finalize() is
  actually called on the proxied instance).
  Even if I return something like
  return new Binder()
  {
@Override
protected void finalize() throws Throwable
{
   Log.v(tmp, finalizing binder);
   super.finalize();
}
  };
  in onBind(), finalize is never called.
  As a workaround I use a pool for binder objects wrapping real
  implementations, and I reuse it but I wonder if it's safe.
  
 

 



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

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

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



[android-developers] Re: Getting PCM data from the builtin audio decoders

2009-07-16 Thread sandy8531

I have a similar need for my application.

http://groups.google.com/group/android-framework/browse_thread/thread/dcd1cd51d3c4d036

Any suggestions ?

-thanks.
Sandeep

On Jul 7, 3:26 am, dworz dw...@amazing.ch wrote:
 Hi

 I also need access to the decompressed audio-samples.
 I saw SoundPool uses MediaPlayer::decode to do this.

 This Method doesn't seem to be in the public Interface. Is it possible
 to access it anyway?
 I accept it may break my App in the future.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: auto mount the usb mass storage?

2009-07-16 Thread jonathan

is there a design reason for not able to auto mount?
has anyone done modifying the platform for auto mount?

On Jul 16, 10:07 am, Dianne Hackborn hack...@android.com wrote:
 Sorry I don't believe you can do this without modifying the platform.

 On Thu, Jul 16, 2009 at 9:54 AM, jonathan topcod...@gmail.com wrote:

  when connecting the device to pc, it prompts to mount it as usb mass
  storage, is there a way to force it to auto mount? thanks

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Background Task Result Reporting Hypothetical

2009-07-16 Thread Ward Willats

Hello.

I've been doing background tasks and they work, but I'm interested in 
best practice. I think this has been talked about on the list before, 
but I haven't seen a clear discussion, and one of Streets of Boston's 
posts yesterday got me thinking.

Say you have a background chore that needs to return results to the 
UI. You use AsyncTask or cook-up something on your own and the work 
gets done.

Now you need to notify the UI. So you post a Runnable or Message. Fine.

But let's say the user moved away from the invoking activity while 
the background thread was running, or changed orientation, so the 
result receiving activity is either no longer foreground or different.

If the user moved away from the initiating activity, the results 
arrive in the handler of a zombie activity no longer being 
displayed (but which can, I guess, now be garbage collected since the 
reference to the activity in the result message has been released). 
Is there anything to worry about here, or is it OK to mindlessly 
update a non-displayed view tree?

If orientation has changed, the results are delivered to the wrong 
handler in the old activity. This is more of a problem. I've hacked 
around this in various ways, but they are all kind of clunky -- 
involving having activities register in some way with the 
background task so results go to the correct handler. Is there a more 
elegant approach?

I may be totally over thinking this, since my previous approaches 
work, but this morning I'm off to write more background code and I'd 
like to handle result delivery in a way that is pretty. I also want 
to be sure I'm not making some obvious conceptual mistake in my 
mental model of all this.

Thanks smart people,

-- Ward

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



[android-developers] Re: Can not start Media Player Service

2009-07-16 Thread Marco Nelissen

On Thu, Jul 16, 2009 at 5:14 AM, MikaSuemika...@mikasuedesigns.com wrote:

 In LogCat, I see

 E   542   MediaPlayerService   Couldn't open fd for 
 content://settings/system/ringtone

 E   761   MediaPlayer     unable to create media player


 Any help would be appreciated.  Im trying to play a mp3 file.

Then why is your code trying to play the system ringtone?

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



[android-developers] Re: no route to host Exception on Socket

2009-07-16 Thread Jason Proctor

10.0.2.2 is an emulator-only alias to your computer. the address is 
not valid from a real device, unless the DHCP server is giving out 
addresses in that range.

in order to connect to a server running on your computer from a real 
phone, you'll have to determine its name or IP address and connect to 
that.

this works, i do it all the time.

hth

Hi Experts,

i am working on a client server program in android.
i have a Main java class running on my pc as a server socket listening
to the port 8626 and i am trying to connect android client (on real
device ) to that server.

Socket socket =   new Socket(IP , 8626 );

i tried my local ip and it gives me no route to host exception
please suggset which ip i need.

if i use ip 10.0.2.2 and run on emulator it succeeds but not on real
device.

client and server both are on same pc, and android device is attached
to my pc as well.

plz help


-- 
jason.software.particle

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



[android-developers] Progress bar like in android market

2009-07-16 Thread sheik

Hello developers,
 i have used the progress dialog in order to load the contents from
the server to list...But i feel that the progress bar small with
loading... message that is used in the android market browser ( in
dev phone) is better ... here is the problem iam facing..

1) i have a list of 100 names that has to be loaded on to the dev
phone.

  I do as follows.
extends Activity implements ListView.OnScrollListener ...

 on every request i am getting 20 items and request is sent in
seperate thread and for the UI i am using progress dialog saying
Wait..getting details and on getting the response
progress_bar.dismiss and setting to the adapter as  myList.setAdapter
(new MyListAdapter(this)) where MyListAdapter extends BaseAdapter

2) Now i have 20 items in myList ... and the next request for 20
items  is sent when i reach the last list item by using the
onScrollStateChanged() using view.getLastVisiblePosition();

 similarly as explained above i send request in seperate thread(not
the UI  thread) and show the progress bar and dismiss it on the
response...

   But problem is on myList.setAdapter(new  MyListAdapter(this)) , the
list goes to the first item and the user(here i...) has to scroll back
again to the 20 items to see the list..

I did all the above procedure by referring the slowAdapter example in
the API DEMOS...
So, here is the problem ..
 1) how to show the next 20 items without going to the first item on
every second request ..

 2) i found that android market browser uses same scenario .. but i
dont know how to generate it..

 if u guys can help in this by referring me with some example or a
procedure to go on further it wouild appreciated ...

 Sorry for the long explanation... i hope that i have explained the
problem clearly .. if not kindly let me know, i shall do it again...

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



[android-developers] Handset power/current draw

2009-07-16 Thread Anders Feder

Hi,

I am interested in knowing how much power or current my phone draws at
any given instant for, among other things, power optimization
purposes.

Is there any way (API or otherwise) to inspect how much power or
current the Android handset currently draws?

Thanks,

Anders Feder

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



[android-developers] Should we use jade androide to develop application

2009-07-16 Thread sujitm

Reposting since I could not see my post

I am building a social networking application for ADC-II. This needs
peer-to-peer communications.Since GTalk service is not there any more
(hoping some variant will be back in future), I have one easy option
to use JADE.

But JADE requires a running JADE platform to function properly. And
definitely this is a drawback if I use JADE.

Dan, your comments will be highly appreciated.

Thanks,
Sujit

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



[android-developers] Re: add new sensor?

2009-07-16 Thread Max

Hello
I have the same problem.
Have you found some usefull info about this post ?

thanks
Massimo

On Jul 9, 5:42 pm, bluestar bluestar8...@gmail.com wrote:
 I know the Android SDK provieds manySensorclass to use
 to get data or do something.

 I already verified mydriverofsensorto get data
 successfully under linux kernel-2.6.29

 I use I2C protocol to communication with my device,
 so I putsensorcode under drivers/i2c/chips

 NOW I want to add mysensorinto Android and I hope
 to link AndroidSensorclass with my device to reduce
 develop my application.

 How to do for this goal?
 Could I need to modify application framework or Libraries
 or anotherdrivertype for new device?
 I big your help

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



[android-developers] Browser versus App to present Web Data

2009-07-16 Thread Fred Vinton

Looking for best practices to deploy
   a. tabular data, and
   b. plotted data with comments (title + legend + notes)
1. Display in browser with server generated static graphic plots, or,
2. Download raw data and plot with graphics primitives (API) within
Android's SDK? 50 - 500 data points.
- Volume of requests may be large.
- Time critical response on handheld
I am keenly interested in a sample that runs on the NDK (1.5) which
can authenticate to Google and communicate with an AppEngine datastore.

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



[android-developers] Re: Download manager

2009-07-16 Thread Hod

android.permission.ACCESS_DOWNLOAD_MANAGER has protection level
signatureOrSystem.  You can read about that at
http://developer.android.com/guide/topics/manifest/permission-element.html

Basically, only applications signed using the same certificate as
Download Manager or installed on the /system partition will be granted
that permission.  Just putting the uses clause in your manifest
isn't enough.  To try the /system approach, do

adb remount
adb push your apk /system/app

Hod

On Jun 11, 8:45 pm, ondraz ondra.zahrad...@gmail.com wrote:
 Hello,

 has anyone tried this? I got exactly the same error as davidyu. My
 application has permission android.permission.ACCESS_DOWNLOAD_MANAGER
 but download manager does not allow it to read downloads with the
 message that android.permission.ACCESS_DOWNLOAD_MANAGER is required.

 Ondra

 On May 4, 1:51 pm, davidyu yule...@gmail.com wrote:



     I want to access Download manager in my application, and set
     uses-permission
  android:name=android.permission.ACCESS_DOWNLOAD_MANAGER/
     uses-permission
  android:name=android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED/
     uses-permission
  android:name=android.permission.ACCESS_CACHE_FILESYSTEM/
     uses-permission
  android:name=android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS/

   in manifest.xml

    However, I still get /AndroidRuntime(14300): Caused by:
  java.lang.SecurityException: Permission Denial: reading
  com.android.providers.downloads.DownloadProvider uri
  content://downloads/download from pid=14300, uid=10057 requires
  android.permission.ACCESS_DOWNLOAD_MANAGER
  E/AndroidRuntime(14300):        at android.os.Parcel.readException
  (Parcel.java:1234)
  E/AndroidRuntime(14300):        at
  android.database.DatabaseUtils.readExceptionFromParcel
  (DatabaseUtils.java:145)
  E/AndroidRuntime(14300):        at
  android.database.DatabaseUtils.readExceptionFromParcel
  (DatabaseUtils.java:111)
  E/AndroidRuntime(14300):        at
  android.content.ContentProviderProxy.bulkQuery
  (ContentProviderNative.java:279)
  E/AndroidRuntime(14300):        at
  android.content.ContentProviderProxy.query(ContentProviderNative.java:
  298)
  E/AndroidRuntime(14300):        at
  android.content.ContentResolver.query(ContentResolver.java:149)
  E/AndroidRuntime(14300):        at
  android.app.Activity.managedQuery(Activity.java:1499)

  is there anything else I should do to access Download Manager?

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



[android-developers] Setting for Poxy based Network Connections

2009-07-16 Thread Aram

Hello all,

Can anybody give me the Exact methodology for Connecting through
Android Browsers and also Exact way for making the Map application
work in my Proxy Networked Machine

None of the methodology in the below are working for me

1. placing the http_proxy in settings.db
2. -http-proxy in console


thankyou

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



[android-developers] Android Screen Shot

2009-07-16 Thread Sansiro

Hi,guys:
I'm writing an application running on PC. I want to get the android
device's screen which is connected to PC.
Now I use the method provider by SDK to get the screen image, just
like DDMS, and  transport the Image to PC via socket. But it's too
inefficient.
Is there a hook which can snapshot the screen change by system layer,
just like Windows Mobile?
Or any other suggestion?
BRs

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



  1   2   >