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

2009-07-15 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  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  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] no permission to read the sync settings

2009-07-15 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] Lot of unused code is generated when aidl tool is run againt a .aidl file.

2009-07-15 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] Re: Cursor position in the edit text

2009-07-15 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  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  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] Grid View Click Problem

2009-07-15 Thread jaimin

hi i am new to android.
i try to run Api demos GridView example it runs fine.
Now when i click the image in grid view than it does nothing.
i want to do when i click that image images should be display in full
screen
But i dont know how to do that so plz any one can help me and give me
the Code for that thing.

Here it is my code

package indiaNIC.android.ComicBook;


import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

/**
 * A grid that displays a set of framed photos.
 *
 */
public class grid extends Activity {

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

setContentView(R.layout.grid_2);

GridView g = (GridView) findViewById(R.id.myGrid);
g.setAdapter(new ImageAdapter(this));
}

public class ImageAdapter extends BaseAdapter {
public ImageAdapter(Context c) {
mContext = c;
}

public int getCount() {
return mThumbIds.length;
}

public Object getItem(int position) {
return position;
}

public long getItemId(int position) {
return position;
}

public View getView(int position, View convertView, ViewGroup
parent) {
ImageView imageView;
if (convertView == null) {
imageView = new ImageView(mContext);
imageView.setLayoutParams(new GridView.LayoutParams
(45, 45));
imageView.setAdjustViewBounds(false);
imageView.setScaleType
(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(8, 8, 8, 8);
//imageView.setOnClickListener(grid.this);
} else {
imageView = (ImageView) convertView;
}

imageView.setImageResource(mThumbIds[position]);

return imageView;
}

private Context mContext;

private Integer[] mThumbIds = {
R.drawable.cartoon0,
R.drawable.cartoon1,
R.drawable.cartoon2,
R.drawable.cartoon10,
R.drawable.cartoon11,
R.drawable.cartoon12,
R.drawable.cartoon13,
R.drawable.cartoon14,
R.drawable.cartoon15,
R.drawable.cartoon16,
R.drawable.cartoon17,
R.drawable.cartoon18,
R.drawable.cartoon19,
R.drawable.cartoon20,
};

}

}
any prublic void onClick(View v)
method is there for grid View plz 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: Cursor position in the edit text

2009-07-15 Thread sheik

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  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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: The layout of New Contact or Edit Contact can't be represented correctly when using WVGA-P skin in Cupcake emulator

2009-07-15 Thread Romain Guy

WVGA is not supported in Cupcake.

On Wed, Jul 15, 2009 at 10:20 PM, Tony Yang wrote:
>
> My operation procedure is as below:
> 1. Execute Cupcake emulator with WVGA-P skin.
> 2. Activate Contacts application, and select "Contact" tab.
> 3. Press "Menu" key and select "New contact" option item.
> 4. Discover that the middle of current layout isn't represented.
>
> Do you meet this problem??
> >
>



-- 
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] The layout of New Contact or Edit Contact can't be represented correctly when using WVGA-P skin in Cupcake emulator

2009-07-15 Thread Tony Yang

My operation procedure is as below:
1. Execute Cupcake emulator with WVGA-P skin.
2. Activate Contacts application, and select "Contact" tab.
3. Press "Menu" key and select "New contact" option item.
4. Discover that the middle of current layout isn't represented.

Do you meet this problem??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
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-15 Thread peeyush varshney
Hi,
 How can i make TextView editable when i needed.

-- 
Thank & Regards
Peeyush Varshney

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

2009-07-15 Thread Rohan

Thanks Dianne Hackborn for the reply,

Will try this out and let you know..

Thanks

On Jul 15, 11:23 am, Dianne Hackborn  wrote:
> Hi, this isn't really supported by toasts, which are designed to be shown
> completely independently of the current app.  You can fairly easily
> accomplish this by just displaying a normal dialog, except making it not
> have focus or receive touch events and giving it an animation style that
> fades in and then out.
>
> On Wed, Jul 15, 2009 at 11:09 AM, Rohan Solanki 
> wrote:
>
> > Hi all,
> >    I want my Toast to be displayed at specific points on the screen. How do
> > i do that?
>
> > Thanks in advance...
>
> --
> 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] what is the meaning of "dumpsys meminfo PID" output

2009-07-15 Thread arvind

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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Speech Codec Support for Android

2009-07-15 Thread Tez

Hi,

I was wondering what kind of Audio/Speech Codecs are available for the
1.5 SDK? Are there any Open Source projects working on this?

Cheers,
Earlence

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

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 
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] Direct access to GEARS geolocation without going through the browser interface

2009-07-15 Thread alexdonnini

Hello,



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.



geolocation includes three Android-specific public Java classes,

AndroidGpsLocationProvider, AndroidRadioLocationProvider, and

AndroidWifiLocationProvider. The fact that they are Android-specific

and that they are public lead me to conclude that I should be able to

use these classes in my application.



However, not surprisingly, when I try to access these classes, my

application fails (see log below) because, among other things, I have

no way to correctly identify nativeObject in the java classes.



I would appreciate anyone's feedback, suggestions, and help in

resolving this problem. At the very least, I would like to understand

the purpose of the three Android-specific public Java classes, and how

we should use them.



Thanks.



Alex  Donnini





07-15 20:51:28.779: WARN/dalvikvm(31357): No implementation found for

native Lcom/android/universallocation/

AndroidRadioDataProvider;.onUpdateAvailable (Lcom/android/

universallocation/AndroidRadioDataProvider$RadioData;J)V

07-15 20:51:28.789: WARN/dalvikvm(31357): threadid=3: thread exiting

with uncaught exception (group=0x4000fe70)

07-15 20:51:28.799: ERROR/AndroidRuntime(31357): Uncaught handler:

thread main exiting due to uncaught exception

07-15 20:51:28.859: ERROR/AndroidRuntime(31357):

java.lang.UnsatisfiedLinkError: onUpdateAvailable

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

com.android.universallocation.AndroidRadioDataProvider.onUpdateAvailable

(Native Method)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

com.android.universallocation.AndroidRadioDataProvider.notifyListeners

(AndroidRadioDataProvider.java:236)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

com.android.universallocation.AndroidRadioDataProvider.onCellLocationChanged

(AndroidRadioDataProvider.java:229)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

android.telephony.PhoneStateListener$2.handleMessage

(PhoneStateListener.java:251)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

android.os.Handler.dispatchMessage(Handler.java:99)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

android.os.Looper.loop(Looper.java:123)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

android.app.ActivityThread.main(ActivityThread.java:3948)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

java.lang.reflect.Method.invokeNative(Native Method)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

java.lang.reflect.Method.invoke(Method.java:521)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run

(ZygoteInit.java:782)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)

07-15 20:51:28.859: ERROR/AndroidRuntime(31357): at

dalvik.system.NativeStart.main(Native Method)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Jason Proctor

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: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Ivy

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

On Jul 16, 9:19 am, Jason Proctor 
wrote:
> ISTR a response from Dianne not so long ago which said that the
> in-call experience is not currently changeable via the Java API.
>
> so in other words you'd have to modify the native parts of Android
> (the firmware) and then ship your own Android distribution. probably
> more work than you want to take on.
>
> i hope the in-call experience will be pluggable soon, too.
>
>
>
>
>
> >Does this mean I need to change the source code to get the new screen?
> >Is there any  reference materials?
>
> >On Jul 16, 9:08 am, Mark Murphy  wrote:
> >>  Ivy wrote:
> >>  > When a call is in or out,I need to display another screen,not the
> >>  > system's.Is there any sample here?
>
> >>  That requires modifying the firmware. For details on modifying the
> >>  firmware, visit:
>
> >>  http://source.android.com
>
> >>  --
> >>  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!
>
> --
> jason.software.particle- 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] Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Jason Proctor

ISTR a response from Dianne not so long ago which said that the 
in-call experience is not currently changeable via the Java API.

so in other words you'd have to modify the native parts of Android 
(the firmware) and then ship your own Android distribution. probably 
more work than you want to take on.

i hope the in-call experience will be pluggable soon, too.


>Does this mean I need to change the source code to get the new screen?
>Is there any  reference materials?
>
>On Jul 16, 9:08 am, Mark Murphy  wrote:
>>  Ivy wrote:
>>  > When a call is in or out,I need to display another screen,not the
>>  > system's.Is there any sample here?
>>
>>  That requires modifying the firmware. For details on modifying the
>>  firmware, visit:
>>
>>  http://source.android.com
>>
>>  --
>>  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!
>

-- 
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: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Ivy

Does this mean I need to change the source code to get the new screen?
Is there any  reference materials?

On Jul 16, 9:08 am, Mark Murphy  wrote:
> Ivy wrote:
> > When a call is in or out,I need to display another screen,not the
> > system's.Is there any sample here?
>
> That requires modifying the firmware. For details on modifying the
> firmware, visit:
>
> http://source.android.com
>
> --
> 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] Re: Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Mark Murphy

Ivy wrote:
> When a call is in or out,I need to display another screen,not the
> system's.Is there any sample here?

That requires modifying the firmware. For details on modifying the
firmware, visit:

http://source.android.com

-- 
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] Dose Android sdk 1.5 allow to create our own screen when a call is in or out

2009-07-15 Thread Ivy

When a call is in or out,I need to display another screen,not the
system's.Is there any sample here?


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] Possible solution: showDialog and dismissDialog behave strangely when changing orientation

2009-07-15 Thread Streets Of Boston

I found the problem... and a solution

In my activity, i show the dialog using:

  this.showDialog(R.layout.waiting_dialog);
(where 'this' is the current activity).


Then this code, part of my activity, dismisses it:

  // Do something with bmToSave and insert it into the MediaStore.
  final PictureInserter ph = new PictureInserter(getApplicationContext
(), bmToSave) {
  @Override
  public void ready(String path, Uri uri) {
  this.dismissDialog(R.layout.alert_dialog_waiting);
  }

After an orientation change, the problem is that 'this' is still the
old destroyed acivity, when the 'ready' is called back when the
picture is properly inserted into the MediaStore.

I changed the code as follows:

  // Do something with bmToSave and insert it into the MediaStore.
  final PictureInserter ph = new PictureInserter(getApplicationContext
(), bmToSave) {
  @Override
  public void ready(String path, Uri uri) {
  ACTIVE_INSTANCE.dismissDialog(R.layout.alert_dialog_waiting);
  }

where 'ACTIVE_INSTANCE' is set to 'this' in the onCreate (and set to
'null' in the onDestroy).
This works fine.

On Jul 12, 11:13 pm, Streets Of Boston 
wrote:
> I'm seeing this behavior now too (Cupcake release).
>
> showDialog(id) --> config change --> dismissDialog(id) won't work more
>
> When calling dismissDialog(id) after a config change doesn't do
> anything (not dismissing the dialog, but no error-message either).
>
> Something is wrong here...
>
> On May 21, 4:53 am, idev  wrote:
>
>
>
> > Hi
> > I am using the showDialog anddismissDialogmethods to show progress
> > dialogs in my app. Moved from creating the dialog and calling show()
> > on it to using this in order to save state when changing orientation.
> > But when I change the orientation from portrait->landscape->portrait,
> > thedismissDialogmethod call no longer dismisses the dialog. The
> > dialog stay there all the time and I need to press the back button for
> > it to disappear.
> > To overcome this issue, I tried adding a removeDialog in onDestroy so
> > that the dialog is not created/displayed twice and before orientation
> > change, the dialog is removed. Tried adding log statements and this is
> > what happens
> > 05-21 12:35:14.064: DEBUG/MyClass(193): *callingShowDialog
> > 05-21 12:35:14.064: DEBUG/MyClass(193): *onCreareDialog
>
> > 05-21 12:35:15.385: DEBUG/MyClass(193):
> > *onSaveInstanceState
> > 05-21 12:35:15.415: DEBUG/MyClass(193): *onDestroy
>
> > 05-21 12:35:15.585: DEBUG/MyClass(193): *callingShowDialog
> > 05-21 12:35:15.585: DEBUG/MyClass(193): *onCreareDialog
> > 05-21 12:35:15.715: DEBUG/MyClass(193): *onCreareDialog
> > 05-21 12:35:17.214: DEBUG/MyClass(193):
> > *onSaveInstanceState
> > 05-21 12:35:17.214: DEBUG/MyClass(193): *onDestroy
>
> > 05-21 12:35:17.275: ERROR/WindowManager(193):
> > android.view.WindowLeaked: Activity com.android.MyClass has leaked
> > window com.android.internal.policy.impl.phonewindow$decorv...@43362088
> > that was originally added here
> > Some error statements
> > 05-21 12:35:17.395: DEBUG/MyClass(193): *callingShowDialog
> > 05-21 12:35:17.395: DEBUG/MyClass(193): *onCreareDialog
> > 05-21 12:35:17.475: DEBUG/MyClass(193): *onCreareDialog
>
> > Initially when the activity is displayed, the onCreateDialog is called
> > once and on changing the orientation, onSaveInstanceState and
> > onDestroy are called.
> > But after that, onCreateDialog is called twice (once by a call to
> > showDialog which I make, but why the 2nd time?) and this happens every
> > time I change the orientation hence forth.
> > Any idea why that happens?
> > Thanks- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
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 make EditText wrap lines of text / word wrap

2009-07-15 Thread SR

Whoops, silly me.  I had android:singleLine="true" in my layout :(

Stan

On Jul 14, 6:34 pm, schwiz  wrote:
> i would think it should do it automatically if you have the width to
> wrap_content
>
> On Jul 14, 4:44 pm, SR  wrote:
>
> > Hi,
>
> > How do I make multiline EditText within a RelativeLayout wrap the
> > lines of text that were entered?
>
> > I want the user to enter one line of text without allowing line
> > breaks, but show it broken up by words into multiple lines inside a
> > rather smallish, square EditText window.
>
> > Thanks for any clues,
>
> > S
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 find out the percentage of memory used by each process in the android

2009-07-15 Thread Jason Proctor

i've not looked at the NDK, but would it be 
possible to JNI to the regular Linux process APIs?



>You could run the top command in the adb shell. The command comes with
>busybox.
>
>The memory information include:
>Statistics on memory usage, including total available memory, free
>memory, used memory, shared memory, and memory used for buffers. The
>display of memory information may be toggled by the m interactive
>command.
>
>--
>Roman Baumgaertner
>Sr. SW Engineer-OSDC
>·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 15, 3:45 am, arvind  wrote:
>>  Hi all,
>>
>>  I want to calculate the performance for some of the task/process.
>>
>>  How to find out the percentage of memory used by each process in the
>>  android.
>>  - is there any in build class\process to do this?
>>
>>  Thanks and Regards
>>  Aravinda
>

-- 
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: how to find out the percentage of memory used by each process in the android

2009-07-15 Thread Roman

You could run the top command in the adb shell. The command comes with
busybox.

The memory information include:
Statistics on memory usage, including total available memory, free
memory, used memory, shared memory, and memory used for buffers. The
display of memory information may be toggled by the m interactive
command.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·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 15, 3:45 am, arvind  wrote:
> Hi all,
>
> I want to calculate the performance for some of the task/process.
>
> How to find out the percentage of memory used by each process in the
> android.
> - is there any in build class\process to do this?
>
> Thanks and Regards
> Aravinda
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Camera preview on an OpenGL surface....

2009-07-15 Thread Richard Schilling

I solved this, thanks in part to
http://groups.google.com/group/android-beginners/browse_thread/thread/489e56ea2a1d42a9/994eb23731f60650?lnk=gst&q=OpenGL+View+on+top+of+Camera#994eb23731f60650

Follow the instructions on that thread.  Here's the general strategy:

1. In your main activity, set as the main view the GLSurfaceView
object using the setContentView method.
2. Then, add the SurfaceView being used to draw the camera.
3. Add other SurfaceViews to the display as necessary.

That order is very important, otherwise the views block each other.

Richard Schilling
Root Wireless




On Jul 15, 2:27 pm, Richard Schilling 
wrote:
> Just getting started with OpenGL surfaces, really.
>
> I'd like to display a camera preview in the background on its own
> surface (no problem there).
> And, I'd like to draw on another surface layered on top of that with a
> OpenGLSurfaceView.
>
> But the OpenGLSurfaceView completely blocks the view camera preview.
>
> What's the best way to either
> a) use the OpenGLSurfaceView for the camera preview and then draw on
> top of the camera preview, or
> b) create an OpenGLSurfaceView object with a transparent background
> (which, I don't think is possible?).
>
> Thanks.
>
> Richard Schilling
> Root Wireless
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2009-07-15 Thread Mark Murphy

dotclick wrote:
> So the only response I am going to get from Google is from someone who
> didn't read the message or take the time to research it.

No, the only responses you will get is from people other than Google
employees. As Romain Guy pointed out, if you read the response you were
lambasting, you would notice that it is from a T-Mobile employee.

It seems curious that you seem to have made the same error that you are
complaining about -- not completely reading the email. It's almost as if
making mistakes were, like, human or something.

Of course, it is also curious that you appear to think this is an
end-user tech support forum (which it is not) and that it is Google's
primary responsibility to respond to you here (which it is not).

But I digress.

> No status updates or responses on the bug report from 7+ months ago.

Please point out the official public bug trackers for Windows Mobile,
Blackberry, iPhone, and Palm WebOS. I'm not even sure there's one up for
Symbian, and they're at least on the road to open source.

Please point out where you get detailed, bug-level information months in
advance of product releases for Windows Mobile, Blackberry, iPhone, Palm
WebOS, and Symbian.

Please point out how you -- whether via your own engineering efforts, or
by hiring somebody, or by collecting interested people to raise money to
hire somebody -- have a chance to fix bugs in Windows Mobile,
Blackberry, iPhone, or Palm WebOS, as you can with Android. I'll give
Symbian a mulligan here, since they're in progress on this issue.

Had this same bug, or an equivalent one, affected you on one of these
other platforms, the best-case scenario is that, after sitting in
indefinite tech support queues, you would be told it is a bug and it may
get fixed someday. Here, not only were you able to file the bug report
without much effort (albeit with no better of a response), but you have
options for spearheading a fix, which you lack with any other
commercial-grade smartphone platform.

Now, you may not elect to use any of those options to accelerate a fix,
but that's your decision, not Google's. Regardless, you are no worse off
than you would have been with any other platform with the same sort of bug.

If you want to whine about how Android has bugs, be my guest, just don't
whine about the lack of response, since that's all you'll get from anyone.

Note: once Symbian gets a-rollin' in earnest on the open source front,
the bar for Google and Android may get raised a fair bit, but we're not
there yet.

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

Android App Developer Training: http://commonsware.com/training.html

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



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

2009-07-15 Thread Romain Guy

The response you got was NOT from Google.

On Wed, Jul 15, 2009 at 3:00 PM, dotclick wrote:
>
> So the only response I am going to get from Google is from someone who
> didn't read the message or take the time to research it.
>
> No status updates or responses on the bug report from 7+ months ago.
> If this is all Google has to offer, I don't think we will be using any
> Google services in the future.
>
>
> On Jul 14, 2:18 pm, dotclick  wrote:
>> This is EXACTLY the ridiculous type of response I'm talking about.
>>
>> If you would have actually read the post or taken the 2 seconds to
>> click your own link and search "1583" you would have found that it was
>> reported but has not been fixed.
>>
>> I like Google but this just just fell to a new low of stupididty.
>> -D
>>
>> On Jul 13, 2:58 pm, "Yusuf T. Mobile"  wrote:
>>
>>
>>
>> > Hello, M.Infinite. Thank you for identifying this issue, as well as
>> > for contributing your frank assessment of Google's business practices.
>> > In fact there is a process by which helpful individuals such as
>> > yourself can report bugs to the Android community who then often
>> > actually fix them:http://code.google.com/p/android/issues/list
>>
>> > Yusuf Saib
>> > Android
>> > ·T· · ·Mobile· stick together
>> > The views, opinions and statements in this email are those of the
>> > author solely in their individual capacity, and do not necessarily
>> > represent those of T-Mobile USA, Inc.
>>
>> > On Jul 12, 10:34 am,Infinite wrote:
>>
>> > >     Issue ID 1583 -- Reported on December of 2008.
>> > >     If you have two contacts with the same last 4 numbers, it appears
>> > > to
>> > >     display the first contact.  Phone number matching with caller-id
>> > > is only
>> > >     matching the last 4 numbers and not the entire phone number.
>>
>> > > Not resolved affects hundreds of staff at my company.  August 1st, we
>> > > need to make a purchasing decision for 350 phones.  Google folks, your
>> > > taking yourself right of the business community with very dumb
>> > > mistakes.
>>
>> > > If you can't solve a problem a simple usability problem like this, why
>> > > would we want to use the business community to chrome, desktop chrome,
>> > > or any other Google services?   Not only is it getting ridiculous but
>> > > the effort I have to take to get the visibility to get something so
>> > > stupid resolved.
> >
>



-- 
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] Re: Android BUG....

2009-07-15 Thread Fred Grott(shareme)

Google on the Android project is somewhat weighed down right now with
other issues..


Fred Grott
http://mobilebytes.wordpress.com



On Jul 15, 5:00 pm, dotclick  wrote:
> So the only response I am going to get from Google is from someone who
> didn't read the message or take the time to research it.
>
> No status updates or responses on the bug report from 7+ months ago.
> If this is all Google has to offer, I don't think we will be using any
> Google services in the future.
>
> On Jul 14, 2:18 pm, dotclick  wrote:
>
> > This is EXACTLY the ridiculous type of response I'm talking about.
>
> > If you would have actually read the post or taken the 2 seconds to
> > click your own link and search "1583" you would have found that it was
> > reported but has not been fixed.
>
> > I like Google but this just just fell to a new low of stupididty.
> > -D
>
> > On Jul 13, 2:58 pm, "Yusuf T. Mobile"  wrote:
>
> > > Hello, M.Infinite. Thank you for identifying this issue, as well as
> > > for contributing your frank assessment of Google's business practices.
> > > In fact there is a process by which helpful individuals such as
> > > yourself can report bugs to the Android community who then often
> > > actually fix them:http://code.google.com/p/android/issues/list
>
> > > Yusuf Saib
> > > Android
> > > ·T· · ·Mobile· stick together
> > > The views, opinions and statements in this email are those of the
> > > author solely in their individual capacity, and do not necessarily
> > > represent those of T-Mobile USA, Inc.
>
> > > On Jul 12, 10:34 am,Infinite wrote:
>
> > > >     Issue ID 1583 -- Reported on December of 2008.
> > > >     If you have two contacts with the same last 4 numbers, it appears
> > > > to
> > > >     display the first contact.  Phone number matching with caller-id
> > > > is only
> > > >     matching the last 4 numbers and not the entire phone number.
>
> > > > Not resolved affects hundreds of staff at my company.  August 1st, we
> > > > need to make a purchasing decision for 350 phones.  Google folks, your
> > > > taking yourself right of the business community with very dumb
> > > > mistakes.
>
> > > > If you can't solve a problem a simple usability problem like this, why
> > > > would we want to use the business community to chrome, desktop chrome,
> > > > or any other Google services?   Not only is it getting ridiculous but
> > > > the effort I have to take to get the visibility to get something so
> > > > stupid resolved.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListView (ExpandableListView as well) selector highlight problems with custom background

2009-07-15 Thread Dimitris

Thank you and I am sorry if I sounded impatient.

I tried what you said and it worked out! However, I am still having
problems with the Linkify. If there is a link in my text it seems that
it grabs the onClick listener for the whole list item.

Any ideas on how to fix this?

Thanks again,

Dimitris

On Jul 15, 4:50 am, Mark Murphy  wrote:
> Dimitris wrote:
> > Why is noone ever responding here?
>
> Thousands of messages appear on this list every week. Not all get answered.
>
> In some cases, those who read the question may not know the answer. For
> example, I have no idea about your second one, and I only happened to
> look at the first one this evening for another project.
>
> >>> First whenever a group or child has a custom background color set the
> >>> orange selector does not show up.
>
> That may occur if you are not providing a multi-state drawable as the
> background.
>
> For example, here is the built-in Android background for an EditText:
>
> http://schemas.android.com/apk/res/android";>
>      android:drawable="@drawable/editbox_background_focus_yellow" />
>     
> 
>
> That's not a PNG file -- it's an XML file indicating two distinct
> nine-patch PNG files. One is used when the EditText has the focus; one
> is the normal case.
>
> If you replace the background of an EditText with a plain color (e.g.,
> android:background="#"), you will lose the focus selector,
> because you're saying the background is *always* the plain color.
>
> Instead, try using a selector XML file as above, providing backgrounds
> for both the focused and normal states.
>
> --
> 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: SQLite DROP Database

2009-07-15 Thread Steve

Just did something like this today -- mCtx is a reference to the
context --

public void deleteDatabase() {
  mDbHelper.close();
  mDb.close();
  if (mCtx.deleteDatabase(DATABASE_NAME)) {
Log.d(TAG, "deleteDatabase(): database deleted.");
  } else {
Log.d(TAG, "deleteDatabase(): database NOT deleted.");
  }
}

On Jul 15, 3:09 am, Kumaravel Kandasami
 wrote:
> Awesome Craig, exactly what I was looking. I will let you know whether it
> worked.
>
> Kumar    _/|\_www.saisk.com
> ku...@saisk.com
> "making a profound difference with knowledge and creativity..."
>
>
>
> On Tue, Jul 14, 2009 at 11:36 PM, Craig  wrote:
>
> >http://developer.android.com/reference/android/content/ContextWrapper...
>
> > On Jul 15, 7:14 am, Kumaravel Kandasami
> >  wrote:
> > >  How to drop a database in Android SDK?
>
> > > Did not see any methods in android.database.sqlite.SQLiteOpenHelper or
> > > android.database.sqlite.SQLiteDatabase classes.
>
> > > Any suggestion is appreciated.
>
> > > Kumar    _/|\_www.saisk.com
> > > ku...@saisk.com
> > > "making a profound difference with knowledge and creativity..."
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: eclipse obfuscation plugin for android development on OSX

2009-07-15 Thread Fred Grott(shareme)

use proguard..turn off peer optimization


Fred Grott
http://mobilebytes.wordpress.com


On Jul 15, 4:40 am, jeremygwa  wrote:
> All,
>
> I want to obfuscate my android code. I have installed the
> "obfuscate4e" plugin, but how do get it to obfuscate my code?
>
> thanks in advance 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: Tut (SDK 1.5) Get google account of user

2009-07-15 Thread kostmo

Hi ubikdroid,
Would you be able to tell me more about how you used getCredentials?

I'm trying this variation: getCredentials
(android.app.Activity,int,android.os.Bundle, java.lang.String,
java.lang.String, boolean)

Called from my activity, it is
getCredentials(this, 345, null, email, null, false);

Where 'email' is obtained from getAccount beforehand.  I have added
com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to
the manifest.  As opposed to the getAccount method, which returned an
array containing the email address, the getCredentials method called
with the above arguments returns null.  With what arguments are you
calling getCredentials?

The only docs I can find relating to this (http://
www.androidjavadoc.com/m5-rc15/com/google/android/googleapps/GoogleLoginServiceHelper.html)
seem to be outdated (wrong number of arguments).

Thanks,
Karl

On Jun 9, 6:58 am, ubikdroid  wrote:
> Woot! I got it working. I tried before with the service set to
> "reader" but I got a SecurityException thrown even though I had the
> permission in the manifest.
>
> However, if you leave the service null in the getCredentials call and
> add the permission
> com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES to
> the manifest then it works!
>
> Thanks for the help Sujay. I was working at this for a long time!
>
> On Jun 9, 9:18 am, Sujay Krishna Suresh 
> wrote:
>
> > as i already said u need to explore the getcredentials method...
> > in the params of that method u need to specfy wat u need n for which
> > service...
> > if this is done then u cangetthe sid with ease...
>
> > --
> > Regards,
> > Sujay
> > Josh 
> > Billings
> > - "Every man has his follies - and often they are the most interesting
> > thing he has got."
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



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

2009-07-15 Thread dotclick

So the only response I am going to get from Google is from someone who
didn't read the message or take the time to research it.

No status updates or responses on the bug report from 7+ months ago.
If this is all Google has to offer, I don't think we will be using any
Google services in the future.


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



[android-developers] Camera preview on an OpenGL surface....

2009-07-15 Thread Richard Schilling

Just getting started with OpenGL surfaces, really.

I'd like to display a camera preview in the background on its own
surface (no problem there).
And, I'd like to draw on another surface layered on top of that with a
OpenGLSurfaceView.

But the OpenGLSurfaceView completely blocks the view camera preview.

What's the best way to either
a) use the OpenGLSurfaceView for the camera preview and then draw on
top of the camera preview, or
b) create an OpenGLSurfaceView object with a transparent background
(which, I don't think is possible?).

Thanks.

Richard Schilling
Root Wireless

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



[android-developers] Re: AsyncTask on a button

2009-07-15 Thread loudo

Thanks a lot
I works.

On 15 juil, 15:15, Mark Murphy  wrote:
> loudo wrote:
> > why i have the message i can't alter a view in other thread when il
> > launch another time the AsyncTask ?
>
> You may have a bug in your AsyncTask subclass.
>
> As I wrote:
>
> "In any AsyncTask, you should be modifying your UI via onPostExecute(),
> or perhaps onProgressUpdate(). Note that "modifying your UI" includes
> things like updating an adapter that is already connected to a ListView."
>
> So if in doInBackground() you try modifying the UI, directly or
> indirectly, you will get the exception you are describing. Determine
> what part of your code is triggering that exception, and determine how
> to move it to onPostExecute() or onProgressUpdate().
>
> --
> 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] How to get a child views of particular TableRow in TableLayout ?

2009-07-15 Thread Mapara,Harshit Nitinkumar

Hi All,

Here is my screen description:
It is a TableLayout and it contains multiple Rows.
I have set TableRow as clickable, as I want to go to next screen on
click of a tableRow.
Everything I am doing through Java programming (instead of XML layout,
because number of TableRows  changes each time)

On next screen, I wanted to display all the views of that particular
clicked TableRow.
Here the problem i am facing is how to capture particular tableRow  on
onclick() even and how do I get all the textviews of that particular
Row.

I tried to set id at runtime, and tried to get id of view, but it's
not working, giving error resourcenotfoundexception.

Thanks
Harshit
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Rick

I am able to play it just as I would any other .mp3 file in iTunes,
WMP, Quicktime, etc, and .mp3 is definitely a supported file type
because I can stream it straight from the http. A permissions problem
is a case that I have not yet investigated. I will look further into
that angle and see if the problem lies there.

Thanks for all your help Marco.

On Jul 15, 4:59 pm, Marco Nelissen  wrote:
> On Wed, Jul 15, 2009 at 1:37 PM, Rick wrote:
>
> > /data/data/etc. is the relative path to the file in the database. At
> > least I'm fairly certain that it is. So the idea is that it would play
> > it from its location in the database. This file at that path is fine
> > because using the DDMS Perspective within Eclipse I can navigate to
> > that path, pull the file locally, and play it no problem.
>
> Play it using what?
>
> > The full log print out is as follows.
>
> > 07-15 20:33:54.736: ERROR/PlayerDriver(554): Command
> > PLAYER_SET_DATA_SOURCE completed with an error or info
> > PVMFErrNotSupported
>
> That would seem to indicate that the file is not in a supported format.
> You can doublecheck this by copying it your sd card and using the
> music app to play it.
> If the music app does play it, then I suspect a permissions problem
> (i.e. the media service can't access the file)
>
> > 07-15 20:33:54.785: ERROR/MediaPlayer(31280): error (1, -4)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280): create failed:
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280): java.io.IOException:
> > Prepare failed.: status=0x1
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.media.MediaPlayer.prepare(Native Method)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.media.MediaPlayer.create(MediaPlayer.java:520)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.media.MediaPlayer.create(MediaPlayer.java:497)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > scvngr.android.Mission.audioButtonHandler(Mission.java:188)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > scvngr.android.Mission$6.onClick(Mission.java:139)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.View.performClick(View.java:2179)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.View.onTouchEvent(View.java:3828)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.widget.TextView.onTouchEvent(TextView.java:6291)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.View.dispatchTouchEvent(View.java:3368)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
> > (PhoneWindow.java:1197)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.app.Activity.dispatchTouchEvent(Activity.java:1993)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.os.Looper.loop(Looper.java:123)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > android.app.ActivityThread.main(ActivityThread.java:3948)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> > (ZygoteInit.java:782)
> > 07-15 20:33:54.855: DEBUG/

[android-developers] Re: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Marco Nelissen

On Wed, Jul 15, 2009 at 1:37 PM, Rick wrote:
>
> /data/data/etc. is the relative path to the file in the database. At
> least I'm fairly certain that it is. So the idea is that it would play
> it from its location in the database. This file at that path is fine
> because using the DDMS Perspective within Eclipse I can navigate to
> that path, pull the file locally, and play it no problem.

Play it using what?

> The full log print out is as follows.
>
> 07-15 20:33:54.736: ERROR/PlayerDriver(554): Command
> PLAYER_SET_DATA_SOURCE completed with an error or info
> PVMFErrNotSupported

That would seem to indicate that the file is not in a supported format.
You can doublecheck this by copying it your sd card and using the
music app to play it.
If the music app does play it, then I suspect a permissions problem
(i.e. the media service can't access the file)

> 07-15 20:33:54.785: ERROR/MediaPlayer(31280): error (1, -4)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280): create failed:
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280): java.io.IOException:
> Prepare failed.: status=0x1
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.media.MediaPlayer.prepare(Native Method)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.media.MediaPlayer.create(MediaPlayer.java:520)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.media.MediaPlayer.create(MediaPlayer.java:497)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> scvngr.android.Mission.audioButtonHandler(Mission.java:188)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> scvngr.android.Mission$6.onClick(Mission.java:139)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.View.performClick(View.java:2179)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.View.onTouchEvent(View.java:3828)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.widget.TextView.onTouchEvent(TextView.java:6291)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.View.dispatchTouchEvent(View.java:3368)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> com.android.internal.policy.impl.PhoneWindow
> $DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
> (PhoneWindow.java:1197)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.app.Activity.dispatchTouchEvent(Activity.java:1993)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> com.android.internal.policy.impl.PhoneWindow
> $DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.os.Looper.loop(Looper.java:123)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:782)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 07-15 20:33:54.855: DEBUG/MediaPlayer(31280):     at
> dalvik.system.NativeStart.main(Native Method)
>
>
> On Jul 15, 4:13 pm, Marco Nelissen  wrote:
>> On Wed, Jul 15, 2009 at 12:26 PM, Rick wrote:
>>
>> > The files are stored in a JSON Database in http format, but to
>> > eliminate loading times since the application they will be used in
>> > will also include video and time is a factor, prior to launching a
>> > "game" I download the necessary files from the JSON

[android-developers] Re: Fast, efficient usage of an object pool

2009-07-15 Thread Romain Guy

We have an efficient implementation for you: use the Pools.java file
from 
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/java/android/util;h=728ff2a95d2b382c4a16a28cc9766d29bc84e1b3;hb=master
(and the associated classes.) These are not public APIs so just copy
the code in your application.

Here's an example of a Poolable object with this API:
static class InvalidateInfo implements Poolable {
private static final int POOL_LIMIT = 10;
private static final Pool sPool =
Pools.synchronizedPool(
Pools.finitePool(new PoolableManager() {
public InvalidateInfo newInstance() {
return new InvalidateInfo();
}

public void onAcquired(InvalidateInfo element) {
}

public void onReleased(InvalidateInfo element) {
}
}, POOL_LIMIT)
);

private InvalidateInfo mNext;

public void setNextPoolable(InvalidateInfo element) {
mNext = element;
}

public InvalidateInfo getNextPoolable() {
return mNext;
}

static InvalidateInfo acquire() {
return sPool.acquire();
}

void release() {
sPool.release(this);
}
}

On Wed, Jul 15, 2009 at 1:48 PM, Brad Larson wrote:
>
> At Google I/O and in the forums, it has been clear that if you need
> optimal performance, you must avoid memory allocation inside tight
> loops.  I'm curious about the best way to handle this in my use-case,
> which I think must be fairly common.  I need to access at most n
> objects of type MyObject, I need to iterate over them during every
> screen refresh,  and I need to remove them and put them back in the
> object pool randomly.
>
> The object pool seems pretty straight-forward, just use a
> Vector(n), add n copies of MyObject at bootup, and add/
> remove from the end to avoid any memcpy or allocation.
>
> The iterating is a little more difficult.  I can use for(MyObject m :
> myObjects), but this will allocate memory to create the iterator.  I
> could create a static final Iterator at bootup, but there is no good
> way to get back to the start of the List.  For now, I'm using another
> Vector for active MyObjects, and a for loop with an int to get() the
> objects and avoid allocating an iterator.  get() runs in constant time
> for a Vector, so this works well.
>
> However, when an object is done, I need to remove it and send it back
> to the pool.  If I use Vector.remove(i), it has to memcpy everything
> after i.  I could use an Iterator on a LinkedList, which can remove()
> in constant time, but I don't think there is a good way to get the
> Iterator back to the start of the list without allocating memory.  I
> could use an int to loop through a LinkedList, but LinkedList.get(n)
> runs in O(n) time.
>
> Any tips on the optimal way to solve this?  Worst-case, I assume the
> memcpy called during Vector.remove() is a better bet over allocating
> an Iterator inside my app loop, correct?
>
> Thanks!
> Brad
> >
>



-- 
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] Fast, efficient usage of an object pool

2009-07-15 Thread Brad Larson

At Google I/O and in the forums, it has been clear that if you need
optimal performance, you must avoid memory allocation inside tight
loops.  I'm curious about the best way to handle this in my use-case,
which I think must be fairly common.  I need to access at most n
objects of type MyObject, I need to iterate over them during every
screen refresh,  and I need to remove them and put them back in the
object pool randomly.

The object pool seems pretty straight-forward, just use a
Vector(n), add n copies of MyObject at bootup, and add/
remove from the end to avoid any memcpy or allocation.

The iterating is a little more difficult.  I can use for(MyObject m :
myObjects), but this will allocate memory to create the iterator.  I
could create a static final Iterator at bootup, but there is no good
way to get back to the start of the List.  For now, I'm using another
Vector for active MyObjects, and a for loop with an int to get() the
objects and avoid allocating an iterator.  get() runs in constant time
for a Vector, so this works well.

However, when an object is done, I need to remove it and send it back
to the pool.  If I use Vector.remove(i), it has to memcpy everything
after i.  I could use an Iterator on a LinkedList, which can remove()
in constant time, but I don't think there is a good way to get the
Iterator back to the start of the list without allocating memory.  I
could use an int to loop through a LinkedList, but LinkedList.get(n)
runs in O(n) time.

Any tips on the optimal way to solve this?  Worst-case, I assume the
memcpy called during Vector.remove() is a better bet over allocating
an Iterator inside my app loop, correct?

Thanks!
Brad
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Rick

/data/data/etc. is the relative path to the file in the database. At
least I'm fairly certain that it is. So the idea is that it would play
it from its location in the database. This file at that path is fine
because using the DDMS Perspective within Eclipse I can navigate to
that path, pull the file locally, and play it no problem.

The full log print out is as follows.

07-15 20:33:54.736: ERROR/PlayerDriver(554): Command
PLAYER_SET_DATA_SOURCE completed with an error or info
PVMFErrNotSupported
07-15 20:33:54.785: ERROR/MediaPlayer(31280): error (1, -4)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): create failed:
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): java.io.IOException:
Prepare failed.: status=0x1
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.media.MediaPlayer.prepare(Native Method)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.media.MediaPlayer.create(MediaPlayer.java:520)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.media.MediaPlayer.create(MediaPlayer.java:497)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
scvngr.android.Mission.audioButtonHandler(Mission.java:188)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
scvngr.android.Mission$6.onClick(Mission.java:139)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.View.performClick(View.java:2179)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.View.onTouchEvent(View.java:3828)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.widget.TextView.onTouchEvent(TextView.java:6291)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.View.dispatchTouchEvent(View.java:3368)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
(PhoneWindow.java:1197)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.app.Activity.dispatchTouchEvent(Activity.java:1993)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.os.Looper.loop(Looper.java:123)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
android.app.ActivityThread.main(ActivityThread.java:3948)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
java.lang.reflect.Method.invokeNative(Native Method)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
java.lang.reflect.Method.invoke(Method.java:521)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-15 20:33:54.855: DEBUG/MediaPlayer(31280): at
dalvik.system.NativeStart.main(Native Method)


On Jul 15, 4:13 pm, Marco Nelissen  wrote:
> On Wed, Jul 15, 2009 at 12:26 PM, Rick wrote:
>
> > The files are stored in a JSON Database in http format, but to
> > eliminate loading times since the application they will be used in
> > will also include video and time is a factor, prior to launching a
> > "game" I download the necessary files from the JSON Database to a
> > SQLite database on the phone.
>
> > I am able to stream the file directly from its full http path using
> > AsyncPlayer but there is a loading time I would like to avoid, and
> > AsyncPlayer does not work with video. I have not tested whether or not
> > the file would play from the sd card, but I am fairly certain that is
> > not the issue since I am able to pull the file from the SQLite
> > database and play it locally on my computer with no problems.
>
> > Sorry if that was slightly c

[android-developers] Re: IllegalAccessError - any clues when this may come..

2009-07-15 Thread fadden

On Jul 15, 4:41 am, Raja Nagendra Kumar 
wrote:
> 07-15 17:07:34.851: ERROR/AndroidRuntime(805):
> java.lang.IllegalAccessError: cross-loader access from pre-verified
> class

Check the logcat output for details.

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

2009-07-15 Thread Dianne Hackborn
No, sorry.

On Wed, Jul 15, 2009 at 10:43 AM, dadical  wrote:

>
> Is there a way to monitor the resource usages of a Thread in Android?
> Resources of interest include CPU, memory, etc.  It doesn't seem like
> ManagementFactory or ThreadMXBean are supported in Android. Are there
> other options?
>
> I would want to do this at runtime, from within a deployed
> appolication, not just during dev/debug.
>
> dk
> >
>


-- 
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: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Marco Nelissen

On Wed, Jul 15, 2009 at 12:26 PM, Rick wrote:
>
> The files are stored in a JSON Database in http format, but to
> eliminate loading times since the application they will be used in
> will also include video and time is a factor, prior to launching a
> "game" I download the necessary files from the JSON Database to a
> SQLite database on the phone.
>
> I am able to stream the file directly from its full http path using
> AsyncPlayer but there is a loading time I would like to avoid, and
> AsyncPlayer does not work with video. I have not tested whether or not
> the file would play from the sd card, but I am fairly certain that is
> not the issue since I am able to pull the file from the SQLite
> database and play it locally on my computer with no problems.
>
> Sorry if that was slightly confusing. I'm not the best at explaining
> things.

I'm still confused, since you again said that the files are in a
SQLite database, but the code you posted wants to play
/data/data/project.android/files/musicfile.mp3 which is clearly just a
regular file path. So where does the database fit in to all this? Are
you pulling the data from a sqlite blob, writing it to a file, then
playing that file?
If so, you might want to verify that the file itself is actually OK
when you try to play it.
Also, is there anything else in the log? When MediaPlayer.create()
fails, something should be printed to the log that tells you why.

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

2009-07-15 Thread guruk

Hi,
when i go in my webview to a page with picture upload
i get "upload disabled" on that button.

How can i code my Webview, that my Android users
can upload pics to my online page?

... it looks the only way is to code all directly in
android... i can do... just its a pain to do.

chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 find out the percentage of memory used by each process in the android

2009-07-15 Thread Peli

> If the broadcast needs to launch any .apks, it gets serialized so that only
> one .apk is launched at a time.

Thanks for the detailed info. This is good news.
((ok, now the only problem I see in my use case is if those broadcast
receivers launch services to continue their work, and then a couple of
services have to struggle for memory concurrently - but there is
probably not much the platform can do about that. Probably it is best
if each service indicates when it is done, so that the next apk can be
launched by the main program through an apk specific broadcast))

Peli

On Jul 15, 8:36 pm, Dianne Hackborn  wrote:
> On Wed, Jul 15, 2009 at 10:59 AM, Peli  wrote:
> > I have the following follow-up question:
> > Even for small apks (single broadcast receiver, few lines of code),
> > top shows a few MB of memory usage. Is there a rule of thumb how much
> > of this is shared and how much is approximately due to the apk?
>
> Well take for example the alarm clock running, which I haven't launched
> myself but whose process got launched from a broadcast at some point, so
> shouldn't have done a whole lot:
>
>   217   10496K   10496K    2177K    1400K  com.android.alarmclock
>
> That's almost 1.5MB purely owned by the process and immediately made
> available if the process is killed; the extra .6MB (bring us up to 2MB pss)
> is shared memory, so it won't be available if the process is killed.
>
> Considering the amount of memory on the device, a process is a
> super-expensive object.  You really want to avoid using extra processes
> where you don't need to, and this is why I am so adamant about people not
> leaving a process sitting there running in the background forever.  (In fact
> there just isn't the memory to allow for that, so by the time we got to 1.0
> the system became quite aggressive about killing long-running processes,
> even if they contain actively running services, to be able to keep the
> overall experience decent.)
>
> Oh and for the shared memory, you need to be careful in interpreting the
> numbers -- it's not really .6MB that is shared, this has been weighted by
> the number of processes sharing it.  So given this device currently has 13
> Java processes running in it, you can figure that there is around 8MB that
> we manage to share from zygote into the Java processes.  Thank ghod for
> zygote. :)
>
> (I'm especially interested in the situation where there is one main
>
> > program that sends a broadcast to several apks. Would this scale well,
> > or would this quickly fill up the memory, even if the individual apks
> > are small (since all broadcast receivers would be called
> > concurrently)).
>
> If the broadcast needs to launch any .apks, it gets serialized so that only
> one .apk is launched at a time.  Trying to just blindly launch a bunch of
> apps to receive the broadcast would be very painful. :)
>
> --
> 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: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Rick

The files are stored in a JSON Database in http format, but to
eliminate loading times since the application they will be used in
will also include video and time is a factor, prior to launching a
"game" I download the necessary files from the JSON Database to a
SQLite database on the phone.

I am able to stream the file directly from its full http path using
AsyncPlayer but there is a loading time I would like to avoid, and
AsyncPlayer does not work with video. I have not tested whether or not
the file would play from the sd card, but I am fairly certain that is
not the issue since I am able to pull the file from the SQLite
database and play it locally on my computer with no problems.

Sorry if that was slightly confusing. I'm not the best at explaining
things.

On Jul 15, 3:16 pm, Marco Nelissen  wrote:
> What do you mean when you say the audio file is stored in a SQLite database?
> Does playing the same file from the sd card work?
>
> On Wed, Jul 15, 2009 at 12:05 PM, Rick wrote:
>
> > What I am trying to accomplish here is to get an audio file that I
> > have stored in an SQLite database on the phone, and play it upon
> > clicking a button. audioPath is the path to the file. The problem is
> > that MediaPlayer.create() is always null, even though I believe I am
> > giving it a correct Uri. Can anyone shed some light on this? Code
> > snippet below:
>
> > Uri uri = Uri.parse(audioPath);
> > Log.i(TAG,"AUDIO: " + uri.toString());
> > MediaPlayer mp = MediaPlayer.create(this, uri);
> > if (mp != null){
> >        mp.start();
> >        ...
>
> > "AUDIO: /data/data/project.android/files/musicfile.mp3"
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] ADC 2 - Can I post my app to the app store after August 1st?

2009-07-15 Thread dadical

I want to post to app store, get an application ID, and modify my
application to point to the right app in the app store for eventual
user upgrade after the challenge.

I'll need to upload the app to get the proper application search
criteria.  Is this valid to do according to the ADC rules, or will
upload to the app store in any context other than as a submission for
ADC invalidate my entry?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Marco Nelissen

What do you mean when you say the audio file is stored in a SQLite database?
Does playing the same file from the sd card work?


On Wed, Jul 15, 2009 at 12:05 PM, Rick wrote:
>
> What I am trying to accomplish here is to get an audio file that I
> have stored in an SQLite database on the phone, and play it upon
> clicking a button. audioPath is the path to the file. The problem is
> that MediaPlayer.create() is always null, even though I believe I am
> giving it a correct Uri. Can anyone shed some light on this? Code
> snippet below:
>
> Uri uri = Uri.parse(audioPath);
> Log.i(TAG,"AUDIO: " + uri.toString());
> MediaPlayer mp = MediaPlayer.create(this, uri);
> if (mp != null){
>        mp.start();
>        ...
>
> "AUDIO: /data/data/project.android/files/musicfile.mp3"
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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] Extend core apps in the SDK

2009-07-15 Thread dmodroid

I know this topic has been covered a lot, so apologies if this is
redundant.  I would like to work in the SDK and simply extend a core
app that already exists, and then override some functionality.  For
example, I would like to extend Contacts, but then overwrite the
entire ContactsListActivity class, for my own experimental
MyContacts.apk.

In this youtube video: http://www.youtube.com/watch?v=3aUjukCdPyQ

Dianne talks about the ringtone picker, did she just extend the core
ringtone picker and work in the SDK?

I DO have the entire platform source code, and have made some changes
to core apps there, but rebuilding takes awhile (even useing mmm, and
snod), so I was hoping to speed up development by working in the SDK
(where building and running the emulator seems to go faster).  Not
sure if this is realistic or not.

This is all just for some internal experimentation, I am not looking
to contribute the the core apps.

In another post, someone had referred to " classes available in
the SDK".  How can we see what classes we have access to, in the
SDK.

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] MediaPlayer.create always returning null (SQLite URI Problem Maybe?)

2009-07-15 Thread Rick

What I am trying to accomplish here is to get an audio file that I
have stored in an SQLite database on the phone, and play it upon
clicking a button. audioPath is the path to the file. The problem is
that MediaPlayer.create() is always null, even though I believe I am
giving it a correct Uri. Can anyone shed some light on this? Code
snippet below:

Uri uri = Uri.parse(audioPath);
Log.i(TAG,"AUDIO: " + uri.toString());
MediaPlayer mp = MediaPlayer.create(this, uri);
if (mp != null){
mp.start();
...

"AUDIO: /data/data/project.android/files/musicfile.mp3"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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-15 Thread Mark Murphy

doubleminus wrote:
> Anyone??
> 
> On Jul 14, 9:09 am, doubleminus  wrote:
>> Isn't that what the first lines of code do?
>>
>> File file1 = new File(Environment.getExternalStorageDirectory(),
>> file_name);

No. That statement create a Java object, in memory, and does not affect
the file system at all.

-- 
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] Unable to write text file to sdcard on physical G1 device

2009-07-15 Thread Jason Proctor

making a File object does not create the actual 
file. usually it's created with a 
FileOutputStream or File.createNewFile() or 
somesuch.

as always, reading the docs pays dividends :-) 
also i'd recommend writing some little Java 
command line programs to get the feel of things. 
that way you don't have to deploy to the 
(relatively) hostile environment of the phone 
just to figure out stuff like File.

hth



>Anyone??
>
>On Jul 14, 9:09 am, doubleminus  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  wrote:
>>
>>
>>
>>  > Simple. :-)
>>  > The error says that the file does not exist... that means you should
>>  > create it.
>>  > Use File#createNewFile().
>>
>>  > On Jul 13, 5:53 pm, doubleminus  wrote:
>>
>>  > > Romain is?  I don't understand. Is there something I should be doing
>>  > > to avoid filenotfound exception?
>>
>>  > > On Jul 13, 12:40 am, ÷£‘ƒ  wrote:
>>
>>  > > > You are right...
>>
>>  > > > > Date: Sun, 12 Jul 2009 21:29:28 -0700
>>  > > > > Subject: [android-developers] Re: 
>>Unable to write text file to sdcard on 
>>physical G1 device
>>  > > > > From: romain...@google.com
>>  > > > > To: android-developers@googlegroups.com
>>
>>  > > > > Hi,
>>
>>  > > > > Instead of:
>>
>>  > > > > > FileOutputStream file_out = openFileOutput
>>  > > > > > (file_name,MODE_WORLD_READABLE);
>>
>>  > > > > Just use:
>>
>>  > > > > FileOutputStream file_out = new FileOutputStream(file_name);
>>
>>  > > > > This should work.
>>
>>  > > > > On Sun, Jul 12, 2009 at 8:10 PM, 
>>doubleminus wrote:
>>
>>  > > > > > I need to write a fairly simple .csv 
>>file to the device's sdcard (so
>>  > > > > > it can then be emailed via Intent). 
>>The below code does not write the
>>  > > > > > file.
>>
>>  > > > > > File file1 = new File(Environment.getExternalStorageDirectory(),
>>  > > > > > file_name);
>>  > > > > > FileOutputStream file_out = openFileOutput
>>  > > > > > (file_name,MODE_WORLD_READABLE);
>>  > > > > > BufferedOutputStream buf = new BufferedOutputStream(file_out);
>>  > > > > > OutputStreamWriter out_stream = new OutputStreamWriter(buf);
>>
>>  > > > > >  // write fields in first 
>>row of spreadsheet then a new line
>>  > > > > >  for (int i = 0; i < FIELDS.length; i++)
>>  > > > > >  {
>>  > > > > > if (i != FIELDS.length - 1)
>>  > > > > >out_stream.write(FIELDS[i] + ",");
>>  > > > > > else
>>  > > > > >out_stream.write(FIELDS[i]);
>>  > > > > >  }
>>
>>  > > > > >  out_stream.write("\n");
>>
>>  > > > > > // more code here
>>
>>  > > > > > I flush and close out_stream. I can 
>>even seem to be able to read from
>>  > > > > > the file on the device (printing 
>>above output, using fileinputstream,
>>  > > > > > to an edittext.
>>
>>  > > > > > How can I get to this file on the sdcard?
>>
>>  > > > > > Thanks!
>>
>>  > > > > > double
>>
>>  > > > > --
>>  > > > > Romain Guy
>>  > > > > Android framework engineer
>>  > > > > romain...@android.com
>>
>>  > > > > Note: please don't send private 
>>questions to me, as I don't have time
>>  > > > > to provide private support.  All such questions should be posted on
>>  > > > > public forums, where I and others can see and answer them
>>
>>  > > > _
>>  > > > MSN 
>>ï\èÓñÇñ@ ÈÅC⸱”ßAìI 'ªƒ ±ë“ÅIhttp://im.live.cn/emoticons/-Hidequoted 
>>text -
>>
>>  > > - Show quoted text -
>

-- 
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: Unable to write text file to sdcard on physical G1 device

2009-07-15 Thread doubleminus

Anyone??

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

2009-07-15 Thread Jason Proctor

>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] Re: Notification Manager Help

2009-07-15 Thread Yusuf T. Mobile

Your problem may be in the generic constructor "new Intent()". I
recommend you do something like:

Intent i = new Intent (this, Cvance383Activity.class)
.setAction(Intent.ACTION_MAIN)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, i,
0);


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.

P.S. Bumps are impolite.


On Jul 15, 10:07 am, cvance383  wrote:
> bump?
>
> On Jul 14, 5:24 pm, cvance383  wrote:
>
>
>
> > Just trying to create a simplenotification, but keep getting an
> > illegalarguementexception "contentIntent required". Which is weird
> > because I believe I am passing the content intent.  Here is my code...
>
> > {
> >                notification= newNotification(iconID, message,
> > System.currentTimeMillis());
> >                 PendingIntent appIntent = 
> > PendingIntent.getActivity(mobileApp, 0,
> > new Intent(), PendingIntent.FLAG_NO_CREATE);
> >                notification.setLatestEventInfo(mobileApp,"Now Playing: ",
> > detailedMessaged, appIntent);
> >                 nManager.notify(MOBILE_APP_ID,notification);
> >                 Log.d( this.getClass().toString(), "Launching 
> > NewNotification" );
> >         }
>
> > I dont even care if thenotificationdoes anything when u click on it.
> > I just want anotificationthe user can see. I construct an empty
> > intent "new Intent()", but have also tried it with a non-empty intent.
> > I also tried passing null for contentIntent, and get the same
> > exception. Whats the deal-o? 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: Content rendering for WebView

2009-07-15 Thread Mark Murphy

m8 wrote:
> 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,

That is a matter of what MIME type the file is served as. Android tries
to find something on the device that can handle that MIME type.

-- 
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: how to find out the percentage of memory used by each process in the android

2009-07-15 Thread Dianne Hackborn
On Wed, Jul 15, 2009 at 10:59 AM, Peli  wrote:

> I have the following follow-up question:
> Even for small apks (single broadcast receiver, few lines of code),
> top shows a few MB of memory usage. Is there a rule of thumb how much
> of this is shared and how much is approximately due to the apk?


Well take for example the alarm clock running, which I haven't launched
myself but whose process got launched from a broadcast at some point, so
shouldn't have done a whole lot:

  217   10496K   10496K2177K1400K  com.android.alarmclock

That's almost 1.5MB purely owned by the process and immediately made
available if the process is killed; the extra .6MB (bring us up to 2MB pss)
is shared memory, so it won't be available if the process is killed.

Considering the amount of memory on the device, a process is a
super-expensive object.  You really want to avoid using extra processes
where you don't need to, and this is why I am so adamant about people not
leaving a process sitting there running in the background forever.  (In fact
there just isn't the memory to allow for that, so by the time we got to 1.0
the system became quite aggressive about killing long-running processes,
even if they contain actively running services, to be able to keep the
overall experience decent.)

Oh and for the shared memory, you need to be careful in interpreting the
numbers -- it's not really .6MB that is shared, this has been weighted by
the number of processes sharing it.  So given this device currently has 13
Java processes running in it, you can figure that there is around 8MB that
we manage to share from zygote into the Java processes.  Thank ghod for
zygote. :)

(I'm especially interested in the situation where there is one main
> program that sends a broadcast to several apks. Would this scale well,
> or would this quickly fill up the memory, even if the individual apks
> are small (since all broadcast receivers would be called
> concurrently)).


If the broadcast needs to launch any .apks, it gets serialized so that only
one .apk is launched at a time.  Trying to just blindly launch a bunch of
apps to receive the broadcast would be very painful. :)

-- 
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] Content rendering for WebView

2009-07-15 Thread m8

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

2009-07-15 Thread Dianne Hackborn
Hi, this isn't really supported by toasts, which are designed to be shown
completely independently of the current app.  You can fairly easily
accomplish this by just displaying a normal dialog, except making it not
have focus or receive touch events and giving it an animation style that
fades in and then out.

On Wed, Jul 15, 2009 at 11:09 AM, Rohan Solanki wrote:

> Hi all,
>I want my Toast to be displayed at specific points on the screen. How do
> i do that?
>
> Thanks in advance...
>
> >
>


-- 
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] Best Practice for overriding both Theme and Theme.Dialog correctly in an app?

2009-07-15 Thread Robert Green

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] Toast

2009-07-15 Thread Rohan Solanki
Hi all,
   I want my Toast to be displayed at specific points on the screen. How do
i do that?

Thanks in advance...

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



[android-developers] Re: Keyboard Backlight (G1) unavailable in Cupcake 1.5

2009-07-15 Thread Zan


this is a serious design flaw and this problem is stopping me from
enjoying my G1. I dread sending txt's in day light now.

Please please please, is there no way for fixing this?

dare i say it, im now looking at the new I phone it bugs me that much



On Jul 14, 1:10 am, Devomat  wrote:
> You're right... so i can't understand why cupcake has no settings
> to switch off the keyboardBacklight.
>
> I hope in future releases of Cupcake it will be possible.
>
> On 24 Mai, 09:02, milind  wrote:
>
>
>
> > Practically every white and bronze G1 owners would like better control
> > over thebacklight.  It works well in the night.  But in every other
> > situation, it's easier to see the text without thebacklight.  Surely
> > someone in HTC must have tested this?  In 1.1, I could use an app
> > called DarkKeys.  It no longer works in cupcake.  You are going to
> > see a lot of people hollering for this, now that Cupcake is out
> > officially.
>
> > I love the G1.  But some really obvious things like this, seems to
> > have completely missed everyone responsible.  I was hoping that a
> > better solution would have come in Cupcake.  It's now worse!
>
> > IMO, there is no other issue higher than this.  Because it's I M P O S
> > S I B L E to type on this keyboard!
>
> > Regards
> > Milind

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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 find out the percentage of memory used by each process in the android

2009-07-15 Thread Peli

I have the following follow-up question:
Even for small apks (single broadcast receiver, few lines of code),
top shows a few MB of memory usage. Is there a rule of thumb how much
of this is shared and how much is approximately due to the apk?

(I'm especially interested in the situation where there is one main
program that sends a broadcast to several apks. Would this scale well,
or would this quickly fill up the memory, even if the individual apks
are small (since all broadcast receivers would be called
concurrently)).

Peli

On Jul 15, 6:49 pm, Dianne Hackborn  wrote:
> There is lots of memory sharing between processes, so this is actually a
> really hard thing to determine.  For development purposes, the "procrank"
> command is the most common tool to use.  The last two columns of memory
> usage are the most interesting ones: the last one is the memory owned
> exclusively by that process, and the second to the last is that plus the
> shared memory weighted by how many processes are sharing each page.
>
> Note that this command is not part of the SDK, and for format of its output
> tends to change, so it should only be used for development purposes.
>
> For even more detail specifically about Java processes, you can use "adb
> shell dumpsys memoryinfo"
>
>
>
> On Wed, Jul 15, 2009 at 3:45 AM, arvind  wrote:
>
> > Hi all,
>
> > I want to calculate the performance for some of the task/process.
>
> > How to find out the percentage of memory used by each process in the
> > android.
> > - is there any in build class\process to do this?
>
> > Thanks and 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-15 Thread Mark Murphy

elDoudou wrote:
> Thank you Mark for taking the time. Yes, my ASCII "art" does not fit
> well with the browser non-fixed-space font.
> 
>  - Just to let you know that setting
> android:layout_centerVertical="true" on the 3 widget does not solve
> the problem (I forgot to mention that I had already tried...)

That should work, assuming the height of widgets 1 and 3 are
wrap_content. If you have them be fill_parent, you will get the behavior
you are seeing.

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

Android App Developer Books: http://commonsware.com/books.html

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



[android-developers] WebView and HTTP Post requests

2009-07-15 Thread Jason Proctor

just reverse what i did :-)

after your request completes, get the Apache CookieStore object from 
your post object (post.getCookieStore()) and copy the relevant 
cookies to the WebKit CookieManager (CookieManager.getInstance()). in 
theory, this should result in those cookies being sent in future 
WebKit HTTP requests.

i have more confidence that this will work than the other way round.


>But how does that help you get the cookie from a POST response and
>then set the cookie on the WebView.? I can't find anyway to add a
>cookie to a custom webview
>
>On Jul 15, 1:26 pm, Jason Proctor 
>wrote:
>>  >DGupta wrote:
>>  >>  So I'm attempting to connect to the Tumblr Dashboard using an HTTP
>>  >>  Post. The Activity uses a WebView and I do an http post after creating
>>  >>  the webview, but the redirect_to in the HTTP Post doesn't work with
>>  >>  the WebView. I know my post works and isn't throwing errors, however I
>>  >>  need the HTTP Post to work with the webview and am completely lost on
>>  >>  how to.
>>
>>  >HttpClient and WebView are completely separate engines. Operations done
>>  >in one will not affect the other.
>>
>>  >If the Tumblr POST is setting a session cookie or something, you may be
>>  >able to get that out of the HttpClient cookie jar and feed it to
>>  >WebView, but I have not tried that.
>>
>>  my application combines WebKit and "native" HTTP requests, so i've
>>  messed with this quite a lot. i never managed to successfully and
>>  reliably communicate cookies between WebKit and the Apache HTTP
>>  client. the cookies come out of the WebKit cookie manager in a
>>  convenient format to inject into any request, but it seems like the
>>  Apache client only occasionally takes notice of them. i've tried
>>  everything from dropping them into Apache's cookie jar to setting
>>  them as HTTP headers, all that.
>>
>>  going the other way might have more success, but in my application
>>  the WebKit has to establish the session. my solution was to get rid
>>  of the HTTP client from my application altogether and roll my own
>>  HTTP. since then i've had 100% success with cookie-sharing.
>>
>>  --
>>  jason.software.particle
>

-- 
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: Problem of vertical alignment in a RelativeLayout

2009-07-15 Thread elDoudou

Thank you Mark for taking the time. Yes, my ASCII "art" does not fit
well with the browser non-fixed-space font.

 - Just to let you know that setting
android:layout_centerVertical="true" on the 3 widget does not solve
the problem (I forgot to mention that I had already tried...)
 - I cannot use a horizontal LinearLayout, because I forgot to mention
that the widget labelled 3 (the one of the middle), may be larger than
the screen width, and I want to make sure that the widget labelled 2
(the one on the right) is still visible and than widget 2 is limited
in width by the 2 other widgets. Or maybe, I missed something with
LinearLayouts...
 - Here is an image paste bin of what I'm intending to do:
http://imagebin.ca/view/WAe_koO.html

I really hope that someone will unblock me. Thank you for your time
and support.
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] Re: WebView and HTTP Post requests

2009-07-15 Thread Mark Murphy

DGupta wrote:
> But how does that help you get the cookie from a POST response and
> then set the cookie on the WebView.? I can't find anyway to add a
> cookie to a custom webview

android.webkit.CookieManager is a singleton.

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

Android App Developer Books: http://commonsware.com/books.html

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



[android-developers] Re: File Browser Integration

2009-07-15 Thread Peli

Hi Dianne,

Sigh, it is almost on top of our long list of feature requests for OI
File Manager  
http://code.google.com/p/openintents/wiki/FeatureRequests#OI_File_Manager
I really want to include it, I just can't tell when I'll be able to do
so.
(I'd gladly accept a patch though, if someone interested reads this
post :-) )

Peli
www.openintents.org

On Jul 15, 6:43 pm, Dianne Hackborn  wrote:
> Hi Peli, maybe it's already done, but have you considered having this
> support GET_CONTENT so that apps can just use the normal GET_CONTENT to have
> the user select some data, and your file browser would then be one of the
> options?
>
>
>
> On Wed, Jul 15, 2009 at 8:36 AM, Peli  wrote:
>
> > There is no need to literally copy source code into your project.
> > You can use intents to integrate a 3rd party file browser with your
> > application, as described here:
> >http://www.openintents.org/en/node/159
> > see section "Information for developers"
>
> > Peli
> >www.openintents.org
>
> > On Jul 14, 8:20 pm, johnny  wrote:
> > > Hi,
>
> > > I want to integrate a file browser with my application. Does anyone
> > > know where I could get the source code for a pretty good file browser?
> > > (With the developer's permission of course). The more, the better...
>
> > > 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: WebView and HTTP Post requests

2009-07-15 Thread DGupta

But how does that help you get the cookie from a POST response and
then set the cookie on the WebView.? I can't find anyway to add a
cookie to a custom webview

On Jul 15, 1:26 pm, Jason Proctor 
wrote:
> >DGupta wrote:
> >>  So I'm attempting to connect to the Tumblr Dashboard using an HTTP
> >>  Post. The Activity uses a WebView and I do an http post after creating
> >>  the webview, but the redirect_to in the HTTP Post doesn't work with
> >>  the WebView. I know my post works and isn't throwing errors, however I
> >>  need the HTTP Post to work with the webview and am completely lost on
> >>  how to.
>
> >HttpClient and WebView are completely separate engines. Operations done
> >in one will not affect the other.
>
> >If the Tumblr POST is setting a session cookie or something, you may be
> >able to get that out of the HttpClient cookie jar and feed it to
> >WebView, but I have not tried that.
>
> my application combines WebKit and "native" HTTP requests, so i've
> messed with this quite a lot. i never managed to successfully and
> reliably communicate cookies between WebKit and the Apache HTTP
> client. the cookies come out of the WebKit cookie manager in a
> convenient format to inject into any request, but it seems like the
> Apache client only occasionally takes notice of them. i've tried
> everything from dropping them into Apache's cookie jar to setting
> them as HTTP headers, all that.
>
> going the other way might have more success, but in my application
> the WebKit has to establish the session. my solution was to get rid
> of the HTTP client from my application altogether and roll my own
> HTTP. since then i've had 100% success with cookie-sharing.
>
> --
> 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] Thread CPU Usage Monitoring

2009-07-15 Thread dadical

Is there a way to monitor the resource usages of a Thread in Android?
Resources of interest include CPU, memory, etc.  It doesn't seem like
ManagementFactory or ThreadMXBean are supported in Android. Are there
other options?

I would want to do this at runtime, from within a deployed
appolication, not just during dev/debug.

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



[android-developers] Re: Cell Radio Info

2009-07-15 Thread ain

Nice. Well now what I would want to do is log this information to a
text file and download it to my PC. So that would mean that I edit the
Dialer app. I have been looking for the source code which i have yet
to find.

ain

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



[android-developers] Re: CPU usage api's query

2009-07-15 Thread dadical

Is there any way to monitor CPU usage of a java thread from android?
It doesn't seem that android supports the ThreadMXBean or the
ManagementFactory.  What is available?  I noticed that Process offers
some very limited information, but I don't think that I can narrow
that down to actual thread usage -- it's just reporting process-level
information.





On Jul 15, 1:10 pm, Dianne Hackborn  wrote:
> There is no such concept as a "high priority application running which might
> need the entire CPU," sorry.
>
> On Wed, Jul 15, 2009 at 6:06 AM, sukumar bhashyam <
>
>
>
>
>
> bhashyam.suku...@gmail.com> wrote:
> > Hello,
> > I'm trying to develop a service, which needs to be run in background as a
> >  low priority task and does some complex processing . I need to gracefully
> > quit my service when their is a resource shortage( like CPU running low on
> > memory). Was there any APIs available to know the CPU resource usage ?.
> > Objectives of my service is to -
> >    1. Exit service when a high priority application(s) is running and which
> >  might need entire CPU resources.
> >   2. Should store my states before onDestroy() of my service is called.
>
> > I'm planning to use CPU resource usage api's in service to
> > check periodically the CPU load and quit the service if CPU load exceed a
> > threshold(80 %) after storing states. Please let me know of any better way
> > of handling the objectives of my service stated above. Thanks.
>
> > Regards,
> > Sukumar.
>
> --
> 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.- 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: Perspective drawing

2009-07-15 Thread Marco Nelissen

You can do this with the android.graphics.Camera class.
(http://developer.android.com/reference/android/graphics/Camera.html)


On Wed, Jul 15, 2009 at 5:27 AM, kalyan simhan wrote:
> hi all..
> Is there any way to achieve perspective drawing of an image.. are there any
> APIs..
> or is OpenGL the only solution..
> kindly help!!
> Thanks in advance...
>
> >
>

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



[android-developers] WebView and HTTP Post requests

2009-07-15 Thread Jason Proctor

>DGupta wrote:
>>  So I'm attempting to connect to the Tumblr Dashboard using an HTTP
>>  Post. The Activity uses a WebView and I do an http post after creating
>>  the webview, but the redirect_to in the HTTP Post doesn't work with
>>  the WebView. I know my post works and isn't throwing errors, however I
>>  need the HTTP Post to work with the webview and am completely lost on
>>  how to.
>
>HttpClient and WebView are completely separate engines. Operations done
>in one will not affect the other.
>
>If the Tumblr POST is setting a session cookie or something, you may be
>able to get that out of the HttpClient cookie jar and feed it to
>WebView, but I have not tried that.

my application combines WebKit and "native" HTTP requests, so i've 
messed with this quite a lot. i never managed to successfully and 
reliably communicate cookies between WebKit and the Apache HTTP 
client. the cookies come out of the WebKit cookie manager in a 
convenient format to inject into any request, but it seems like the 
Apache client only occasionally takes notice of them. i've tried 
everything from dropping them into Apache's cookie jar to setting 
them as HTTP headers, all that.

going the other way might have more success, but in my application 
the WebKit has to establish the session. my solution was to get rid 
of the HTTP client from my application altogether and roll my own 
HTTP. since then i've had 100% success with cookie-sharing.


-- 
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: Google market(vending.apk)

2009-07-15 Thread nEx.Software

The Market application is not intended to run on the emulator.

On Jul 14, 6:26 pm, T_sky  wrote:
> I  installed the vending.apk to emulator, but it shows:install failed
> missing shared library
> how to solve this problem? 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: Brightness change is not smooth

2009-07-15 Thread Dianne Hackborn
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  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: CPU usage api's query

2009-07-15 Thread Dianne Hackborn
There is no such concept as a "high priority application running which might
need the entire CPU," sorry.

On Wed, Jul 15, 2009 at 6:06 AM, sukumar bhashyam <
bhashyam.suku...@gmail.com> wrote:

> Hello,
> I'm trying to develop a service, which needs to be run in background as a
>  low priority task and does some complex processing . I need to gracefully
> quit my service when their is a resource shortage( like CPU running low on
> memory). Was there any APIs available to know the CPU resource usage ?.
> Objectives of my service is to -
>1. Exit service when a high priority application(s) is running and which
>  might need entire CPU resources.
>   2. Should store my states before onDestroy() of my service is called.
>
> I'm planning to use CPU resource usage api's in service to
> check periodically the CPU load and quit the service if CPU load exceed a
> threshold(80 %) after storing states. Please let me know of any better way
> of handling the objectives of my service stated above. Thanks.
>
> Regards,
> Sukumar.
>
> >
>


-- 
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: Speed up emulator starting

2009-07-15 Thread Dianne Hackborn
Even better: just don't close the emulator.

On Wed, Jul 15, 2009 at 6:10 AM, Donn Felker  wrote:

>
> Yes, you can speed it up.
>
> From the help on the emuloator:
>
>-no-boot-anim  disable animation for faster boot
>
> >
>


-- 
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: Notification Manager Help

2009-07-15 Thread cvance383

bump?

On Jul 14, 5:24 pm, cvance383  wrote:
> Just trying to create a simplenotification, but keep getting an
> illegalarguementexception "contentIntent required". Which is weird
> because I believe I am passing the content intent.  Here is my code...
>
> {
>                notification= newNotification(iconID, message,
> System.currentTimeMillis());
>                 PendingIntent appIntent = 
> PendingIntent.getActivity(mobileApp, 0,
> new Intent(), PendingIntent.FLAG_NO_CREATE);
>                notification.setLatestEventInfo(mobileApp,"Now Playing: ",
> detailedMessaged, appIntent);
>                 nManager.notify(MOBILE_APP_ID,notification);
>                 Log.d( this.getClass().toString(), "Launching 
> NewNotification" );
>         }
>
> I dont even care if thenotificationdoes anything when u click on it.
> I just want anotificationthe user can see. I construct an empty
> intent "new Intent()", but have also tried it with a non-empty intent.
> I also tried passing null for contentIntent, and get the same
> exception. Whats the deal-o? 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: Some G1 phones getting "device not found" with adb...

2009-07-15 Thread Richard Schilling

I did resolve the BATTERY_CHANGED events issue - it was in my
application design.  Search for BATTERY_CHANGED to see that thread.

Haven't worn out my connectors yet!


Richard


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



[android-developers] Re: extending parcelables

2009-07-15 Thread Dianne Hackborn
We deliberately don't support this kind of thing to keep the IPC protocol
simple.  You have basically two choices:

1. Use a concrete class type, which will result in ONLY that classes CREATOR
being used to unmarshall its data.  The protocol does no type inspection
here, since that would introduce a lot more overhead to a very common
operation.
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.

You can also do your trickery in the CREATOR to instantiate multiple types.
If you have actually overloaded a method, then yes you will call through to
the most derived class.  This is purely a Java thing, and it certainly does
work; this kind of thing is done in a few places in the system.

On Wed, Jul 15, 2009 at 7:11 AM, Bart van Wissen wrote:

>
> I've run into the following issue:
>
> Say I have an Animal class, which is parcelable, and I have a Dog
> class and a Cat class, which are subclasses of Animal and also
> implement Parcelable.
>
> Say I have a service with the following AIDL interface:
>
> sendAnimals(List animals);
>
> Now I'm calling this remote interface from some client application,
> passing it a List containing Cats and Dogs. What happens now is that
> android calls the Cat's and the Dog's writeToParcel() methods at the
> client side, but at the server side, the Animal's CREATOR is used,
> which calls Animal's readFromParcel() method.
> So the right data is sent from the client, but the wrong unmarshalling
> code is executed at the server.
>
>
> I have tried to put this in the AIDL file:
>
> sendAnimals(List animals);
>
> This results in a syntax error from the aidl compiler though.
>
> My current workaround is as follows:
> - In each specific Animal subtype's writeToParcel() method, I write
> the class name as a String into the Parcel as the first element.
> - In the Animal's CREATOR.createFromParcel() I read the first String
> out of the parcel, and based on that I create the appropriate type and
> call the appropriate readFromParcel() method.
>
> I think this is kind of ugly though. I would expect the android
> framework to take care of this for me.
>
> (My application is not actually dealing with animals, this is just to
> make it simpler to explain the issue)
> >
>


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

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

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



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

2009-07-15 Thread Richard Schilling

Sounds good.  I can give that a try as well.

I did get good results by putting registeredBatteryIntent into a
service and registering the broadcast receiver there, since it's the
service that really needs to get the messages from the broadcast
receiver, and tends to stay active longer.

Thanks everyone for your help, especially Dianne.

In addition to helping me resolve the issue, process lifecycle (as
opposed to activity lifecycle) is much less of a mystery to me now.


Richard Schilling
Root Wireless




On Jul 14, 12:30 pm, Dianne Hackborn  wrote:
> Don't do this in a static.  Once the static is set, it will hold that value
> until your process is killed, and you have no way of knowing when that will
> be.
>
> On Tue, Jul 14, 2009 at 12:08 PM, Richard Schilling <
>
>
>
> richard.rootwirel...@gmail.com> wrote:
>
> > Thanks everyone for your help.
>
> > My bad.  I do register in the body of the program instead of in the
> > manifest.  So, scratch the part above about the manifest.
>
> > I declare a static variable in the activity to keep track of whether
> > or not the registration has already happened.  Perhaps the receiver is
> > being de-registered while the static boolean reference is kept alive
> > in the VM:
>
> > public MyActivity extends Activity {
>
> >    private static boolean registeredBatteryIntent = false;
>
> > �...@override
> >    public void onCreate(Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        if (!registeredBatteryIntent){
>
> >                IntentFilter filter = new IntentFilter
> > (Intent.ACTION_BATTERY_CHANGED);
> >                MyReceiver receiver = new MyReceiver();
> >                this.registerReceiver(receiver, filter);
> >                Log.i("Receiver.Registration", "registered intent
> > receiver.");
> >                registeredBatteryIntent = true;
>
> >        }
> >    }
> > }
>
> > Richard
>
> > On Jul 14, 10:31 am, Mark Murphy  wrote:
> > > Richard Schilling wrote:
> > > > That's a good point.  I will try registering the broadcast receiver
> > > > programmatically as well to see if there's a difference in behavior.
>
> > > The docs say you need to register BATTERY_CHANGED receivers in code, not
> > > via the manifest.
>
> > > "You can not receive this through components declared in manifests, only
> > > by exlicitly [sic] registering for it with Context.registerReceiver(). "
>
> > >http://developer.android.com/reference/android/content/Intent.html#AC...
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com|
> >http://twitter.com/commonsguy
>
> > > Need help for your Android OSS project?http://wiki.andmob.org/hado
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity + CheckBox = bug ?

2009-07-15 Thread Maisonobe.A (MaaKs)

@  Mark Murphy  right , i have two checkboxes , i'm looking at your
document right now , thank you again
@  Romain Guy  thank you too for answering
cheers

On Jul 15, 6:18 pm, Mark Murphy  wrote:
> As Romain Guy pointed out, if you use choiceMode, Android *will* track
> the checkbox states for you...but only if you have one checkbox per row.
> I believe you indicated you had two, which is why I didn't suggest that
> originally.
>
> > what i don't understand through is that each checkbox have it's own
> > checked value wich should be used by android when repaint is
> > called ...
>
> Why would it? Remember that Android is extensible, and there is no way
> for Android to know which widgets have state that would need to be
> persisted, or how necessarily to persist it. Only if *Android* is
> putting the checkbox there (e.g., choiceMode) is it Android's
> responsibility to track state -- if you put it there, it is your
> responsibility.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView's use of AbsoluteLayout

2009-07-15 Thread Dianne Hackborn
That isn't possible since it would break applications.

On Tue, Jul 14, 2009 at 11:37 AM, donthorp  wrote:

>
> Are there currently any plans to replace AbsoluteLayout in in WebView?
> I need to place  native controls based on the coordinates of elements
> in the WebView. I'm currently using a separate View to manage the
> layer, but I'd prefer to override the layout in WebView.
>
> Thanks,
> Don Thorp
> Titanium Mobile: Android
>
> >
>


-- 
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: Difference between BitBlit algorithms in skia and libpixelflinger

2009-07-15 Thread Dianne Hackborn
Hi, non-SDK questions should be posted to android-porting.  Thanks.

On Tue, Jul 14, 2009 at 3:38 PM, naresh  wrote:

>
> Hi All,
> In Android, I could see 2 BitBlit functions defined in skia and
> libpixelflinger libraries.
>
> 1) S32A_D565_Opaque function in external/skia/src/core/
> SkBlitRow_D16.cpp has one implementation
> 2) scanline_t32cbl6blend function in system/core/libpixelflinger/
> scanline.cpp has another implementation
>
> Both implementations look different. Please help me understand the
> rationale behind these algorithms and the reason for having two
> different implementations/algorithms.
>
> >
>


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

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

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



[android-developers] Re: How to share files & shareUserId

2009-07-15 Thread Dianne Hackborn
When two applications shared the same user ID, they well have the same
identity.  They are indistinguishable as far as all permissions checks (both
on the filesystem and through IPC calls) go.

On Tue, Jul 14, 2009 at 12:02 PM, Aiili  wrote:

>
> Hi,
>
> I’m questioning about the shareUserId property and the best approach
> to share files among applications (around 1Mo compressed).
>
> More particularly, I’m interested to know what types of files are
> covered with this flag, and which use cases are supported?
> For example, does this flag allow an application M to access a file of
> an application A:
>
> -   located among its source code (i.e. that can be access from the
> latter with getClass().getResourceAsStream(name) code) ?
> -   located in its res/raw directory (i.e. that can be access from the
> latter with the getResources().openRawResource(getResources
> ().getIndentifier(name, type, package)).
> -   located in its assets directory
> -   located anywhere else (to be determined)
>
> In fact, even if the activity M is started by the activity A, the use
> of the extras of the Intent is not acceptable because of the size of
> the files.
>
> Finally, I read that another way to share files is to use a
> specialization of the class android.content.ContentProvider. Using
> this class with the appropriate permissions (Is it the shareUserId
> property?), would allow the application A to copy all its resource
> files into a directory (with the Uri: content://) and thus access them
> from M. But this approach would result in duplicating those resources
> files. So, is there a way to avoid this?
>
> Thanks for your 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: how to find out the percentage of memory used by each process in the android

2009-07-15 Thread Dianne Hackborn
There is lots of memory sharing between processes, so this is actually a
really hard thing to determine.  For development purposes, the "procrank"
command is the most common tool to use.  The last two columns of memory
usage are the most interesting ones: the last one is the memory owned
exclusively by that process, and the second to the last is that plus the
shared memory weighted by how many processes are sharing each page.

Note that this command is not part of the SDK, and for format of its output
tends to change, so it should only be used for development purposes.

For even more detail specifically about Java processes, you can use "adb
shell dumpsys memoryinfo"

On Wed, Jul 15, 2009 at 3:45 AM, arvind  wrote:

>
> Hi all,
>
> I want to calculate the performance for some of the task/process.
>
> How to find out the percentage of memory used by each process in the
> android.
> - is there any in build class\process to do this?
>
>
> Thanks and 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: frame buffer in Android

2009-07-15 Thread Dianne Hackborn
Sorry, no.

On Tue, Jul 14, 2009 at 6:16 PM, yosemite  wrote:

>
> Hi,
>
> In Linux, we can get the framebuffer directly by
> "open("/dev/fb0", O_RDWR);"
>
> Is there any way I can call the similar fuction via JNI in Android or
> how can I access the frame buffer directly in Android?
>
> Thanks.
>
> -M
>
> >
>


-- 
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: File Browser Integration

2009-07-15 Thread Dianne Hackborn
Hi Peli, maybe it's already done, but have you considered having this
support GET_CONTENT so that apps can just use the normal GET_CONTENT to have
the user select some data, and your file browser would then be one of the
options?

On Wed, Jul 15, 2009 at 8:36 AM, Peli  wrote:

>
> There is no need to literally copy source code into your project.
> You can use intents to integrate a 3rd party file browser with your
> application, as described here:
> http://www.openintents.org/en/node/159
> see section "Information for developers"
>
> Peli
> www.openintents.org
>
> On Jul 14, 8:20 pm, johnny  wrote:
> > Hi,
> >
> > I want to integrate a file browser with my application. Does anyone
> > know where I could get the source code for a pretty good file browser?
> > (With the developer's permission of course). The more, the better...
> >
> > 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: Build Contact "Stand Alone" apk - from Android Contact Source Code?

2009-07-15 Thread Mark Murphy

Shibbs wrote:
> One final query, if I pursue the above mentioned course & improve the
> build-in contacts app, then would I be able to build (make) the
> improved contacts source code & get a Contacts.apk. If yes, then can I
> distribute it as normal android app, which would run on any android
> device?
> 
> Or would it be tightly coupled with the below android firmware & could
> be distributed only along with the system.img

That would be a much better question to ask over on one of the open
source project's lists:

http://source.android.com/discuss

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

Warescription: Three Android Books, Plus Updates, $35/Year

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



[android-developers] Re: Build Contact "Stand Alone" apk - from Android Contact Source Code?

2009-07-15 Thread Shibbs

Mark wrote:
> Your work will probably still be valued in improving the built-in
> Android Contacts application, if you wish to pursue that course.

Cool, that sounds encouraging.

One final query, if I pursue the above mentioned course & improve the
build-in contacts app, then would I be able to build (make) the
improved contacts source code & get a Contacts.apk. If yes, then can I
distribute it as normal android app, which would run on any android
device?

Or would it be tightly coupled with the below android firmware & could
be distributed only along with the system.img


Ideally, this is what I am trying to do - Extend the existing contacts
app add additional feature make an improved Contacts.apk & release it
in the android market.

what say, possible?


Thanks for all your time.


- Shibbs

On Jul 15, 9:15 pm, Mark Murphy  wrote:
> Shibbs wrote:
> > Ah sad ending to our over enthu project:
>
> > For the past few days, I have been searching like mad, like many other
> > developers from past who were trying to achieve something similar.
> > But, it was not very clear that we won't be able to do, with all
> > respect to your below comment I am stopping further development in
> > this regard.
>
> Your work will probably still be valued in improving the built-in
> Android Contacts application, if you wish to pursue that course.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] broadcast intent when latitude locates the phone

2009-07-15 Thread Carl H.

Hello,

I don't believe there is any broadcast of intent for when latitude
locates the phone. Can this be confirmed?

I wish to have a receiver against latitude (instead of generic
location). Can this be achieved?

Thanks,
Carl
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Any updates on ADC-2?

2009-07-15 Thread Maps.Huge.Info (Maps API Guru)

Looks like the app has to be written with the SDK. See the official
terms and conditions for the exact wording.

My application works only in the US, I wonder if that will doom it's
possibilities? Someone who judges the app in Europe will rate it a fat
zero.

-John Coryat
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: ListActivity + CheckBox = bug ?

2009-07-15 Thread Mark Murphy

As Romain Guy pointed out, if you use choiceMode, Android *will* track
the checkbox states for you...but only if you have one checkbox per row.
I believe you indicated you had two, which is why I didn't suggest that
originally.

> what i don't understand through is that each checkbox have it's own
> checked value wich should be used by android when repaint is
> called ...

Why would it? Remember that Android is extensible, and there is no way
for Android to know which widgets have state that would need to be
persisted, or how necessarily to persist it. Only if *Android* is
putting the checkbox there (e.g., choiceMode) is it Android's
responsibility to track state -- if you put it there, it is your
responsibility.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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



[android-developers] Re: Adding new format to OpenCore

2009-07-15 Thread Marco Nelissen

You should post this in android-platform instead of android-developers



On Tue, Jul 14, 2009 at 12:07 PM, borhe wrote:
>
> Hi!
> I am trying to add flash (flv) support to openCORE, i found some hints
> in this forum but still there are many things that unclear.
> I would like in the beginning to play local .flv file,from SDCARD,
> without streaming.
> As i understand i need to implement Parser within fileformats, "parser
> node" and "recognizer" and register it with player engine, and of
> cause add h.263 Sorenson codec.
> Can someone point me to the information on the data flow from the main
> Player Engine to the "parser node", what API is used,? How will
> "parser node" send the data to the Codec Engine?
> Which parts will i have to add to enable streaming later?
>
> I also looked inside the documentation within opencore but did not
> find relevant information, perhaps i missed something and someone can
> point me to where should i look.
>
> Regards,
> Boris
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
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: Build Contact "Stand Alone" apk - from Android Contact Source Code?

2009-07-15 Thread Mark Murphy

Shibbs wrote:
> Ah sad ending to our over enthu project:
> 
> For the past few days, I have been searching like mad, like many other
> developers from past who were trying to achieve something similar.
> But, it was not very clear that we won't be able to do, with all
> respect to your below comment I am stopping further development in
> this regard.

Your work will probably still be valued in improving the built-in
Android Contacts application, if you wish to pursue that course.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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



[android-developers] Re: ListActivity + CheckBox = bug ?

2009-07-15 Thread Maisonobe.A (MaaKs)

ok i'll try that out , thank you very much !!

what i don't understand through is that each checkbox have it's own
checked value wich should be used by android when repaint is
called ...

cheers


On Jul 15, 5:58 pm, Mark Murphy  wrote:
> Maisonobe.A (MaaKs) wrote:
> > here is an issue that drives me crazy :
>
> > I have a simple class that extends list activity , for each contact i
> > have in my phone
> > it adds a line to the list containing two checkboxes .
> > It seems to work  but when you check for example the first checkbox ,
> > and then you scroll the list down
> > , some other contacts will be checked too like they are linked the one
> > to the others.
> > I simplified the code to the extrem minimum and i still have the same
> > bug . here is the code , if someone know how to deal with that it
> > would be really nice i spend half the day to try to find a solution to
> > that .
>
> You are not holding onto the checkbox states anywhere.
>
> Rows in a ListView usually get recycled, meaning that when you scroll,
> Android does not create a brand-new row, but rather updates an existing
> row with new data. Since you are not doing anything to manage the
> contents of your checkboxes, Android is ignoring them, giving you the
> random checked effect you are seeing.
>
> If you are going to put stateful widgets in list rows, like checkboxes
> or RatingBar, you need to track those values and set/reset them yourself.
>
> Here is an excerpt from _The Busy Coder's Guide to Android Development_
> that covers this, though bear in mind that it uses RatingBar where you
> will need to use checkboxes:
>
> http://commonsware.com/Android/excerpt.pdf
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_
> Version 0.9 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] Re: WebView and HTTP Post requests

2009-07-15 Thread Mark Murphy

DGupta wrote:
> So I'm attempting to connect to the Tumblr Dashboard using an HTTP
> Post. The Activity uses a WebView and I do an http post after creating
> the webview, but the redirect_to in the HTTP Post doesn't work with
> the WebView. I know my post works and isn't throwing errors, however I
> need the HTTP Post to work with the webview and am completely lost on
> how to.

HttpClient and WebView are completely separate engines. Operations done
in one will not affect the other.

If the Tumblr POST is setting a session cookie or something, you may be
able to get that out of the HttpClient cookie jar and feed it to
WebView, but I have not tried that.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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



[android-developers] Re: Build Contact "Stand Alone" apk - from Android Contact Source Code?

2009-07-15 Thread Shibbs

Ah sad ending to our over enthu project:

For the past few days, I have been searching like mad, like many other
developers from past who were trying to achieve something similar.
But, it was not very clear that we won't be able to do, with all
respect to your below comment I am stopping further development in
this regard.

Thanks once again!

- Shibbs

On Jul 15, 8:37 pm, Mark Murphy  wrote:
> Shibbs wrote:
> > As suggested, If i remove all the internal api calls (mentioned in my
> > previous mail), I may have to compromise / even break some of the
> > functionality of Contacts app.
>
> Correct.
>
> > I am trying to add more features to the existing contacts app, without
> > loosing any of existing contacts functionality. Is it possible?
>
> Not without changes to the firmware to make the missing classes become
> part of the SDK.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_
> Version 0.9 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
-~--~~~~--~~--~--~---



  1   2   >