[android-developers] Re: how to use preferences widgets together.

2009-08-06 Thread ANKIT SOMANI
Or how can we use the preferences inside the Layout. ?


Regards
~Ankit Somani



2009/8/6 ANKIT SOMANI ankitsomani...@gmail.com

 Hi,

 Can any body know how we can use the preference  widgets together .

 I want to use preferences to show like a list  want to show buttons at the
 bottom of similar screen. ?


 Please Help.


 Regards
 ~Ankit Somani



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



[android-developers] BitmapFactory decodeByteArray RGB565 format

2009-08-06 Thread newra...@gmail.com

In a byte[], I am having the image data of a RGB565 image(no header,
only image content)

I used the decodeByteArray with Bitmap.Options as RGB565 decoder.

But the decoding process failed.

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



[android-developers] Re: China to have there own Android Market?

2009-08-06 Thread Kaj Bjurman

I'm not a lawyer, but I can't see that it in any way restricts your
rights on distributing it through other channels than the Android
Market. The agreement does also say this:

2.1This Android Market Developer Distribution Agreement
(“Agreement”) forms a legally binding contract between you and Google
in relation to your use of the Market to distribute Products. In order
to use the Market to distribute Products, you must first agree to this
Agreement by clicking to accept where this option is made available to
you. You may not distribute Products on the Market if you do not
accept this Agreement.

So the document is about your usage of Android Market as far as I can
see.


On 6 Aug, 07:27, CraigsRace craig...@gmail.com wrote:
  As far as I know .. NetDragon is an evil company..

 Really, why do you say that?  I googled them, Electronic Arts are
 working with them.  They pulled in $595 million last year.
 Having said that, I don't want to be the ginny pig.  I'd much prefer
 to know that somebody else knows something about this separate Chinese
 Android Market.

  OpHone Sdk is Android 1.0 you have to port it to Android  1.0 for it work

 I asked them about the OPhone SDK only working on 1.1, no response.

  Do you have any agreement with Google that says that you can't do this?

 Who knows, I'd need a lawyer to understand all of the Google
 Agreement:  http://www.android.com/us/developer-distribution-agreement.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: Add menu item to Gallery's share BY CODE

2009-08-06 Thread Anthony Xu

Thank you, Dianne.
Your reply is very helpful.


On Aug 4, 11:48 am, Dianne Hackborn hack...@android.com wrote:
 Sorry, this can only be done by a manifest declaration.  You can, however,
 enable or disable the component declared in your manifest at runtime using
 the PackageManager class.



 On Mon, Aug 3, 2009 at 8:40 PM, Anthony Xu xjh2...@gmail.com wrote:

  Cannot implement it?

  On Aug 1, 12:18 pm, Anthony Xu xjh2...@gmail.com wrote:
   Hi All,

   I must to new a thread.

   I know how to implement this issue by Menuifest.xml, see also:
 http://groups.google.com/group/android-developers/browse_thread/threa...

   But my question is how to add share menu ofGalleryby java code not
   Menuifest.xml.
   My code is as below:

   public class MyActivity extends Activity {

   private static final String TAG = MyActivity;

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

       IntentFilter intentFilter = new IntentFilter();
       intentFilter.addAction(Intent.ACTION_SEND);
       intentFilter.addCategory(Intent.CATEGORY_DEFAULT);
       try {
                   intentFilter.addDataType(image/*);
           } catch (MalformedMimeTypeException e) {
                   Log.e(TAG, e.toString());
           }

       Intent x = registerReceiver(new BroadcastReceiver() {
           public void onReceive(Context context, Intent intent) {
                   Log.d(TAG, Received intent +intent);
                   intent.setComponent(new ComponentName(context,
   Uploader.class));
                   startActivity(intent);
           }
           }, intentFilter);

       if (x==null)
           Log.i(TAG, failed to regist a receiver);
       else
           Log.i(TAG, registed a receiver successfully);
       // ...

   But registerReceiver always return null, and there is no menu added
  toGallery'sShare.

   Thank you.
   Anthony

 --
 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] Memory problem

2009-08-06 Thread Rahul

Hi all

i have one big problem in android due to this my application crashesh
every time

My Problem are

1. Bitmap memory exceed error
2. Out of memory error

somebody pls help me to solve this problem.

thanks
Ranjit




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Memory problem

2009-08-06 Thread Romain Guy

Either your application is leaking memory or you are just using too
much memory. Use less memory.

On Wed, Aug 5, 2009 at 11:41 PM, Rahulnakate.ra...@gmail.com wrote:

 Hi all

 i have one big problem in android due to this my application crashesh
 every time

 My Problem are

 1. Bitmap memory exceed error
 2. Out of memory error

 somebody pls help me to solve this problem.

 thanks
 Ranjit




 




-- 
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] can execute my app automatilly when android is up?

2009-08-06 Thread tstanly

hi all,

I want to change the start point of my machine,
that is,when start on Android,
it can run my app instead of home firstly,

if it possiable?


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] UI Development in Android

2009-08-06 Thread swapnil

Hello all,

I am working on UI Development in Android .

Can any one please tell me how I can put multiple layouts on the
screen at specific positions?

Is it ok that i can use the code instead of xml file for creating the
UI?

If any one has any links for UI development please give those too..


Thanks in advance,

Regards;

Swapnil Dalal.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: UI Development in Android

2009-08-06 Thread Michael Leung
yes. I used the code to do that.

On Thu, Aug 6, 2009 at 4:48 PM, swapnil swapnil.da...@gmail.com wrote:


 Hello all,

 I am working on UI Development in Android .

 Can any one please tell me how I can put multiple layouts on the
 screen at specific positions?

 Is it ok that i can use the code instead of xml file for creating the
 UI?

 If any one has any links for UI development please give those too..


 Thanks in advance,

 Regards;

 Swapnil Dalal.

 



-- 
Regards,
Michael Leung
http://www.itblogs.info
http://www.michaelleung.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Forcing an activity to reload completely?

2009-08-06 Thread Ronald Pompa

I figured a way to reload the activities. simply call this.onCreate
(null); to reload the current activity.

For example if you have a hierarchy like me: MainActivity -
PreferenceActivity and make a change in preferences, i listen for a
change and with onSharedPreferenceChanged and call this.onCreate
(null). When we go back, we need to reload the MainActivity, onResume
() will be called so we put this.onCreate(null) there too and that
should be enough.

It works for my solution for changing the locale for the application.

Hope it helps!

// Ronald

On Jul 19, 1:24 pm, Anders Aagaard aagaa...@gmail.com wrote:
 Hi

 I have an application, where I need to change the language through a
 settings menu.  Now this part works perfectly, but it doesn't change
 the language for activities that have gone through onCreate.

 I got a TabHost, and 2 tabs in it, from the tabs you can get to
 settings.

 Refreshing the TabHost isn't an issue, as it's fairly small, however
 both the 2 tabs are quite large views, and having a function to
 manually update all the strings seem unnecessarily difficult.  Is
 there any way to force theactivityto recreate itself and trigger a
 new onCreate?

 I tried having a static function in the tabhost that clears all tabs
 and recreates them, this refreshes the tab titles, but not the content
 in the tabs.

 Anders Aagaard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: record incoming and outgoing call

2009-08-06 Thread Michael Leung
I know that is possible track all incoming and outgoing call details. But
for voice, that is I am not sure/

On Thu, Aug 6, 2009 at 3:46 PM, Honest honestsucc...@gmail.com wrote:


 Hello,

 I want to record the outgoing and incoming call. Can some one tell me.
 Is it feasible or not ?
 



-- 
Regards,
Michael Leung
http://www.itblogs.info
http://www.michaelleung.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 data buffer pass by jni problem

2009-08-06 Thread frog

HI,fadden
I am very sorry.I don't know very well about jni,and I still don't
know the way to pass the data buffer
(point of void *)from native code to the android application.Could you
give me further explanation or give a example to do this.I have read
some document about jni,but it seems android's jni is difference with
stand java jni.so,I don't know how to to archive this without the
document.Thanks in advance.

2009/8/5 fadden fad...@android.com:

 Check the archives on the android-ndk list, e.g.:

  http://groups.google.com/group/android-ndk/browse_thread/thread/36a4d13cb0d4bc26#
  http://groups.google.com/group/android-ndk/browse_thread/thread/a610cfe73aa2618e/c27be634e3305304

 On Aug 4, 12:23 am, frog bluewater0...@gmail.com wrote:
 Hi,all
     Have some tryed to pas databuffer on android by jni?I have a
 native method like this:
 int foo(void * buffer,  //(out param) the point to the buffer
            int *buffersize  //(out param) the point to the buffer size
 {
     a = foo();
     b = foo1();
     return 0;}

 And I want to use it in android application to pass the buffer data to
 the application,How can I do this?
 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] How to wake up the device by Code?

2009-08-06 Thread guishenl...@gmail.com

Hi all,
I have an application with notification. I want my notification
can wake the device up when it goes off but the device is asleep.
Could anybody tell me how to do by some code?
Thank you 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: can execute my app automatilly when android is up?

2009-08-06 Thread brian.schimmel

I think home is not the first application that is started, but it is
the first visible one. So you have two options:

1. Your application can replace the home screen, but then it should do
everything that a home screen does. You have to declare an
IntentFilter with the Home category, see
http://developer.android.com/reference/android/content/Intent.html#CATEGORY_HOME

2. You can register your app to be executed on startup, additional to
home. There is a matching broadcast action decribed here:
http://developer.android.com/reference/android/content/Intent.html#ACTION_BOOT_COMPLETED

On 6 Aug., 08:43, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 I want to change the start point of my machine,
 that is,when start on Android,
 it can run my app instead of home firstly,

 if it possiable?

 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] /dev/mem open from opencore

2009-08-06 Thread scs

we are able to open the /dev but /dev/mem is failing.

/dev/mem is created using mknod...

Is there any probable with the perimission issues?
How do we solve the issue?

Please help us.

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



[android-developers] Will a notification still work if the device once shut down.

2009-08-06 Thread guishenl...@gmail.com

Hi all,
I have an application with notification. I want to keep the
notification working even if the device once shut down just like an
alarm. Could anyone give me some sample code to help me?
Thank you 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: can execute my app automatilly when android is up?

2009-08-06 Thread tstanly

thanks for your reply,

for your first point,
i try to do it by edit the AndroidManifesr.xml,

edit the intent-filter/ tag for...

intent-filter
 action android:name=andrroid.intent.action.MAIN /
 category android:name=android.intent.category.HOME /
/intent-filter


but not work?

thanks!

On 8月6日, 下午3時40分, brian.schimmel brian.schim...@googlemail.com
wrote:
 I think home is not the first application that is started, but it is
 the first visible one. So you have two options:

 1. Your application can replace the home screen, but then it should do
 everything that a home screen does. You have to declare an
 IntentFilter with the Home category, 
 seehttp://developer.android.com/reference/android/content/Intent.html#CA...

 2. You can register your app to be executed on startup, additional to
 home. There is a matching broadcast action decribed 
 here:http://developer.android.com/reference/android/content/Intent.html#AC...

 On 6 Aug., 08:43, tstanly tsai.sta...@gmail.com wrote:



  hi all,

  I want to change the start point of my machine,
  that is,when start on Android,
  it can run my app instead of home firstly,

  if it possiable?

  thanks!- 隱藏被引用文字 -

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



[android-developers] Re: Will a notification still work if the device once shut down.

2009-08-06 Thread peter

Set flag of Notification, there have sort of flag to let your
notification show

like this:Notification.flag = Notification.FLAG_AUTO_CANCEL

On Aug 6, 4:42 pm, guishenl...@gmail.com guishenl...@gmail.com
wrote:
 Hi all,
     I have an application with notification. I want to keep the
 notification working even if the device once shut down just like an
 alarm. Could anyone give me some sample code to help me?
 Thank you 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: UI Development in Android

2009-08-06 Thread peter

you should reference User-Interface document in android developer
website

On Aug 6, 2:48 pm, swapnil swapnil.da...@gmail.com wrote:
 Hello all,

 I am working on UI Development in Android .

 Can any one please tell me how I can put multiple layouts on the
 screen at specific positions?

 Is it ok that i can use the code instead of xml file for creating the
 UI?

 If any one has any links for UI development please give those too..

 Thanks in advance,

 Regards;

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



[android-developers] 如何取得动态gi f图片每一帧有多少个数据块?

2009-08-06 Thread xiaofeng

看了android  SkMovie_gif.cpp 对gif图片的解码,发现在解每一帧时是这样判断这一帧有没有解完:前面解析时得到了当前帧图
像的宽width,高height,imageSize=width*height,将imageSize 传进解码函数DGifGetLine
(GifFile, sp-RasterBits, ImageSize),当解码后的数剧量等于ImageSize时认为当前帧解码完成。这里用解
码后的数据量是否达到该帧解码为8位的RGB源数据总量来作为一帧解完的标志。我现在要把DGifGetLine(GifFile, sp-
RasterBits, ImageSize)去掉,只是用原来的控制信息,这样要知道流指针要偏移多少字节才取得到下一个控制块,所以要知道当前帧
数据块的个数.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can execute my app automatilly when android is up?

2009-08-06 Thread peter

you should register a broadcast receiver in your AndroidManifesr.xml
and set intent filter about mobile power on action

your class extends from BroadcastReceiver should fire up your activity
of application

On Aug 6, 4:46 pm, tstanly tsai.sta...@gmail.com wrote:
 thanks for your reply,

 for your first point,
 i try to do it by edit the AndroidManifesr.xml,

 edit the intent-filter/ tag for...

 intent-filter
  action android:name=andrroid.intent.action.MAIN /
  category android:name=android.intent.category.HOME /
 /intent-filter

 but not work?

 thanks!

 On 8月6日, 下午3時40分, brian.schimmel brian.schim...@googlemail.com
 wrote:

  I think home is not the first application that is started, but it is
  the first visible one. So you have two options:

  1. Your application can replace the home screen, but then it should do
  everything that a home screen does. You have to declare an
  IntentFilter with the Home category, 
  seehttp://developer.android.com/reference/android/content/Intent.html#CA...

  2. You can register your app to be executed on startup, additional to
  home. There is a matching broadcast action decribed 
  here:http://developer.android.com/reference/android/content/Intent.html#AC...

  On 6 Aug., 08:43, tstanly tsai.sta...@gmail.com wrote:

   hi all,

   I want to change the start point of my machine,
   that is,when start on Android,
   it can run my app instead of home firstly,

   if it possiable?

   thanks!- 隱藏被引用文字 -

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



[android-developers] Re: How to wake up the device by Code?

2009-08-06 Thread peter

I guess AlarmManager could do it for your requirement

On Aug 6, 3:29 pm, guishenl...@gmail.com guishenl...@gmail.com
wrote:
 Hi all,
     I have an application with notification. I want my notification
 can wake the device up when it goes off but the device is asleep.
 Could anybody tell me how to do by some code?
 Thank you 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: Memory problem

2009-08-06 Thread peter

Create a Bitmap is very consume memory

On Aug 6, 2:41 pm, Rahul nakate.ra...@gmail.com wrote:
 Hi all

 i have one big problem in android due to this my application crashesh
 every time

 My Problem are

 1. Bitmap memory exceed error
 2. Out of memory error

 somebody pls help me to solve this problem.

 thanks
 Ranjit
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 wake up the device by Code?

2009-08-06 Thread Anonymous Anonymous
http://developer.android.com/reference/android/os/PowerManager.html

On Thu, Aug 6, 2009 at 2:24 PM, peter heywoodpres...@gmail.com wrote:


 I guess AlarmManager could do it for your requirement

 On Aug 6, 3:29 pm, guishenl...@gmail.com guishenl...@gmail.com
 wrote:
  Hi all,
  I have an application with notification. I want my notification
  can wake the device up when it goes off but the device is asleep.
  Could anybody tell me how to do by some code?
  Thank you 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] How to Access SharedPreferences created file?

2009-08-06 Thread Prajkti

Hi all,
I am using SharedPreferences to save my ApplicationSettings.
and through DDMS-FileExplorer i can see the Settings file created as
data\data\packgename\shared_prefs\AppSettings.xml
Now i want to copy this file and move it into Another location say
SDCard.

Is there any way to achieve this??

Can i access that AppSettings.xml file through some System level Code
written in C?

Can anyone please please 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: record incoming and outgoing call

2009-08-06 Thread peter

I'm not sure how capture incoming voice, have any function to do it?

but i think you could capture voice from people who talk to the phone
with voice record

On Aug 6, 1:46 pm, Honest honestsucc...@gmail.com wrote:
 Hello,

 I want to record the outgoing and incoming call. Can some one tell me.
 Is it feasible or not ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to use preferences widgets together.

2009-08-06 Thread peter

Create a class extends View or SurfaceView.

you should reference User Interface-Building Custom Componment on
developer of android website

On Aug 6, 1:34 pm, ANKIT SOMANI ankitsomani...@gmail.com wrote:
 Hi,

 Can any body know how we can use the preference  widgets together .

 I want to use preferences to show like a list  want to show buttons at the
 bottom of similar screen. ?

 Please Help.

 Regards
 ~Ankit Somani
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: clear sms notifications

2009-08-06 Thread Falko Richter
So when we use SMS as a way of communication there is no way we keep the
user from being notified. Deleting the Messages is no Problem apparently..
thx for the quick answer

Falko

On Wed, Aug 5, 2009 at 1:21 PM, Mark Murphy mmur...@commonsware.com wrote:


 Falko Richter wrote:
  *NotificationManager nm =
  (NotificationManager)getSystemService(NOTIFICATION_SERVICE);*
  *nm.cancelAll();*
  *
  *
  should do the trick, deleting all notifications, but nothing happens.
 
  how can I really delete the notifications?

 AFAIK, you can't remove those notifications, since you did not raise them.

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

 Looking for Android opportunities? 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: Listing Console does not update applicaitons statistics

2009-08-06 Thread DKIT

Still no update.

On Aug 4, 7:40 pm, DKIT dag.kristian...@gmail.com wrote:
 Anyone?

 On Aug 4, 4:18 pm, DKIT dag.kristian...@gmail.com wrote:

  My Android Market listing console (developer console) has not updatet
  applicaiton statistics for several days.

  Why?

  Does it hurt my popularity ratings that my statistics are not updated?

  When will this be fixed? It is very annoying!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: record incoming and outgoing call

2009-08-06 Thread Honest

Thanks peter for your reply. Can you tell me how can i capture voice
from people who talk on phone with voice command ? . Can you give me
any code snippt  or API link to read it ?

On Aug 6, 2:17 pm, peter heywoodpres...@gmail.com wrote:
 I'm not sure how capture incoming voice, have any function to do it?

 but i think you could capture voice from people who talk to the phone
 with voice record

 On Aug 6, 1:46 pm, Honest honestsucc...@gmail.com wrote:



  Hello,

  I want to record the outgoing and incoming call. Can some one tell me.
  Is it feasible or not ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 access several xml views in my activity?

2009-08-06 Thread zeeshan

Hi Dear,

i have created some xml layout:
1- toplayout.xml
2- botlayout.cml
3- middlelayout.xml

now i can only set one view as in setContentView(R.layout.toplayout);

please advise how can i show all three views in my activity?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 access several xml views in my activity?

2009-08-06 Thread Sujay Krishna Suresh
Make use of the layout that best suits ur app...
Make use of findViewByID to get ur xml's as views n layout them..
Then setContentView(ur Layout);

On Thu, Aug 6, 2009 at 4:18 PM, zeeshan genx...@gmail.com wrote:


 Hi Dear,

 i have created some xml layout:
 1- toplayout.xml
 2- botlayout.cml
 3- middlelayout.xml

 now i can only set one view as in setContentView(R.layout.toplayout);

 please advise how can i show all three views in my activity?


 



-- 
Regards,
Sujay
Marie von 
Ebner-Eschenbachhttp://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html
- Even a stopped clock is right twice a day.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Memory problem

2009-08-06 Thread for android
How is the FasterBitMapDrawable in the Shelves different from normal
BitmapDrawable?

On Thu, Aug 6, 2009 at 2:38 PM, peter heywoodpres...@gmail.com wrote:


 Create a Bitmap is very consume memory

 On Aug 6, 2:41 pm, Rahul nakate.ra...@gmail.com wrote:
  Hi all
 
  i have one big problem in android due to this my application crashesh
  every time
 
  My Problem are
 
  1. Bitmap memory exceed error
  2. Out of memory error
 
  somebody pls help me to solve this problem.
 
  thanks
  Ranjit
 


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



[android-developers] USB communication

2009-08-06 Thread Honest

Hello,

I want to do USB communication in android. Can some one give me some
links to starat with it,.Any code snippt will be much appreciated.

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



[android-developers] ImageView setImageResource

2009-08-06 Thread Saurav Mukherjee
can anyone please tell me that does setImageResource() in ImageView also
draws the image instantly on the screen or does it require any other
function call? i need to display the image as soon as i set the resource.
please 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] Re: Crashing compasse

2009-08-06 Thread Declan

Thanks for the help, I got this from eclips, hope it's right.
[2009-08-06 12:01:43 - North] Starting activity
com.example.North.North on device
[2009-08-06 12:01:47 - North] ActivityManager: DDM dispatch reg wait
timeout
[2009-08-06 12:01:47 - North] ActivityManager: Can't dispatch DDM
chunk 52454151: no handler defined
[2009-08-06 12:01:48 - North] ActivityManager: Starting: Intent { comp=
{com.example.North/com.example.North.North} }



On Aug 5, 3:10 pm, Mark Murphy mmur...@commonsware.com wrote:
 Declan wrote:
  Hi guys,
  I'm trying to get an app to vibrate whenever it points in a spacific
  Direction.

 Bear in mind that the vibration will probably cause your compass
 direction to shift.

  I'm trying to use some code from the API demo to do this, and I got it
  working in the API deom.
  But when I try to take it out inot a stand alone app without the
  graphic it crashes when pointing in the direction.  Here's teh entire
  program, any ideas?

 Look at your Java stack trace to see where your problem is. You can get
 the Java stack trace via adb logcat, DDMS, or the DDMS perspective in
 Eclipse.

 --
 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: Crashing compasse

2009-08-06 Thread Mark Murphy

Declan wrote:
 Thanks for the help, I got this from eclips, hope it's right.
 [2009-08-06 12:01:43 - North] Starting activity
 com.example.North.North on device
 [2009-08-06 12:01:47 - North] ActivityManager: DDM dispatch reg wait
 timeout
 [2009-08-06 12:01:47 - North] ActivityManager: Can't dispatch DDM
 chunk 52454151: no handler defined
 [2009-08-06 12:01:48 - North] ActivityManager: Starting: Intent { comp=
 {com.example.North/com.example.North.North} }

I have no idea if it is right, but it is not a Java stack trace
showing where your application is crashing.

A stack trace might look like:

java.io.FileNotFoundException: fred.txt
at java.io.FileInputStream.init(FileInputStream.java)
at java.io.FileInputStream.init(FileInputStream.java)
at ExTest.readMyFile(ExTest.java:19)
at ExTest.main(ExTest.java:7)

(from http://www.devdaily.com/java/edu/pj/pj010009/pj010009.shtml)

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

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

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



[android-developers] Re: ImageView setImageResource

2009-08-06 Thread Mark Murphy

Saurav Mukherjee wrote:
 can anyone please tell me that does setImageResource() in ImageView also
 draws the image instantly on the screen or does it require any other
 function call? i need to display the image as soon as i set the resource.

The change will take effect as soon as you give control back to Android
so it can continue processing the message loop. So, for example, if you
call setImageResource() in the onClick() handler of a Button, the change
will not take effect until sometime shortly after you return from onClick().

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

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

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



[android-developers] Re: VerifyError while trying to run Unit tests

2009-08-06 Thread Alex G

Just in case anyone else wanders across this post, I found some info
on project setup her:
http://stackoverflow.com/questions/468220/how-do-you-run-android-instrumentation-tests-from-eclipse

On Aug 5, 11:33 pm, Alex G quixop...@googlemail.com wrote:
 okay that makes sense, thankyou. I've been googling for a while and I
 can't really find any good resources on how to setup as a single
 project, everyone is using the standard two projects, can anyone point
 me to something?

 I'm still finding it hard to believe that theres no way to share the
 code across the two projects, I've tried making the third party jar a
 required export in the project I am testing but I still get the same
 error.

 Cheers

 On Aug 5, 6:57 pm, fadden fad...@android.com wrote:

  On Aug 5, 10:11 am, Alex G quixop...@googlemail.com wrote:

   Thanks, I'll give that a try. Is it only the case that you need a
   single project if you have a third party library? The reason I ask is
   that all of the blogs and discussions I have found about unit testing
   have advocated using two projects.

  Having two copies of the same class will sometimes cause you grief.
  dexopt does various optimizations with the copy it finds, so if you
  manage to use a different copy at run time the VM will throw an
  exception (the optimizations can't be re-done on the fly to factor in
  differences between the two versions of the class).


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



[android-developers] AppWigets into Applications

2009-08-06 Thread mtd

Hi,
  I am trying to create an application that contains AppWidgets, but
only get to show the original layout of the same, unable to interact
with them. The main steps that I followed are:


AppWidgetManager mAppWidgetManager = 
AppWidgetManager.getInstance
(this);

AppWidgetHost mAppWidgetHost = new AppWidgetHost(this, hostId);

appWidgetId = mAppWidgetHost.allocateAppWidgetId();

// i is an integer used to specify the widget I want to insert

AppWidgetHostView appWidgetHostView = mAppWidgetHost.createView(this,
appWidgetId, appWidgetProviderInfo.get(i));

appWidgetHostView.setAppWidget(appWidgetId,
(AppWidgetProviderInfo) 
appWidgetProviderInfo.get(i));

 And then insert the appWidgetHostView into my application layout.Has
anyone managed to enter AppWidgets into their applications and can
tell me what I'm doing wrong?

Thank you very much



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



[android-developers] Re: ImageView setImageResource

2009-08-06 Thread Saurav Mukherjee
i got a hint of that while i was trying hard to get it. Thank you Mark for
the early reply. Just one more query, will it be the same if i set the
Background of the view or will it just depend on the invalidate() call?

On Thu, Aug 6, 2009 at 4:55 PM, Mark Murphy mmur...@commonsware.com wrote:


 Saurav Mukherjee wrote:
  can anyone please tell me that does setImageResource() in ImageView also
  draws the image instantly on the screen or does it require any other
  function call? i need to display the image as soon as i set the resource.

 The change will take effect as soon as you give control back to Android
 so it can continue processing the message loop. So, for example, if you
 call setImageResource() in the onClick() handler of a Button, the change
 will not take effect until sometime shortly after you return from
 onClick().

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

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

 


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



[android-developers] webview don't scroll up

2009-08-06 Thread Sikus

Hi,
I have application which show information on WebView. I use javascript
and link too etc. a href=\#\ onclick=\prompt(' something ');
\
My problem: when I click on link page scroll up. I don't wont it. I
can that page stay on the same place.
Can you help me, please?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Several instance of AsynkTask

2009-08-06 Thread ioRek

Hi there,
At the moment I have an AsyncTask downloading bitmaps and display on a
grid.
The fact is I need an other instance of the Task with a different
paramater to download different bitmap.

When I look the list of thread it appears that only one thread is
launched and I dont have 2 async task but 1 which start downloading
after the other.

Am I missing something ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 stop service?

2009-08-06 Thread Archana

Hi ,

 How can we stop Service.I tried put it in both  onstop and ondestroy()
method.While exiting It is calling this method but service still
running background.Whether i am doing anything wrong?

private static Intent serviceIntent ;

protected void onCreate() {
serviceIntent = new Intent(this, LocalService.class);
startService(serviceIntent);
}
@Override
protected void onStop() {
// TODO Auto-generated method stub
super.onStop();
Log.e(CallingOnStop, OnStop);
stopService(serviceIntent);
}

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Log.e(CallingOnDEstroy, OnDestroy);
stopService(serviceIntent);
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 stop service?

2009-08-06 Thread Desu Vinod Kumar
HI

@Override protected void onDestroy() {
  super.onDestroy();

  _shutdownService();

  if (MAIN_ACTIVITY != null) AppUtils.showToastShort(MAIN_ACTIVITY,
MyService stopped);

}

U can check here .for starting and stopping the service tutorial
is there with good example

http://developerlife.com/tutorials/?p=356



On Thu, Aug 6, 2009 at 6:00 PM, Archana archana.14n...@gmail.com wrote:


 Hi ,

  How can we stop Service.I tried put it in both  onstop and ondestroy()
 method.While exiting It is calling this method but service still
 running background.Whether i am doing anything wrong?

 private static Intent serviceIntent ;

 protected void onCreate() {
 serviceIntent = new Intent(this, LocalService.class);
startService(serviceIntent);
 }
 @Override
protected void onStop() {
// TODO Auto-generated method stub
super.onStop();
Log.e(CallingOnStop, OnStop);
stopService(serviceIntent);
}

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Log.e(CallingOnDEstroy, OnDestroy);
stopService(serviceIntent);
}
 



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

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



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

2009-08-06 Thread TaoK

Hi Johan,

I was able to make the device show in fastboot mode in windows, doing
the same as above, adding extra device IDs into the usb driver INF
file - it's just that fastboot mode has YET ANOTHER device ID, so when
the device is in fastboot mode windows shows you the new hardware
wizard, you need to very quickly get the wizard to install the driver
with the modified INF file, then probably wait for your phone to boot
up, shut it down again, and turn it on in fastboot mode again.

The extra lines in the INF file are as follows:

; Around line 55, after the existing Sansung entries:
%USB\VID_18D1PID_D00D.DeviceDescRelease%=androidusb.Dev, USB
\VID_18D1PID_D00D
; Around line 129, after the other existing Samsung entries:
USB\VID_18D1PID_D00D.DeviceDescRelease=SAMSUNG GALAXY Fast Booter

When you do all this, the strange thing is that fastboot devices
shows the device as a question mark. To prove that it's working you
need to (for example) run fastboot getvar version, which will
accurately respond 0.5 and thereby confirm the device is connected.

With that I was able to root the device with the instructions provided
at android.hdblog.it:
http://forum.hdblog.it/showthread.php?t=3926

And do a backup after providing the further instructions to get
nandroid going in recovery mode:
http://forum.hdblog.it/showthread.php?t=3995

But I must admit I haven't yet had the guts to try restoring a
nandroid backup...

Good luck!
Tao

On Jul 31, 5:51 am, Johan phet...@gmail.com wrote:
 Just one question, has anyone successfully gotten fastboot devices
 to show anything in windows (during the tiny time-frame that the phone
 actually is in fastboot mode)?

 I only got it to work on my Mac and have heard people doing it using
 different Linux dists, but never Windows :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] Re: OpenGL leaking garbage

2009-08-06 Thread Jack Palevich

Woops -- I left out a very important detail: Direct Buffers are only
required for OpenGL ES APIs that hold onto the pointer that you pass
into the API. APIs that operate on buffers immediately can take either
direct or indirect buffers.

So, for example glVertexPointer requires a Direct buffer because it
holds onto a pointer to the buffer until you call glVertexPointer with
a different buffer. All the glXXXPointer APIs are like this.

On the other hand, an API like glBufferData uses its buffer data
immediately. So it's fine to use an indirect buffer with glBufferData.

On Aug 5, 12:14 pm, Jack Palevich jack.palev...@gmail.com wrote:
 Hi -- I work on the Java Open GL ES bindings for Android. Fadden asked
 me to chime in here.

 Please don't use indirect buffers with OpenGL ES -- indirect buffers
 are not supported, and your code will break, both on current and
 especially on future versions of Android.

 Let me see if I can explain what's going on:

 (In my message below I'm going to use the code-name Cupcake for the
 current Android release and the code-name Donut for the upcoming
 release.)

 There are several bugs in the way Android currently handles
 java.nio.Buffer objects passed to OpenGL ES APIs:

 1) In all releases up to and including Cupcake, the implementation
 allocates PlatformAddress objects every time a direct buffer's base
 address is calculated. (In other words, when any glXXXPointer function
 is called.) This leads to garbage collections, even in programs that
 don't appear at the API level to be allocating any new objects. (You
 can use a heap analysis tools to watch these PlatformAddress objects
 being created.)

 2) The OpenGL ES APIs that take buffers are only supposed to take
 direct buffers, but this runtime check was accidentally omitted from
 all releases up to and including Cupcake. The problem with non-direct
 buffers is that their data can be moved by the Java runtime while the
 OpenGL driver is holding a pointer to them, which means that OpenGL
 driver ends up reading the wrong data, or even trying to read no-
 longer-allocated memory.

 To fix problem #2, the Donut system software release will start
 enforcing the direct buffer requirement. To keep existing, mostly-
 working OpenGL applications from breaking, we are going to add a
 compatibility shim in Donut: If your application is compiled against
 the Cupcake or earlier SDK, then we won't throw an exception if you
 use a non-direct buffer with OpenGL ES. You app will still suffer from
 the same occasionally crashes or renders incorrectly bug that it
 currently suffers from under Cupcake, but things won't be any worse.
 We will print out an error message to the log so at least you have a
 way of detecting that your app is using OpenGL incorrectly.

 If your application is compiled with the Donut SDK, it will throw a
 runtime exception if you try to use a non-direct buffer with an OpenGL
 ES API. (The reasoning is that if you are compiling using the Donut
 SDK, then you can take the time to fix your app.)

 OK, so what's a poor developer to do now, before the Donut system
 software?

 You could try using indirect buffers, in which case you will get code
 that doesn't GC very much, but also occasionally renders incorrectly
 or crashes. Or you can use direct buffers, and live with more GCs.

 I recommend using direct buffers, because I think it's better to have
 occasional GC hiccups than crashes. And once Donut is released the GC
 disadvantage should be fixed.

 On Aug 5, 11:01 am, fadden fad...@android.com wrote:

  On Aug 4, 11:09 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

   I've found a way to get rid of garbage collection!
   The receipt is simple (and ironic): do not use allocateDirect(), use
   allocate(). And use only ByteBuffer, not FloatBuffer, IntBuffer, etc.
   - using asFloatBuffer() on non-direct ByteBuffer will result in crash
   in libhgl. (I'm too lazy to create an issue for that.)

  I'm pretty sure this will break in the next release.  My (very
  limited) understanding is that direct buffers are supposed to be
  required, but Android wasn't enforcing their use.  This situation has
  been corrected.

  The allocations reduced by 8767 (earlier in the thread) were Harmony
  PlatformAddress objects, which are only associated with direct
  buffers.  So it makes sense that your change would cut the
  allocations; just be aware that it may stop working.

  (I'll ask one of the GL folks to check me on this.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: OpenGL leaking garbage

2009-08-06 Thread Jack Palevich

We considered doing that, but were worried about possible DalvikVM
problems with leaving large amounts of memory pinned for long time
periods. We decided it was better not to do that.

On Aug 5, 8:17 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:
 By the way, to guarantee that non-direct buffer will not be moved be
 GC one can hack up a JNI lib wich will 'pin' needed buffers for the
 lifetime of an application :)

 On 6 авг, 10:07, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

  Thank you Jack for your explanation.

  I am using VBOs now, so I can easily switch to direct buffers. By the
  way, what is the limit for VBO buffers? (if there is one)

  And one more thing. In my code I am drawing a 1008-vertex geometry
  using glDrawArrays(GL_TRIANGLES). Weird thing is that it draws model +
  garbage when I pass 1008 as 'count' argument to glDrawArrays, and
  draws correctly when I pass 1008/3. I believe 1008 is the correct
  value to pass, but it just not working that way. In many demos there
  are calls to glDrawArrays with GL_TRIANGLES, but they only draws few
  vertices (36 for example). I suspect my 1008 vertices (and normals) do
  not fit in some sort of cache, and code draws them differently, and
  somewhere it multiplies 'count' by 3 (hence drawing garbage when 1008
  is passed). This behaviour shows up on the emulator and the G1.
  (glDrawElements has the same behaviour when indices are simple array
  [0,count-1].)

  Dmitry

  On 6 авг, 02:14, Jack Palevich jack.palev...@gmail.com wrote:

   Hi -- I work on the Java Open GL ES bindings for Android. Fadden asked
   me to chime in here.

   Please don't use indirect buffers with OpenGL ES -- indirect buffers
   are not supported, and your code will break, both on current and
   especially on future versions of Android.

   Let me see if I can explain what's going on:

   (In my message below I'm going to use the code-name Cupcake for the
   current Android release and the code-name Donut for the upcoming
   release.)

   There are several bugs in the way Android currently handles
   java.nio.Buffer objects passed to OpenGL ES APIs:

   1) In all releases up to and including Cupcake, the implementation
   allocates PlatformAddress objects every time a direct buffer's base
   address is calculated. (In other words, when any glXXXPointer function
   is called.) This leads to garbage collections, even in programs that
   don't appear at the API level to be allocating any new objects. (You
   can use a heap analysis tools to watch these PlatformAddress objects
   being created.)

   2) The OpenGL ES APIs that take buffers are only supposed to take
   direct buffers, but this runtime check was accidentally omitted from
   all releases up to and including Cupcake. The problem with non-direct
   buffers is that their data can be moved by the Java runtime while the
   OpenGL driver is holding a pointer to them, which means that OpenGL
   driver ends up reading the wrong data, or even trying to read no-
   longer-allocated memory.

   To fix problem #2, the Donut system software release will start
   enforcing the direct buffer requirement. To keep existing, mostly-
   working OpenGL applications from breaking, we are going to add a
   compatibility shim in Donut: If your application is compiled against
   the Cupcake or earlier SDK, then we won't throw an exception if you
   use a non-direct buffer with OpenGL ES. You app will still suffer from
   the same occasionally crashes or renders incorrectly bug that it
   currently suffers from under Cupcake, but things won't be any worse.
   We will print out an error message to the log so at least you have a
   way of detecting that your app is using OpenGL incorrectly.

   If your application is compiled with the Donut SDK, it will throw a
   runtime exception if you try to use a non-direct buffer with an OpenGL
   ES API. (The reasoning is that if you are compiling using the Donut
   SDK, then you can take the time to fix your app.)

   OK, so what's a poor developer to do now, before the Donut system
   software?

   You could try using indirect buffers, in which case you will get code
   that doesn't GC very much, but also occasionally renders incorrectly
   or crashes. Or you can use direct buffers, and live with more GCs.

   I recommend using direct buffers, because I think it's better to have
   occasional GC hiccups than crashes. And once Donut is released the GC
   disadvantage should be fixed.

   On Aug 5, 11:01 am, fadden fad...@android.com wrote:

On Aug 4, 11:09 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

 I've found a way to get rid of garbage collection!
 The receipt is simple (and ironic): do not use allocateDirect(), use
 allocate(). And use only ByteBuffer, not FloatBuffer, IntBuffer, etc.
 - using asFloatBuffer() on non-direct ByteBuffer will result in crash
 in libhgl. (I'm too lazy to create an issue for that.)

I'm pretty sure this will break in the next release. 

[android-developers] Re: OpenGL leaking garbage

2009-08-06 Thread Jack Palevich

You don't need to use a direct buffer with VBOs, because VBO APIs like
glSetBufferData don't hold onto their own pointers to the buffer data.
They make a copy of the data when you call them.

The problem you're seeing with glDrawArrays count argument sounds like
a bug. If you get a chance, please report the bug (ideally with a
small repro case) to http://code.google.com/p/android/issues/list

On Aug 5, 8:07 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:
 Thank you Jack for your explanation.

 I am using VBOs now, so I can easily switch to direct buffers. By the
 way, what is the limit for VBO buffers? (if there is one)

 And one more thing. In my code I am drawing a 1008-vertex geometry
 using glDrawArrays(GL_TRIANGLES). Weird thing is that it draws model +
 garbage when I pass 1008 as 'count' argument to glDrawArrays, and
 draws correctly when I pass 1008/3. I believe 1008 is the correct
 value to pass, but it just not working that way. In many demos there
 are calls to glDrawArrays with GL_TRIANGLES, but they only draws few
 vertices (36 for example). I suspect my 1008 vertices (and normals) do
 not fit in some sort of cache, and code draws them differently, and
 somewhere it multiplies 'count' by 3 (hence drawing garbage when 1008
 is passed). This behaviour shows up on the emulator and the G1.
 (glDrawElements has the same behaviour when indices are simple array
 [0,count-1].)

 Dmitry

 On 6 авг, 02:14, Jack Palevich jack.palev...@gmail.com wrote:

  Hi -- I work on the Java Open GL ES bindings for Android. Fadden asked
  me to chime in here.

  Please don't use indirect buffers with OpenGL ES -- indirect buffers
  are not supported, and your code will break, both on current and
  especially on future versions of Android.

  Let me see if I can explain what's going on:

  (In my message below I'm going to use the code-name Cupcake for the
  current Android release and the code-name Donut for the upcoming
  release.)

  There are several bugs in the way Android currently handles
  java.nio.Buffer objects passed to OpenGL ES APIs:

  1) In all releases up to and including Cupcake, the implementation
  allocates PlatformAddress objects every time a direct buffer's base
  address is calculated. (In other words, when any glXXXPointer function
  is called.) This leads to garbage collections, even in programs that
  don't appear at the API level to be allocating any new objects. (You
  can use a heap analysis tools to watch these PlatformAddress objects
  being created.)

  2) The OpenGL ES APIs that take buffers are only supposed to take
  direct buffers, but this runtime check was accidentally omitted from
  all releases up to and including Cupcake. The problem with non-direct
  buffers is that their data can be moved by the Java runtime while the
  OpenGL driver is holding a pointer to them, which means that OpenGL
  driver ends up reading the wrong data, or even trying to read no-
  longer-allocated memory.

  To fix problem #2, the Donut system software release will start
  enforcing the direct buffer requirement. To keep existing, mostly-
  working OpenGL applications from breaking, we are going to add a
  compatibility shim in Donut: If your application is compiled against
  the Cupcake or earlier SDK, then we won't throw an exception if you
  use a non-direct buffer with OpenGL ES. You app will still suffer from
  the same occasionally crashes or renders incorrectly bug that it
  currently suffers from under Cupcake, but things won't be any worse.
  We will print out an error message to the log so at least you have a
  way of detecting that your app is using OpenGL incorrectly.

  If your application is compiled with the Donut SDK, it will throw a
  runtime exception if you try to use a non-direct buffer with an OpenGL
  ES API. (The reasoning is that if you are compiling using the Donut
  SDK, then you can take the time to fix your app.)

  OK, so what's a poor developer to do now, before the Donut system
  software?

  You could try using indirect buffers, in which case you will get code
  that doesn't GC very much, but also occasionally renders incorrectly
  or crashes. Or you can use direct buffers, and live with more GCs.

  I recommend using direct buffers, because I think it's better to have
  occasional GC hiccups than crashes. And once Donut is released the GC
  disadvantage should be fixed.

  On Aug 5, 11:01 am, fadden fad...@android.com wrote:

   On Aug 4, 11:09 pm, Dmitry.Skiba dmitry.sk...@gmail.com wrote:

I've found a way to get rid of garbage collection!
The receipt is simple (and ironic): do not use allocateDirect(), use
allocate(). And use only ByteBuffer, not FloatBuffer, IntBuffer, etc.
- using asFloatBuffer() on non-direct ByteBuffer will result in crash
in libhgl. (I'm too lazy to create an issue for that.)

   I'm pretty sure this will break in the next release.  My (very
   limited) understanding is that direct buffers are supposed to be
   required, 

[android-developers] Re: View Android Marketplace

2009-08-06 Thread Touch-Market

New Feature:

Now rate your favorite Apps on www.touch-market.com

---
Visit us at www.touch-market.com
THE website dedicated to YOU developers
THE sweet place for YOU Android users
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Capture EndCall key

2009-08-06 Thread Michelle Cristina de Melo Silva
  Hi,

i want to capture when user press the EndCall key in simulator, but
i think i'm doing something wrong cause nothing happens!
My code is:

public class MakeACall extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(tel:));
startActivity(intent);
setContentView(R.layout.main);
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent ev) {
switch(keyCode) {
case KeyEvent.KEYCODE_ENDCALL:
System.out.println(Terminou!!);
break;
default:
return false;
}
return super.onKeyDown(keyCode, ev);
}
}

   Can anybody help me?

[]s,
 Michelle.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Dialog windowBackground makes parent window go black

2009-08-06 Thread CraigsRace

The parent window had a 120Kb jpeg picture on it.  I used more
compression on the jpeg and got it down to 32Kb, and bingo, the parent
window stopped disappearing!  Yay me!

On Aug 6, 10:39 am, CraigsRace craig...@gmail.com wrote:
 Hi,

 I wanted to change the frame around my Dialog.  So I set up a style:
 resources
     style name=SpecialDialog parent=android:Theme.Dialog
         item name=android:windowBackground@drawable/my_frame/
 item
     /style
 /resources

 and assigned it in the manifest:
         activity android:name=.MyActivity android:theme=@style/
 SpecialDialog

 And yay! I get my new frame.  However, the parent window disappears
 (goes black).

 Having a normal dialog:
 activity android:name=.MyActivity android:theme=@android:style/
 Theme.Dialog
 keeps the parent window visible.

 Can I have a custom frame on a dialog and keep the parent window
 visible?

 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] Location ,coordinates Problem

2009-08-06 Thread Lorenz

Hi,
I'm working with android.Location with a simulator of coordinates that
sends them to the emulator:

import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Random;
import java.io.*;
import java.util.*;


public class MovementSimulator {

private static final String hostname = localhost; // 
Hostname or
IPAddress of the host where the emulator is running
private static final int port = 5554;   
// Android's console port

private static final double initialLatitude = 11;   // 
Initial
Latitude
private static final double initialLongitude = 11.1;// Initial
Longitude

private static final int millisecondsUpdate = 1000; // 
Milliseconds
to wait between two consecutive fixes

public static void main(String[] args) {
try {
System.out.println([+] GPS Movement Simulator 
Started.);
Socket link = new Socket(hostname,port);
PrintWriter out = new 
PrintWriter(link.getOutputStream());

System.out.println([+] Connected to Android's 
emulator.\n);

while (true) {
latitude += generator.nextGaussian();
longitude += generator.nexGaussian();

System.out.println([*] Sending fix: 
+latitude+ +longitude);
out.println(geo fix +latitude+ +longitude);
out.flush();

Thread.sleep(millisecondsUpdate);
}

} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}

}

}


but when the emulator receives the coordinates they are not the same
that the simulator sends, they are only similar.It si a problem of the
emulator?

An example I send:
12.0020007 44.00733359995
12.0010699 44.0073334666
12.0002999 44.00733359995
12.309 44.0073337334
12.100 44.0073340001
12.0013334 44.0073340001
12.0026668 44.0073340001
12.0050002 44.0073340001
12.0106667 44.0073337334
12.017 44.00833359995
12.007 44.0093334666
12.0049002 44.0103334666
12.0026668 44.0108334666
12.0013334 44.01203334666
12.0015034 44.01203334666
12.001 44.007333
11.9851694 44.007333
11.98516938334 44.007333
11.98516938334 44.0073334666
11.98516938334 44.00733359995
11.9851694 44.00733359995
12.00200013334 44.00733359995
12.001 44.0073334666
12.0020007 44.0073334666
12.002001 44.0073334666
12.00200141667 44.00733359995
12.00200165 44.0073336667
12.00200183335 44.0073339166
12.00200183335 44.0073341

and the emulator receives(reads from right to left):

44.00733454996 12.0020005***
44.00733454996 12.00200016669***
44.00733454996 12.0025***
44.00733454996 12.001***
44.00733454996 12.001***
44.00733454996 12.001***
44.00733454996 12.001***
44.00733454996 12.001***
44.00733454996 12.001***
44.00733471676 12.001***
44.00733488336 12.001***
44.00733505 12.001***
44.0073353334 12.001***
44.0073353334 12.001***
44.00733454996 12.00200031665***
44.00733454996 11.98516696668***
44.00733454996 11.98516696668***
44.00733454996 11.98516696668***
44.00733454996 11.98516696668***
44.00733454996 11.98516696668***
44.00733454996 12.0020005***
44.00733454996 12.00200031665***
44.00733454996 12.0020005***
44.00733454996 12.0020005***
44.00733454996 12.0020005***
44.00733454996 12.0020005***
44.00733454996 12.0020005***
44.00733454996 12.0020005***

I'm trying to use also  the Emulator Control(from Eclipse) but when I
send a coordinates to the device nothing happend..
Any Idea?
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

[android-developers] Re: how to initialize MediaRecorder in the background?

2009-08-06 Thread Robert


I tried various things to overcome the limitation of setPreviewDisplay
():

- preserved the surface (sf), so mSurfaceHolder.getSurface() was not
called again. Worked fine while the surface was visible, but once it
was destroyed, sf.isValid() returned false, and prepare() failed
again

- tried to use the other 3 types of SURFACE_TYPE_*. Preview was not
working, but video was being captured, until it needed to be
initialized again, when prepare() failed

- with these other 3 types of surface, I tried
mSurfaceHolder.lockCanvas(), sf.lockCanvas(dirtyrect) and sf.freeze()
in an attempt to keep the surface being destroyed

Nothing has worked as expected :( Is there a way to keep a valid
surface when the view is pushed to the background? Or, make
setPreviewDisplay() accept a dummy surface?

Thanks,
Robert


On Aug 5, 1:10 pm, Robert ferob...@gmail.com wrote:
 Hello all,

 I am building a camera app, where photos and videos are continuously
 being captured and saved to the SD card. The videos are short (few
 minutes), and their length are preset with setMaxDuration(). When
 MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED is reached, the
 video is saved, and a new sequence is initialized with something like:

         mMediaRecorder = new MediaRecorder();
         mMediaRecorder.setVideoSource
 (MediaRecorder.VideoSource.CAMERA);
         mMediaRecorder.setOutputFormat
 (MediaRecorder.OutputFormat.THREE_GPP);
         mMediaRecorder.setVideoFrameRate(20);
         mMediaRecorder.setVideoSize(176, 144);
         mMediaRecorder.setVideoEncoder
 (MediaRecorder.VideoEncoder.H263);
         mMediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
         mMediaRecorder.setMaxDuration(1000 * Integer.valueOf
 (videoLength));
         mMediaRecorder.setOnInfoListener(videoInfoListener);
         mMediaRecorder.setOutputFile(/sdcard/test.3gp);
         mMediaRecorder.prepare();
         mMediaRecorder.start();

 I also have a SurfaceHolder mSurfaceHolder, set up like:

         mPreview = (SurfaceView) findViewById(R.id.preview);
         mSurfaceHolder = mPreview.getHolder();
         mSurfaceHolder.addCallback(this);
         mSurfaceHolder.setType
 (SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

         public void surfaceCreated(SurfaceHolder holder) {
             mSurfaceHolder = holder;
         }

         public void surfaceChanged(SurfaceHolder holder, int format, int w,
 int h) {
         }

         public void surfaceDestroyed(SurfaceHolder holder) {
             mSurfaceHolder = null;
         }

 The whole process works fine, while the main activity is in the
 foreground. But, when I go to another activity (e.g. settings), the
 video recording works in the background only until max duration is
 reached. The file is saved, but a new sequence can not be started
 because prepare() fails. setPreviewDisplay() needs to be there, but it
 doesn't like not having a proper surface to attach to.

 I tried to use a dummy Surface, a dummy SurfaceHolder, or reuse the
 Camera with mMediaRecorder.setCamera(), but nothing works. Is there a
 way to initialize MediaRecorder in the background?

 Thanks and regards,
 Robert
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 program to not relaunch when opened from programs list??

2009-08-06 Thread Rick

I have a question about the activity cycle when you use the Home
button to exit an application.

I have noticed that when you use the Home button to exit an
application, you can hold the Home button to move back to that
application, but selecting that application from the list of programs
or the 'desktop' will open a new instance of it.

So I'm wondering is there a way to make it so that if the program is
running already, then it will move back to that application like it
does from the task menu brought up from holding home button? Or is
this something that needs to be handled via the activity methods (such
as onCreate, onResume, etc) or in some other clever way?

Thanks.

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



[android-developers] GestureDetector in Textarea

2009-08-06 Thread Anonymous Anonymous
Hi All,

How can i use GestureDetector in textarea? now when i do some flick cursor
is moving  and its getting handled in input area.
Is there any way i can intercept the or movement ,so that it will come to my
application?

*for me it works with imageview and other controls , only problem with
textarea :(

Thanks

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



[android-developers] Re: how to stop service?

2009-08-06 Thread Marco Nelissen
What do you mean by the service is still running in the background? What is
the return value of your call to stopService() ? How are you determining
that it is still running afterwards?


On Thu, Aug 6, 2009 at 5:30 AM, Archana archana.14n...@gmail.com wrote:


 Hi ,

  How can we stop Service.I tried put it in both  onstop and ondestroy()
 method.While exiting It is calling this method but service still
 running background.Whether i am doing anything wrong?

 private static Intent serviceIntent ;

 protected void onCreate() {
 serviceIntent = new Intent(this, LocalService.class);
startService(serviceIntent);
 }
 @Override
protected void onStop() {
// TODO Auto-generated method stub
super.onStop();
Log.e(CallingOnStop, OnStop);
stopService(serviceIntent);
}

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Log.e(CallingOnDEstroy, OnDestroy);
stopService(serviceIntent);
}
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: /dev/mem open from opencore

2009-08-06 Thread Marco Nelissen
Sounds like a permissions problem. Also, android-developers is the wrong
group for questions like this.


On Thu, Aug 6, 2009 at 1:33 AM, scs scs...@gmail.com wrote:


 we are able to open the /dev but /dev/mem is failing.

 /dev/mem is created using mknod...

 Is there any probable with the perimission issues?
 How do we solve the issue?

 Please help us.

 Note: We are able to open /dev/mem from shell. We are able to open /
 dev/log,/dev/full,/dev/null from open core.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Why is it Giving Out Put Twice

2009-08-06 Thread Marco Nelissen
If you replace your use of Toast.makeText() with Log.i(), what is printed to
the log?


On Wed, Aug 5, 2009 at 1:41 PM, saptarshi chatterjee 
saptarshichatterj...@gmail.com wrote:

 no no Nelissen , you missed the first field of the out put . It's the same
 id number that's repeated. *1 12c/2,Dum Dum
 Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 *
 You run the program see the out put and you will understand .
 *Next time when I run it ,it shows*
 *1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 3 12c/2,Dum Dum Park,Howrah,India,Kolkata
 4 227,Bangur,Khidirpur,India,Kolkata
 *
 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 3 12c/2,Dum Dum Park,Howrah,India,Kolkata
 4 227,Bangur,Khidirpur,India,Kolkata
 where it should had been
 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 3 12c/2,Dum Dum Park,Howrah,India,Kolkata
 4 227,Bangur,Khidirpur,India,Kolkata


 *
 *

 On Thu, Aug 6, 2009 at 2:05 AM, Marco Nelissen marc...@android.comwrote:

 Looks to me like every time you run your app, you insert two more rows in
 to the database, so the first it will have 2 rows, then 4, 6, 8, etc.



 On Wed, Aug 5, 2009 at 1:12 PM, saptarshi chatterjee 
 saptarshichatterj...@gmail.com wrote:


 package com.outp.inp;





 import android.app.Activity;
 import android.content.ContentValues;
 import android.content.Context;
 import android.database.Cursor;
 import android.database.SQLException;
 import android.database.sqlite.SQLiteDatabase;
 import android.database.sqlite.SQLiteOpenHelper;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.Toast;


 public class myact extends Activity {


public static final String KEY_ROWID = _id;
public static final String KEY_VEHICLE = vehicle;
public static final String KEY_ROUTE = route;
public static final String KEY_COUNTRY = country;
public static final String KEY_CITY = city;
private static final String TAG = DBAdapter;

private static final String DATABASE_NAME = publicTransport;
private static final String DATABASE_TABLE = vehicleTable;
private static final int DATABASE_VERSION = 1;

long id;
Cursor c;

private static final String DATABASE_CREATE =
create table vehicleTable (_id integer primary key
 autoincrement, 
+ vehicle text not null, route text not null, 
+ country text not null,city text not null);;


private  final Context context=this;
private DatabaseHelper DBHelper;
private SQLiteDatabase sqlitedatabase;








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


DBHelper = new DatabaseHelper(context);
sqlitedatabase = DBHelper.getWritableDatabase();

id = insertRow(
12c/2,Dum Dum
 Park,Howrah,India,Kolkata);
 id = insertRow(
227,Bangur,Khidirpur,India,Kolkata);
 Toast.makeText(this, new \n\n+id,Toast.LENGTH_LONG).show();


 Cursor c = getAllRows();
 if (c.moveToFirst())
 {
 do {
 DisplayRow(c);
 } while (c.moveToNext());
 }
 sqlitedatabase.close();



}



private static class DatabaseHelper extends SQLiteOpenHelper
{
DatabaseHelper(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);

}


public void onCreate(SQLiteDatabase db)
{

db.execSQL(DATABASE_CREATE);


}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion,
  int newVersion)
{
Log.w(TAG, Upgrading database from version  +
 oldVersion
  +  to 
  + newVersion + , which will destroy all old data);
db.execSQL(DROP TABLE IF EXISTS titles);
onCreate(db);
}
}





public long insertRow(String vehicle, String route, String
 country,String city)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_VEHICLE, vehicle);
initialValues.put(KEY_ROUTE, route);
initialValues.put(KEY_COUNTRY, country);
initialValues.put(KEY_CITY, city);
return sqlitedatabase.insert(DATABASE_TABLE, null,
 initialValues);
}




public Cursor getAllRows()
{
return sqlitedatabase.query(DATABASE_TABLE, new String[] {
KEY_ROWID,
KEY_VEHICLE,
KEY_ROUTE,
KEY_COUNTRY,
KEY_CITY},
null,
null,
null,
null,

[android-developers] InstrumentationTestCase and startActivityForResult

2009-08-06 Thread dev

Hi,

Can a InstrumenatationTestCase class call startActivityForResult ? and
have onActivityResult for getting its result.

I tried the same in an Activity , that works.

But from an Instrumentation class I can call only startActivity

I need to get some result from Activity to instrumentation.
How do I go about it?


Any input would be of great help.

Regards,
Dev

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



[android-developers] Re: How to get program to not relaunch when opened from programs list??

2009-08-06 Thread Rick

After doing some further testing, it turns out this wasn't the
problem. It seems the problem was happening because the instance of
the app launched on the emulator when hitting run is different from
the one run when selecting the program on the phone. So it was opening
two separate instances instead of simply reopening the existing one.

On Aug 6, 10:45 am, Rick rmanc...@mit.edu wrote:
 I have a question about the activity cycle when you use the Home
 button to exit an application.

 I have noticed that when you use the Home button to exit an
 application, you can hold the Home button to move back to that
 application, but selecting that application from the list of programs
 or the 'desktop' will open a new instance of it.

 So I'm wondering is there a way to make it so that if the program is
 running already, then it will move back to that application like it
 does from the task menu brought up from holding home button? Or is
 this something that needs to be handled via the activity methods (such
 as onCreate, onResume, etc) or in some other clever way?

 Thanks.

 Rick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Memory problem

2009-08-06 Thread Romain Guy

It doesn't do anything but draw the bitmap. A standard BitmapDrawable
has other features (gravity, alpha, etc.)

On Thu, Aug 6, 2009 at 4:05 AM, for androidforandr...@gmail.com wrote:
 How is the FasterBitMapDrawable in the Shelves different from normal
 BitmapDrawable?

 On Thu, Aug 6, 2009 at 2:38 PM, peter heywoodpres...@gmail.com wrote:

 Create a Bitmap is very consume memory

 On Aug 6, 2:41 pm, Rahul nakate.ra...@gmail.com wrote:
  Hi all
 
  i have one big problem in android due to this my application crashesh
  every time
 
  My Problem are
 
  1. Bitmap memory exceed error
  2. Out of memory error
 
  somebody pls help me to solve this problem.
 
  thanks
  Ranjit



 




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

2009-08-06 Thread Declan

Hi,
My app is crashing, How do I debug it?
I'm using a HTC Magic and eclips.
I looked in the documentation, but it doesn't say how to go about
doing it.
Thanks,
-Declan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] An App contains a BroadcastReceiver and an Activity

2009-08-06 Thread Peacemoon

I want to start a project which contains a BroadcastReceiver and an
Activity. The BroadcastReceiver doesn't communicate with the activity.
But they share a same resource. Can i do it in only one Project (that
means, i use only 1 apk to install both BroadcastReceiver and the
Activity on my phone), or i have to develope them seperately in 2
projects.
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to get program to not relaunch when opened from programs list??

2009-08-06 Thread TaoK

Thanks for that! I had resigned myself to dealing with that android
quirk / bug, and never re-tested on my actual device in use - I never
noticed that the issue didn't actually happen on my phone in normal
use :)

Thanks again,
Tao

On Aug 6, 11:27 am, Rick rmanc...@mit.edu wrote:
 After doing some further testing, it turns out this wasn't the
 problem. It seems the problem was happening because the instance of
 the app launched on the emulator when hitting run is different from
 the one run when selecting the program on the phone. So it was opening
 two separate instances instead of simply reopening the existing one.

 On Aug 6, 10:45 am, Rick rmanc...@mit.edu wrote:



  I have a question about the activity cycle when you use the Home
  button to exit an application.

  I have noticed that when you use the Home button to exit an
  application, you can hold the Home button to move back to that
  application, but selecting that application from the list of programs
  or the 'desktop' will open a new instance of it.

  So I'm wondering is there a way to make it so that if the program is
  running already, then it will move back to that application like it
  does from the task menu brought up from holding home button? Or is
  this something that needs to be handled via the activity methods (such
  as onCreate, onResume, etc) or in some other clever way?

  Thanks.

  Rick- 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] MIDI Support in Android 1.5 SDK

2009-08-06 Thread Jason Scharf

Hello,

I'm trying to write a music-orientated Android app that makes use of
multiple notes played concurrently but I'm finding it frustrating
trying to make sense of the audio situation in the SDK.

My intent is to play tracks of user-sequenced notes, allowing for
multiple notes (within reasonable limits) to be played concurrently,
i.e. in what a normal person would call 'chords'.

MIDI is the obvious choice but I'm at a loss as to the optimal path to
take.

I attempted to use JetPlayer ( 
http://developer.android.com/reference/android/media/JetPlayer.html
) and got as far as creating a JET file with one segment and 12 Events
(of type 'TriggerClip', each representing a note in a MIDI track I
created consisting of A to G# in sequence) but gave up after I could
play the entire JET file using JetPlayer.play(), while
JetPlayer.triggerClip would always fail (EAS code -36, whatever that
is).

Does anyone here have experience using JetPlayer? Is my JET file not
set up properly for my purposes or is JetPlayer innappropriate for
this?

I don't mind creating the MIDI data programatically if need be (in
fact that might be quite nice), but so far I am lost as to what route
I should take, or if this is even currently feasible in the SDK code +
Dalvik.



Cheers,
Jason

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



[android-developers] sending email using java mail

2009-08-06 Thread amy0205

hi! i was able to compile and successfully send an email that looks
like these:
http://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-actually-via-smtp/
using a java project. but when i tried to use it with android using
the emulator, the application crashed.
when i traced the code, it seems that this line is the cause:
MimeMessage message = new MimeMessage(session);
can you help me? why is there a problem with the creation of a
mimemessage?
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] How to register receiver the way the android manifest do.

2009-08-06 Thread karan

hi,
 i want to register a receiver without placing it in the android
manifest, also, the receiver will be of a separate application, the
reason for this is the action on which it will be registered will be
generated dynamically from different application.

All i have is the package name and the name of the receiver, i want to
know how to register that sitting in different application. The
android manifest do it in some i am not able to figure out how it does
since all it gets also is a string of package name and receiver name.

Any pointers would be highly appreciated.
Regards
Karan

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



[android-developers] OutofMemory Excpetion in built in ZoomControls of mapView

2009-08-06 Thread smilingm

Hello,

I wonder why I sometimes get an OutOfMemory Exception in mapView when
scrolling around on map and zooming in to the max Zoomlevel? Is this a
bug in the Zoomcontrols or MapView Lib??

Thanks for your help!

Here the stacktrace:

uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1784): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
E/AndroidRuntime( 1784): at android.graphics.Bitmap.nativeCreate
(Native Method)
E/AndroidRuntime( 1784): at android.graphics.Bitmap.createBitmap
(Bitmap.java:483)
E/AndroidRuntime( 1784): at
com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:305)
E/AndroidRuntime( 1784): at com.google.android.maps.ZoomHelper.doZoom
(ZoomHelper.java:137)
E/AndroidRuntime( 1784): at com.google.android.maps.ZoomHelper.doZoom
(ZoomHelper.java:126)
E/AndroidRuntime( 1784): at com.google.android.maps.MapView.doZoom
(MapView.java:1454)
E/AndroidRuntime( 1784): at com.google.android.maps.MapView.doZoom
(MapView.java:1463)
E/AndroidRuntime( 1784): at com.google.android.maps.MapView$5.onZoom
(MapView.java:1418)
E/AndroidRuntime( 1784): at android.widget.ZoomButtonsController
$4.onClick(ZoomButtonsController.java:275)
E/AndroidRuntime( 1784): at android.view.View.performClick(View.java:
2180)
E/AndroidRuntime( 1784): at android.view.View.onTouchEvent(View.java:
3846)
E/AndroidRuntime( 1784): at android.widget.ZoomButton.onTouchEvent
(ZoomButton.java:62)
E/AndroidRuntime( 1784): at android.view.View.dispatchTouchEvent
(View.java:3386)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:863)
E/AndroidRuntime( 1784): at
android.widget.ZoomButtonsController.onTouch
(ZoomButtonsController.java:582)
E/AndroidRuntime( 1784): at android.view.View.dispatchTouchEvent
(View.java:3382)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:831)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:863)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:863)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:863)
E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
(ViewGroup.java:863)
E/AndroidRuntime( 1784): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1710)
E/AndroidRuntime( 1784): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
(PhoneWindow.java:1197)
E/AndroidRuntime( 1784): at android.app.Activity.dispatchTouchEvent
(Activity.java:1993)
E/AndroidRuntime( 1784): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1694)
E/AndroidRuntime( 1784): at android.view.ViewRoot.handleMessage
(ViewRoot.java:1525)
E/AndroidRuntime( 1784): at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime( 1784): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1784): at android.app.ActivityThread.main
(ActivityThread.java:3952)
E/AndroidRuntime( 1784): at java.lang.reflect.Method.invokeNative
(Native Method)
E/AndroidRuntime( 1784): at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime( 1784): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 1784): at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:540)
E/AndroidRuntime( 1784): 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] rtsp protocol

2009-08-06 Thread Swisti

Hello,
I have some questions about rtsp protocol.

1. Is it possible to save rtsp video stream on the sd card, instead of
redisplay on the screen?

2. Is it possible to capture displayed screen of the movie?


Code (in VideoView.java) shownbelow make only black screenshot of the
videoview/surface contener.



View mView = getRootView();

Bitmap bitmap = Bitmap.createBitmap(mView.getMeasuredWidth(),
mView.getMeasuredHeight(), Bitmap.Config.RGB_565);

Canvas canvas = new Canvas(bitmap);

draw(canvas);

try {

  FileOutputStream fos = new FileOutputStream(/sdcard/test.jpg);

  bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);

  fos.close();

}

catch (FileNotFoundException e) { Log.d(error,e.getMessage()); }

catch (IOException e) { Log.d(error,e.getMessage()); }

catch (Exception e) { Log.d(error,e.getMessage()); }



...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: AppWigets into Applications

2009-08-06 Thread karan

hi,
 You need to bind your widgets id first, and for doing that you need
to do two things
1) you will need a permission for binding 2) you will need to share
your process id.

Let me know if you still face the problem,

On Aug 6, 4:35 pm, mtd martit...@hotmail.com wrote:
 Hi,
   I am trying to create an application that contains AppWidgets, but
 only get to show the original layout of the same, unable to interact
 with them. The main steps that I followed are:

                 AppWidgetManager mAppWidgetManager = 
 AppWidgetManager.getInstance
 (this);

                 AppWidgetHost mAppWidgetHost = new AppWidgetHost(this, 
 hostId);

                 appWidgetId = mAppWidgetHost.allocateAppWidgetId();

 // i is an integer used to specify the widget I want to insert

 AppWidgetHostView appWidgetHostView = mAppWidgetHost.createView(this,
                                 appWidgetId, appWidgetProviderInfo.get(i));

                 appWidgetHostView.setAppWidget(appWidgetId,
                                 (AppWidgetProviderInfo) 
 appWidgetProviderInfo.get(i));

  And then insert the appWidgetHostView into my application layout.Has
 anyone managed to enter AppWidgets into their applications and can
 tell me what I'm doing wrong?

 Thank you very much

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



[android-developers] Problem while calling the web services in android.

2009-08-06 Thread Karthic

Problem while calling the web services in android.

To call web services in android I have done the following steps

1.  Wrote the web service class in java and stored in apache axis.
(in .jws format)


public class ADD2No
{
public int add(int a,int b)
{
return (a+b);
}

public int sub(int c,int d)
{
return (c-d);
}
}

2.  Then is have tested the web service on web browser.

http://192.168.1.41:8081/axis/ADD2No.jws

I have got.

There is a Web Service here
Click to see the WSDL
in browser.
3.  then I implement the service using core java and Ksoap2 library.
Its working fine.

4.  But I got error when I call the web service via android.

5.  This is my code.

package com.example.SamWebService;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class WebServiceInAndroid extends Activity
{
/** Called when the activity is first created. */

/*
 private static final String SOAP_ACTION = HelloYou;
 private static final String METHOD_NAME = getHello;
 private static final String NAMESPACE = urn:HelloYou;
 private static final String URL = http://localhost/lab/
service.php;
 */

private static final String SOAP_ACTION = ADD2No;
private static final String METHOD_NAME = add;
private static final String NAMESPACE = urn:ADD2No;
private static final String URL = http://elcserver:8081/axis/
ADD2No.wsdl;


   //private Object resultsRequestSOAP = null;


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

TextView tv = (TextView) findViewById(R.id.txt1);

setContentView(R.layout.main);

try
{
  SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);
  request.addProperty(a, 3);
  request.addProperty(b, 4);

  SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
  //envelope.dotNet = true;
  envelope.setOutputSoapObject(request);
  AndroidHttpTransport androidHttpTransport = new
AndroidHttpTransport(URL);

  try
  {
   androidHttpTransport.call(SOAP_ACTION,
envelope);

   //Parse Response

   SoapObject resultsRequestSOAP = (SoapObject)
envelope.bodyIn;

   //String xy = resultsRequestSOAP.getProperty
(0).toString();

   tv.setText(Ganzes Rückagbeobjekt:
\n+resultsRequestSOAP.toString());




  }

  catch (Exception e)
  {
   e.printStackTrace();
  }

}
catch(Exception e)
{
tv.setText(Error :  + e.getMessage());
}


   }



 }
6.  I have tried lot of methods still I am getting the error.
“Your application has been stopped unexpectedly”

7.  my application’s manifest file is

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.example.SamWebService
  android:versionCode=1
  android:versionName=1.0

application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.WebServiceInAndroid
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
/application

uses-permission xmlns:android=http://schemas.android.com/apk/res/
android android:name=android.permission.INTERNET/uses-permission

uses-sdk android:minSdkVersion=3 /
/manifest

8.  So give me solutions to overcome this problem and how to define the
SOAP_NAME, METHOD_NAME, NAMESPACE and URL what they meant really.

9.  Give me the step by step procedure to call apache axis web services
from android.




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



[android-developers] Method to detect a widget is visible - or otherwise in the foreground or background?

2009-08-06 Thread Craig

It would appear on a G1 (with the latest software update) that onUpdate
() runs even when the widget is not visible. Is there a way of sensing
that the widget is or is not visible or is otherwise in foreground?
That is, running the code below shows a logcat message at whatever
interval the Widget is scheduled to update, whether it's in foreground
or not, whether even the screen is dim or otherwise in deep sleep.

It would seem onUpdate should only be scheduled to run when the Widget
is in the foreground or visible. Is this a defect in the G1, or is
there some other API call to detect if the Widget is visible?


public class HomeScreenWidget extends AppWidgetProvider {

public static final String TAG = HomeScreenWidget;


   @Override
   public void onUpdate(Context context, AppWidgetManager
appWidgetManager, int[] appWidgetIds) {

Log.i(TAG, onUpdate - runs every 6 seconds on G1 - per the
updatePeriodMillis, even when not visible);
   }

}


appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
android
android:minWidth=146dip
android:minHeight=146dip
android:updatePeriodMillis=6000
android:initialLayout=@layout/a_widget_home_screen
 /


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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.setDataSource(fd) cause IOException: Prepare failed.: status=0x1

2009-08-06 Thread JAG

What is the preferred way of reusing a MediaPlayer when using
resources?
My try looks a bit ... too complicated... so maybe I should be happy
to see that it didn't work.
(I run the Android 1.5 SDK and emulator.)

According to this thread my problem may be a permission problem.
http://groups.google.se/group/android-developers/browse_thread/thread/5569a88c50dcc043?pli=1

I get the same error. But in my case it only occurs when I use
FileDescriptor!?!
The use case differs however, because I use a resource stored in the
bundle.
I have s0.mp3 safely stored in the project /res/raw and it
successfully plays when I use SoundPool or MediaPlayer.create. And the
log print tells me I referenced the correct file and stay safely in my
package.

I'm sure my way of getting the fd out from a package resource is the
problem, I didn't find any other way...
But why didn't setDataSource throw the exception instead of a
printout?
And why on earth is the same resource happily played one way but not
the other? Seems like a design flaw rather than a security raise.
Should I look in the  MediaPlayer.create code to see how they get
around the problem or can you help me understand how it works?


This is a test code snippet: (from onCreate of a simple Activity)

soundPlayer = new SoundPool(1, AudioManager.STREAM_NOTIFICATION,
0);

FileDescriptor fd = getResources().openRawResourceFd
(R.raw.s0).getFileDescriptor();
Log.d(SoundTest, getResources().getResourceName(R.raw.s0));

mediaPlayer = new MediaPlayer();
try {
  mediaPlayer.setDataSource(fd);
  mediaPlayer.prepare();
} catch (Exception e) {
  Log.e(SoundTest,Error!  + Log.getStackTraceString(e));
}

  mediaPlayer = MediaPlayer.create(this, R.raw.s0);
  if (mediaPlayer != null) {
mediaPlayer.start();
  }

  soundPlayer.play(sounds[key], 1, 1, 1, 0, 2);


And the error:

PlayerDriver: Command PLAYER_SET_DATA_SOURCE completed with an error
or info PVMFErrNotSupported
MediaPlayer:  error (1, -4)
SoundTest:Error! java.io.IOException: Prepare failed.: status=0x1
   at android.media.MediaPlayer.prepare(Native Method)


Thanks for any insight shared!
 JAG

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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] Error during preparation

2009-08-06 Thread matthieu nicolazo

Hello guys,

I try to read some radio streaming with android media player but some
errors occurs during the prepare() method.

Here is my source code :

Log.w([Player], + setDataSource);
mp.setDataSource(http://streaming.radio.rtl.fr/rtl-1-44-96;);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
Log.w([Player], + prepare);
mp.prepareAsync();
mp.setOnPreparedListener(this);
mp.setOnBufferingUpdateListener(this);


Here is the log of device debugging on HTC Hero (target api level 3):

08-06 16:03:04.241: WARN/[Player](715): + setDataSource
08-06 16:03:04.361: WARN/[Player](715): + prepare
08-06 16:03:07.561: ERROR/PlayerDriver(432): Command PLAYER_INIT
completed with an error or info PVMFErrCorrupt
08-06 16:03:07.561: ERROR/MediaPlayer(715): error (1, -10)


Is there anybody that realize successfully a stream player like this ?
Can anybody help me to correct my source code ?
Or does media player can just play audio stream ?

Regards,
Matthieu

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



[android-developers] Broadcasting reboot intent

2009-08-06 Thread markwhitney

I am trying to reboot Android by broadcasting Intent.ACTION_REBOOT
from my activity.

I believe that I have given it all the proper permissions to send such
a signal but when I launch the activity, nothing happens.  I saw a
similar post about this back in May, but no responses.

Logcat:

ActivityManager  I  Starting activity: Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x102000
  00 comp=
{com.android.settings.shutitdown/
com.android.settings.shutitdown.ShutdownActivity} }
ActivityManager  I  Start proc com.android.settings.shutitdown for
activity com.android.settings.shutitdown/.ShutdownActivity: pid=1397
uid=10
  00 gids={}
ShutdownActivity  D  creating activity: for reboot
ShutdownActivity  I  rebooted
InputConnectionWrapper  W  showStatusIcon on inactive InputConnection
ActivityManager  I  Displayed activity
com.android.settings.shutitdown/.ShutdownActivity: 564 ms

Note that there is no denial to send the Intent, just silence.  Here
is the activity code:

public class ShutdownActivity extends Activity {
private static final String LOG_TAG = ShutdownActivity;

public void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.shutdown_main);
Log.d(LOG_TAG, creating activity: for reboot);
Intent i = new Intent(Intent.ACTION_REBOOT);
i.setAction(Intent.ACTION_REBOOT);
sendBroadcast(i);
Log.i(LOG_TAG, rebooted);
}
public void onPause() {
}
}



...and the manifest:

manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.android.settings.shutitdown
android:sharedUserId=android.uid.system

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

application android:label=shutitdown
android:icon=@drawable/ic_launcher_settings
activity android:name=.ShutdownActivity
  android:label=Shutdown
  intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /

  /intent-filter
/activity
/application

/manifest

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: ANN: Vancouver Android Developers Meetup.com Group

2009-08-06 Thread j pimmel
Erm oops

http://www.meetup.com/van-android-developers/

Thanks

On Wed, Aug 5, 2009 at 1:51 PM, j pimmel frankly.wat...@googlemail.comwrote:

 All,

 For those who are in the Greater Vancouver area, I have set up a Meetup
 group which aims to convene face-to-face meets for discussion on Android
 development.

 Please feel free to join and enter topics of interest in the 'Message
 Board' to give a focus to the inaugural meetup, hopefully this fall.

 Thanks

 Jerome

 --
 “We make a living by what we get, but we make a life by what we give.  -
  Winston Churchill

 ### Craft @ http://www.linkedin.com/in/jpimmel
 ###  Vox @ http://act.ualise.com/blogs/continuous-innovation
 ###  Twit @ http://twitter.com/franklywatson


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



[android-developers] why camera is rotated

2009-08-06 Thread engin

Hi, I am trying to use Camera to take picture and to video recording
but it always runs in portrait mode. Even if I tried to
sreenOrientatiton=landscape it solved screen appearance but when I
take photo and capture video they are  still saved rotated 90 degrees.
I searched it but ı could not find clear solution. Can anybody help me
Thanks.

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



[android-developers] Screen rotation

2009-08-06 Thread engin

Hi, Can we check whether or not user rotated phone while he is
capturing video or taking photo?
I mean that can we realize that user rotated phone from verticak to
horizantal or vice versa?

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



[android-developers] Notification and NotificationManager

2009-08-06 Thread bizack

Is it possible, without modifying the Android source, to query the
system for all current and pending notifications (system wide)?

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] Problem with TranslateAnimation

2009-08-06 Thread Fräntz Miccoli

Hello people,

I'm back to Android developpement with a great pleasure but i'm
experimenting a great problem...

Here is my code explained :

//This function move an element View to a new position described by
xTargeted and yTargeted
private void animateMove(final View v, final int xTargeted, final int
yTargeted){

//here i'm getting the actual position of the view
int x = ((AbsoluteLayout.LayoutParams)v.getLayoutParams()).x;
int y = ((AbsoluteLayout.LayoutParams)v.getLayoutParams()).y;

//creation of the animation
TranslateAnimation t = new TranslateAnimation(0,xTargeted-x,
0,yTargeted-y);
t.setDuration(TaquoidConf.moveDuration);
t.setInterpolator(new AccelerateInterpolator());

//defining a listener
t.setAnimationListener(new AnimationListener(){

public void onAnimationEnd(Animation animation) {

   // !! Without this thread or just a
call to its content the view goes to its ancient coordinates after
animation
Thread th = new Thread(new Runnable(){
public void run() {
v.setLayoutParams(new 
AbsoluteLayout.LayoutParams
(v.getLayoutParams().width,v.getLayoutParams().height, xTargeted,
yTargeted));
}
});
th.run();
}

public void onAnimationRepeat(Animation animation) {

}

public void onAnimationStart(Animation animation)
}
});

//Launching the animation on the view
v.startAnimation(t);
}

If someone have already solved this problem I would enjoy to know the
answer.

Thanks

Fräntz

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



[android-developers] getting android to work with gsm modem in ubuntu

2009-08-06 Thread iqnatius

Hi all,
I am trying to integrate my gsm modem to android, basically the at
command available in reference-ril should work.

Below is a snippet of what i have changed, my goal is just to hard
code the device connection and get it to send the data to my com port
0, but before i do anything the open function already failed at the
comment /*fail here*/. It will return -1. Have anyone faced the same
problem as me? Is there anything i need to change at the make file?

regards,
Adrian

static void *
mainLoop(void *param)
{
int fd;
int ret;
struct termios  tty;
struct termios oldtty;

AT_DUMP(== , entering mainLoop(), -1 );
at_set_on_reader_closed(onATReaderClosed);
at_set_on_timeout(onATTimeout);

for (;;) {

/* start open fd */
  fd=-1;
  while  (fd  0) {
LOGI (xp-debug mainLoop\n);
// signal(SIGIO, SIG_IGN); // the important one.


 fd = open(/dev/ttyUSB0, O_RDWR);// | O_NOCTTY | O_NONBLOCK
 if (fd  0) {
   LOGI (fd  0   fd:%d\n,fd);  /*fail here*/
   //return 0;
 }
 tcgetattr(fd, oldtty);  // save current port settings
 //bzero(tty, sizeof(tty));  // Initialize the port settings
structure to all zero
 memset(tty,0,sizeof(tty));
 LOGI(before tty config \n);
 tty.c_cflag =  B9600 | CS8 | CREAD ;  // 8N1 | CLOCAL   |
CRTSCTS
 tty.c_iflag = 0;
 tty.c_oflag = 0;
 tty.c_lflag = 0;
 tty.c_cc[VMIN] = 0;  // 0 means use-vtime
 tty.c_cc[VTIME] = 100;  // time to wait until exiting read
(tenths of a second)
 LOGI(after tty config\n);
 tcflush(fd, TCIFLUSH);  // flush old data
 tcsetattr(fd, TCSANOW, tty);  // apply new settings
 fcntl(fd, F_SETOWN, getpid());  // enable our PID to receive
serial interrupts
 fcntl(fd, F_SETFL, FASYNC);

if (fd  0) {
perror (opening AT interface. retrying...);
sleep(10);
/* never returns */
}
}
/* end of open socket*/
s_closed = 0;
ret = at_open(fd, onUnsolicited);

if (ret  0) {
LOGE (AT error %d on at_open\n, ret);
return 0;
}

RIL_requestTimedCallback(initializeCallback, NULL,
TIMEVAL_0);

// Give initializeCallback a chance to dispatched, since
// we don't presently have a cancellation mechanism
sleep(1);

waitForClose();
LOGI(Re-opening after close);
}
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 android to show my IME in the input method pop-up menu?

2009-08-06 Thread Harsha

Hi,

I have written my input method on lines of LatinIME. My IME MyIME
has a service and an activity similar to LatinIME.

Installing it to emulator via eclipse does not seem to work and hence
I have tried the  following approaches.

MY GOAL:

All I need as the first step to know that I am heading in the correct
direction is that I should be able to see My IME as one of the
available input methods. For example, on any EditText, when I long
click  release, the Input Method menu that pops up must also show
My IME as one of the available input methods.

However so far the pop-up only shows Android keyboard (LatinIME).
Hence I tried the following approaches.

Approach-1:
===
I checked out the andorid source code and built  ran it successfully
to make sure I got the build process right.
I created my project in ~/mydroid/packages/inputmethods/MyIME. It has
the package structure 'com.android.inputmethod.myime' (to be in line
with Android's package structure, I am not sure if this is required).

I ran a build using make. Make succeed in compiling MyIME, just like
LatinIME and all the android tools were also created. However looking
at the build output, LatinIME was installed into  /system/app/
LatinIME.apk while MyIME was not installed at all.

Question with respect to approach-1:

1. How to get the build process to install MyIME into /system/app as
MyIME.apk?

Since install did not happen via the build process, I started the
newly built emulator (and newly built ddms to watch logs) and used
follownig install approaches:

Approach-2:
===
I ran 'ant debug' to get MyIMESettings-debug.apk. Then I ran 'adb
install MyIMESettings-debug.apk'. The attempt failed with the message
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]. Hence I tried the
approach-3.

Question with respect to approach-2:

2. Why did the install fail when the project was built using 'ant
debug'? Is it some thing to do with debug signature?


Approach-3:
===
The build process had created an APK file but hadn't installed it (/
mydroid/out/target/product/generic/obj/APPS/MyIME_intermediates/
package.apk) I renamed that package.apk to MyIME.apk and installed it
using adb install MyIME.apk. The install succeed. However, the adb
install put my APK under /data/app with the name
com.android.inputmethod.myime.apk instead with name MyIME.apk

Question with respect to approach-3:

3. Is there any way to get adb install MyIME.apk to install into /
system/app folder?


Again, what I am trying to achieve is mentioned under MY GOAL. Your
answers my questions and any help to steer me in the direction of my
goal is very much appreciated

Thanks  regards,
Harsha

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



[android-developers] Re: How can I open a AlertDialog in SurfaceView

2009-08-06 Thread NataliaPC

I've the same question...

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



[android-developers] ANN: Vancouver Android Developers Meetup.com Group

2009-08-06 Thread j pimmel
All,

For those who are in the Greater Vancouver area, I have set up a Meetup
group which aims to convene face-to-face meets for discussion on Android
development.

Please feel free to join and enter topics of interest in the 'Message Board'
to give a focus to the inaugural meetup, hopefully this fall.

Thanks

Jerome

-- 
“We make a living by what we get, but we make a life by what we give.  -
 Winston Churchill

### Craft @ http://www.linkedin.com/in/jpimmel
###  Vox @ http://act.ualise.com/blogs/continuous-innovation
###  Twit @ http://twitter.com/franklywatson

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



[android-developers] Developing on a regular consumer HTC Magic device

2009-08-06 Thread Dollars 5

Hello All,

We just bought a regular consumer HTC Magic/G2 phone in India and it
is unlocked. We would like to root + upgrade to Android 1.5 OS to
proceed with development, what is the process? are there any proper
knowledgebase or documentation on the process of rooting and upgrade?

Any help is very much appreciated.

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



[android-developers] How to get android to show my IME in the input method pop-up menu?

2009-08-06 Thread Harsha

Hi,

I have written my input method on lines of LatinIME. My IME MyIME
has a service and an activity similar to LatinIME.

Installing it to emulator via eclipse does not seem to work and hence
I have tried the  following approaches.

MY GOAL:

All I need as the first step to know that I am heading in the correct
direction is that I should be able to see My IME as one of the
available input methods. For example, on any EditText, when I long
click  release, the Input Method menu that pops up must also show
My IME as one of the available input methods.

However so far the pop-up only shows Android keyboard (LatinIME).
Hence I tried the following approaches.

Approach-1:
===
I checked out the andorid source code and built  ran it successfully
to make sure I got the build process right.
I created my project in ~/mydroid/packages/inputmethods/MyIME. It has
the package structure 'com.android.inputmethod.myime' (to be in line
with Android's package structure, I am not sure if this is required).

I ran a build using make. Make succeed in compiling MyIME, just like
LatinIME and all the android tools were also created. However looking
at the build output, LatinIME was installed into  /system/app/
LatinIME.apk while MyIME was not installed at all.

Question with respect to approach-1:

1. How to get the build process to install MyIME into /system/app as
MyIME.apk?

Since install did not happen via the build process, I started the
newly built emulator (and newly built ddms to watch logs) and used
follownig install approaches:

Approach-2:
===
I ran 'ant debug' to get MyIMESettings-debug.apk. Then I ran 'adb
install MyIMESettings-debug.apk'. The attempt failed with the message
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]. Hence I tried the
approach-3.

Question with respect to approach-2:

2. Why did the install fail when the project was built using 'ant
debug'? Is it some thing to do with debug signature?


Approach-3:
===
The build process had created an APK file but hadn't installed it (/
mydroid/out/target/product/generic/obj/APPS/MyIME_intermediates/
package.apk) I renamed that package.apk to MyIME.apk and installed it
using adb install MyIME.apk. The install succeed. However, the adb
install put my APK under /data/app with the name
com.android.inputmethod.myime.apk instead with name MyIME.apk

Question with respect to approach-3:

3. Is there any way to get adb install MyIME.apk to install into /
system/app folder?


Again, what I am trying to achieve is mentioned under MY GOAL. Your
answers my questions and any help to steer me in the direction of my
goal is very much appreciated

Thanks  regards,
Harsha


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Developing on a regular consumer HTC Magic device

2009-08-06 Thread Dollars Admin
I searched this group and at the dev guide at
http://developer.android.com/guide/developing/device.html - but no specific
info on HTC Magic.

As I found here:
http://groups.google.com/group/android-developers/browse_thread/thread/a2d5b1ad718b3277/can
I proceed with getting and upgrading the lastest Android 1.5 images
from
HTC listed at http://www.htc.com/www/support/android/adp.html but a T-mobile
staff discourages it, any advice is really appreciated before I proceed.

Are there any official instructions from Google itself on this?

On Wed, Aug 5, 2009 at 11:09 PM, Dollars 5 dollars5ad...@gmail.com wrote:

 Hello All,

 We just bought a regular consumer HTC Magic/G2 phone in India and it
 is unlocked. We would like to root + upgrade to Android 1.5 OS to
 proceed with development, what is the process? are there any proper
 knowledgebase or documentation on the process of rooting and upgrade?

 Any help is very much appreciated.

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



[android-developers] Re: Displaying virtual keyboard in a custom View

2009-08-06 Thread Harsha

Hi Martin,

You seem to have achieved what I have been trying to do. I am working
on a sample input method MyIME and I have not been able to get the
input method pop-up menu to display my My IME as one of the
available options. Can you please shed some light on how got this
working?

I have submitted my post How to get android to show my IME in the
input method pop-up menu? where I have mentioned the 3 approaches I
have taken that has not worked so far. (http://groups.google.com/group/
android-platform/browse_thread/thread/9afe1c301df3e35?hl=en)

Your inputs and answers will be very much appreciated.

Thanks  Regards,
Harsha





On Jul 28, 4:56 am, LambergaR martin.s...@gmail.com wrote:
 Hello all!

 I am building a custom view and would like to pragmatically display
 the default on-screen input method (if any) when certain conditions
 are met. Due to some specific features of the view I am not able to
 reuse the TextView and EditText views with all the functionality
 already present. The idea was to simply display the keyboard and
 capture the keypress events in the view.

 inputMethodManager = (InputMethodManager) getSystemService
 ( Context.INPUT_METHOD_SERVICE );
 inputMethodManager.showSoftInput ( editorView,
 InputMethodManager.SHOW_FORCED );

 While the approach seems to work with EditText I was not able to show
 the on-screen keyboard ( showInputMethodPicker () seems to work ).
 While browsing the TextView source code I came across the following
 method:

 @Override public InputConnection onCreateInputConnection(EditorInfo
 outAttrs)

 that (basically) returns

 InputConnection ic = new EditableInputConnection(this);

 I was not able to find the class EditableInputConnection in the
 documentation or in the source code.

 I would appreciate any kind of advice on how to show the on screen
 keyboard and how to properly register my view so it can receive the
 keypress events.

 Many Thanks,
 Martin 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] Re: Developing on a regular consumer HTC Magic device

2009-08-06 Thread Dollars Admin
No worries - I figured it out myself. HTC Magic already runs Android OS 1.5
and from the IDE - I was able to enable debugging.

On Wed, Aug 5, 2009 at 11:20 PM, Dollars Admin dollars5ad...@gmail.comwrote:

 I searched this group and at the dev guide at
 http://developer.android.com/guide/developing/device.html - but no
 specific info on HTC Magic.

 As I found here:
 http://groups.google.com/group/android-developers/browse_thread/thread/a2d5b1ad718b3277/can
  I proceed with getting and upgrading the lastest Android 1.5 images from
 HTC listed at http://www.htc.com/www/support/android/adp.html but a
 T-mobile staff discourages it, any advice is really appreciated before I
 proceed.

 Are there any official instructions from Google itself on this?


 On Wed, Aug 5, 2009 at 11:09 PM, Dollars 5 dollars5ad...@gmail.comwrote:

 Hello All,

 We just bought a regular consumer HTC Magic/G2 phone in India and it
 is unlocked. We would like to root + upgrade to Android 1.5 OS to
 proceed with development, what is the process? are there any proper
 knowledgebase or documentation on the process of rooting and upgrade?

 Any help is very much appreciated.




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



[android-developers] Re: Using AsyncTask as Serializable or Parcelable -- To void activity destruction(orientation or during incoming phone call)

2009-08-06 Thread Maher Ali
Vikas,

Maybe you  can create a mediator  for every activity type.
If an activity wants something from the server, it adds a job to this
mediator
passing its *this* as the key.
The mediator will then contact a server proxy that does the server
interaction async by default. The mediator can ask the activity to show a
busy signal or not (it depends.)
When the server finishes the job, it calls onSuccess on an object of an
anonymous class
passed by the mediator. The mediator then checks to see if the activity has
not been destroyed (the activity will cancel the job by removing its *this*
from the mediator's job list on its destruction.)
If it has (no entry for that activity,) it discards the server's result. If
not, it delivers the result
to the activity (to refresh, etc.) and removes the job from its list.

Hope this helps.

Regards,
Maher


On Wed, Aug 5, 2009 at 1:49 PM, Vikas vik...@hotmail.com wrote:


 Hello David/Mark,

 Thanks a lot for replying.

 Since this use case is so common that any form based application needs
 it and I think a correct answer to this will avoid lots of pains and
 confusions for many people who are trying to write any enterprise
 level applications.

 Let me just describe a very simple use case step by step(rather than a
 big paragraph above It is still big{sorry about that}) : I am asking
 now in a more general way.

 I will take a two screen scenario.

 Here are Requirements(Steps):
 1.) Screen 1 -- Search Screen which has a zip entry editText field
 and a Find button next to it.
 2.) Screen 2. -- Store List screen that will contain list of all
 stores existing in that zip code.(now if the user clicks on one of the
 stores he goes to details but I wont even go there lets have just 2
 screen scenario).
 3.) Screen 1 can also display a Validation error(this validation will
 be done at server) whether that zip code is valid or not and if its
 not Screen 1 will display error dialog.

 4.) Since we want to avoid multiple concurrent requests on screen, we
 want to popup progress dialog imediately as soon as user clicks find
 button and hide it as oona s the response comes back from server
 (whether its a validation error or valid results).

 5.) The communication to server is using HTTPClient and as soon as
 response is read(which will be an string xml) from server, a parser
 will get invoked which will convert this strng xml to a single
 business object(which will contain erro code in case of error or valid
 data in case no error occured). This whole http part plus parsing part
 should be a single atomic unit as both take time, so this becomes our
 single atomic long running process the result of that process will be
 a business object returned to the Screen 1.

 6.) As soon as Screen 1 gets this object progress dialog will get
 dismissed, then screen1 will peek into object if it find error code
 will show error dialog and if it does not find error code will extract
 valid data stuff it in Intent and the pass it to Screen2 which in turn
 extract this data and display list of stores.


 7.) Now Suppose say Screen 1 triggers this long running process(after
 the user hits find button) and is say still waiting on it following
 thngs may happen:

 Case 1: User changes orientation(Activity will destroyed in this case)
 Case 2: A phone call comes in(Activity will go in background and may
 get destroyed by OS for any reason may be low memory)
 Case 3: Any other xyz scenario where activity can go in background and
 hence becomes a potential candidate for destruction.


 Questions:

 1.) What is the right place to put this long runing task to, and
 remember this task or process (once complete) needs to communicate
 back to the Screen1(activity) too for two resons first closing the
 dialog box and second handing over the business object to it so that
 it can stuff it in intent (or in some other scenarios just use it some
 screen fields etc.). And this task should not get affected(i.e. should
 keep on running) in cases where activity gets destroyed by OS(3 cases
 mentioned above)

 Is it Async Task or Local service or any third way?(And how will a
 newly created activity attach itself to this old long running process)


 --Going back to Dianne's reply(again I might be wrong here, I was
 serializing Async Task and not the thread which it creates in
 background so thats why my prototype worked, I agree u can not
 serialize a thread but I thought when u do asyncTask.execute creates
 another thread which does processing and then post result back to
 postExecute method so can we not serialize the task, again you do not
 have to answer it if it does not make sense but if u or mark or any
 other person can provide solution to the above UseCase in general that
 would be great.

 I have to create 100 such screens and a solid foundation will go long
 way.

 Thanks to all you guys in advance.







 On Aug 5, 1:56 pm, Dianne Hackborn hack...@android.com wrote:
  Well, using AsyncTask with serialization 

[android-developers] Re: OutofMemory Excpetion in built in ZoomControls of mapView

2009-08-06 Thread Romain Guy

This is not a bug in the zoom controls, your application is just using
too much memory.

On Thu, Aug 6, 2009 at 1:06 AM,
smilingmmarcus.masekow...@googlemail.com wrote:

 Hello,

 I wonder why I sometimes get an OutOfMemory Exception in mapView when
 scrolling around on map and zooming in to the max Zoomlevel? Is this a
 bug in the Zoomcontrols or MapView Lib??

 Thanks for your help!

 Here the stacktrace:

 uncaught handler: thread main exiting due to uncaught exception
 E/AndroidRuntime( 1784): java.lang.OutOfMemoryError: bitmap size
 exceeds VM budget
 E/AndroidRuntime( 1784): at android.graphics.Bitmap.nativeCreate
 (Native Method)
 E/AndroidRuntime( 1784): at android.graphics.Bitmap.createBitmap
 (Bitmap.java:483)
 E/AndroidRuntime( 1784): at
 com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:305)
 E/AndroidRuntime( 1784): at com.google.android.maps.ZoomHelper.doZoom
 (ZoomHelper.java:137)
 E/AndroidRuntime( 1784): at com.google.android.maps.ZoomHelper.doZoom
 (ZoomHelper.java:126)
 E/AndroidRuntime( 1784): at com.google.android.maps.MapView.doZoom
 (MapView.java:1454)
 E/AndroidRuntime( 1784): at com.google.android.maps.MapView.doZoom
 (MapView.java:1463)
 E/AndroidRuntime( 1784): at com.google.android.maps.MapView$5.onZoom
 (MapView.java:1418)
 E/AndroidRuntime( 1784): at android.widget.ZoomButtonsController
 $4.onClick(ZoomButtonsController.java:275)
 E/AndroidRuntime( 1784): at android.view.View.performClick(View.java:
 2180)
 E/AndroidRuntime( 1784): at android.view.View.onTouchEvent(View.java:
 3846)
 E/AndroidRuntime( 1784): at android.widget.ZoomButton.onTouchEvent
 (ZoomButton.java:62)
 E/AndroidRuntime( 1784): at android.view.View.dispatchTouchEvent
 (View.java:3386)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:863)
 E/AndroidRuntime( 1784): at
 android.widget.ZoomButtonsController.onTouch
 (ZoomButtonsController.java:582)
 E/AndroidRuntime( 1784): at android.view.View.dispatchTouchEvent
 (View.java:3382)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:831)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:863)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:863)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:863)
 E/AndroidRuntime( 1784): at android.view.ViewGroup.dispatchTouchEvent
 (ViewGroup.java:863)
 E/AndroidRuntime( 1784): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.superDispatchTouchEvent(PhoneWindow.java:1710)
 E/AndroidRuntime( 1784): at
 com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
 (PhoneWindow.java:1197)
 E/AndroidRuntime( 1784): at android.app.Activity.dispatchTouchEvent
 (Activity.java:1993)
 E/AndroidRuntime( 1784): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.dispatchTouchEvent(PhoneWindow.java:1694)
 E/AndroidRuntime( 1784): at android.view.ViewRoot.handleMessage
 (ViewRoot.java:1525)
 E/AndroidRuntime( 1784): at android.os.Handler.dispatchMessage
 (Handler.java:99)
 E/AndroidRuntime( 1784): at android.os.Looper.loop(Looper.java:123)
 E/AndroidRuntime( 1784): at android.app.ActivityThread.main
 (ActivityThread.java:3952)
 E/AndroidRuntime( 1784): at java.lang.reflect.Method.invokeNative
 (Native Method)
 E/AndroidRuntime( 1784): at java.lang.reflect.Method.invoke
 (Method.java:521)
 E/AndroidRuntime( 1784): at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:782)
 E/AndroidRuntime( 1784): at com.android.internal.os.ZygoteInit.main
 (ZygoteInit.java:540)
 E/AndroidRuntime( 1784): at dalvik.system.NativeStart.main(Native
 Method)

 




-- 
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] Service lifecycle and persistent objects

2009-08-06 Thread droidin.net

I need to retain a complex object in my service, so I can reliably
come back to it (it holds updates). Initially I coded it just as a
class filed in my Service implementation but I'm observing that the
updates object is periodically reset to null which tells me that
server class itself is recreated. Can someone recommend lightweight
reliable strategy to save and recreate such updates object (I can make
it serializable)

Thanks,

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



[android-developers] TrackBall 'flinging'

2009-08-06 Thread n179911

Hi,

In android address book, I can 'fling' with a TrackBall. i.e. the
ListView page up/down if I 'fling' with TrackBall (not fling on touch
screen).
However, when I look at the AddressBook Code or ListView Code, I don't
see it implements 'dispatchTrackBall' method.

Can you please tell me how is that implemented?

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: Problem with TranslateAnimation

2009-08-06 Thread Deren

Hm, exactly what is your question? :)

An animation doesnt actually move the object permanently, it just
translates the Canvas during the Animation. I assume you want your
View to stay where the animation left it? Why do you put the
v.setLayoutParams from a separate Thread? Is that really needed?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Why is it Giving Out Put Twice

2009-08-06 Thread saptarshi chatterjee
Sorry Nelissen. U wr right .Actually I made a grave mistake . So I deleted
this post from the community as well. Thank you fr ur help none the less.



On Thu, Aug 6, 2009 at 2:05 AM, Marco Nelissen marc...@android.com wrote:

 Looks to me like every time you run your app, you insert two more rows in
 to the database, so the first it will have 2 rows, then 4, 6, 8, etc.



 On Wed, Aug 5, 2009 at 1:12 PM, saptarshi chatterjee 
 saptarshichatterj...@gmail.com wrote:


 package com.outp.inp;





 import android.app.Activity;
 import android.content.ContentValues;
 import android.content.Context;
 import android.database.Cursor;
 import android.database.SQLException;
 import android.database.sqlite.SQLiteDatabase;
 import android.database.sqlite.SQLiteOpenHelper;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.Toast;


 public class myact extends Activity {


public static final String KEY_ROWID = _id;
public static final String KEY_VEHICLE = vehicle;
public static final String KEY_ROUTE = route;
public static final String KEY_COUNTRY = country;
public static final String KEY_CITY = city;
private static final String TAG = DBAdapter;

private static final String DATABASE_NAME = publicTransport;
private static final String DATABASE_TABLE = vehicleTable;
private static final int DATABASE_VERSION = 1;

long id;
Cursor c;

private static final String DATABASE_CREATE =
create table vehicleTable (_id integer primary key
 autoincrement, 
+ vehicle text not null, route text not null, 
+ country text not null,city text not null);;


private  final Context context=this;
private DatabaseHelper DBHelper;
private SQLiteDatabase sqlitedatabase;








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


DBHelper = new DatabaseHelper(context);
sqlitedatabase = DBHelper.getWritableDatabase();

id = insertRow(
12c/2,Dum Dum
 Park,Howrah,India,Kolkata);
 id = insertRow(
227,Bangur,Khidirpur,India,Kolkata);
 Toast.makeText(this, new \n\n+id,Toast.LENGTH_LONG).show();


 Cursor c = getAllRows();
 if (c.moveToFirst())
 {
 do {
 DisplayRow(c);
 } while (c.moveToNext());
 }
 sqlitedatabase.close();



}



private static class DatabaseHelper extends SQLiteOpenHelper
{
DatabaseHelper(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);

}


public void onCreate(SQLiteDatabase db)
{

db.execSQL(DATABASE_CREATE);


}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion,
  int newVersion)
{
Log.w(TAG, Upgrading database from version  +
 oldVersion
  +  to 
  + newVersion + , which will destroy all old data);
db.execSQL(DROP TABLE IF EXISTS titles);
onCreate(db);
}
}





public long insertRow(String vehicle, String route, String
 country,String city)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_VEHICLE, vehicle);
initialValues.put(KEY_ROUTE, route);
initialValues.put(KEY_COUNTRY, country);
initialValues.put(KEY_CITY, city);
return sqlitedatabase.insert(DATABASE_TABLE, null,
 initialValues);
}




public Cursor getAllRows()
{
return sqlitedatabase.query(DATABASE_TABLE, new String[] {
KEY_ROWID,
KEY_VEHICLE,
KEY_ROUTE,
KEY_COUNTRY,
KEY_CITY},
null,
null,
null,
null,
null);
}




public void DisplayRow(Cursor c)
{
Toast.makeText(this,
id:  + c.getString(0) + \n +
VEHICLE:  + c.getString(1) + \n +
ROUTE:  + c.getString(2) + \n +
COUNTRY:   + c.getString(3)+
CITY:   + c.getString(4),
Toast.LENGTH_LONG).show();
}






  }


-

 According to me the out put of these prgrm should be

 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata

 But Out put is coming as--

 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata
 1 12c/2,Dum Dum Park,Howrah,India,Kolkata
 2 227,Bangur,Khidirpur,India,Kolkata


 I have seen others prgrmms too that's giving same output twice . Can
 any one please explain??







 



-- 
Saptarshi Chatterjee
fireup.co.in : Igniting 

[android-developers] Re: TrackBall 'flinging'

2009-08-06 Thread Dianne Hackborn
The system automatically converts trackball events into DPAD events if they
aren't handled by the app.

On Thu, Aug 6, 2009 at 9:11 AM, n179911 n179...@gmail.com wrote:


 Hi,

 In android address book, I can 'fling' with a TrackBall. i.e. the
 ListView page up/down if I 'fling' with TrackBall (not fling on touch
 screen).
 However, when I look at the AddressBook Code or ListView Code, I don't
 see it implements 'dispatchTrackBall' method.

 Can you please tell me how is that implemented?

 Thank you.

 



-- 
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: Displaying virtual keyboard in a custom View

2009-08-06 Thread Dianne Hackborn
Have you looked at the documentation?

http://developer.android.com/reference/android/view/View.html#onCreateInputConnection(android.view.inputmethod.EditorInfo)

http://developer.android.com/reference/android/view/inputmethod/InputConnection.html

http://developer.android.com/reference/android/view/inputmethod/BaseInputConnection.html

On Tue, Jul 28, 2009 at 1:56 AM, LambergaR martin.s...@gmail.com wrote:


 Hello all!

 I am building a custom view and would like to pragmatically display
 the default on-screen input method (if any) when certain conditions
 are met. Due to some specific features of the view I am not able to
 reuse the TextView and EditText views with all the functionality
 already present. The idea was to simply display the keyboard and
 capture the keypress events in the view.

 inputMethodManager = (InputMethodManager) getSystemService
 ( Context.INPUT_METHOD_SERVICE );
 inputMethodManager.showSoftInput ( editorView,
 InputMethodManager.SHOW_FORCED );

 While the approach seems to work with EditText I was not able to show
 the on-screen keyboard ( showInputMethodPicker () seems to work ).
 While browsing the TextView source code I came across the following
 method:

 @Override public InputConnection onCreateInputConnection(EditorInfo
 outAttrs)

 that (basically) returns

 InputConnection ic = new EditableInputConnection(this);

 I was not able to find the class EditableInputConnection in the
 documentation or in the source code.

 I would appreciate any kind of advice on how to show the on screen
 keyboard and how to properly register my view so it can receive the
 keypress events.

 Many Thanks,
 Martin S.
 



-- 
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] Directory naming convention for application data in SDCARD ?

2009-08-06 Thread elpix1

Hi,

I have seen some apps store data in:
 /sdcard/package-name
 and others in:
/sdcard/data/package-name

 Is there a recommended standard for this ?

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



[android-developers] Re: TrackBall 'flinging'

2009-08-06 Thread n179911

On Thu, Aug 6, 2009 at 9:35 AM, Dianne Hackbornhack...@android.com wrote:
 The system automatically converts trackball events into DPAD events if they
 aren't handled by the app.


Thank you. But i only see these DPAD defines in KeyEvent, They don't
relate to 'fling' action, right, they just move focus
up/down/left/right?

public static final int KEYCODE_DPAD_UP = 19;
public static final int KEYCODE_DPAD_DOWN   = 20;
public static final int KEYCODE_DPAD_LEFT   = 21;
public static final int KEYCODE_DPAD_RIGHT  = 22;
public static final int KEYCODE_DPAD_CENTER = 23;

And I have looked at Gesture Detector code as well, it only handles:
MotionEvent.ACTION_DOWN, ACTION_MOVE, ACTION_UP, ACTION_CANCEL, I
don't see how Gesture Dectector intercepts any DPAD events or responds
to any trackball events.

Thank you for any more help.


 On Thu, Aug 6, 2009 at 9:11 AM, n179911 n179...@gmail.com wrote:

 Hi,

 In android address book, I can 'fling' with a TrackBall. i.e. the
 ListView page up/down if I 'fling' with TrackBall (not fling on touch
 screen).
 However, when I look at the AddressBook Code or ListView Code, I don't
 see it implements 'dispatchTrackBall' method.

 Can you please tell me how is that implemented?

 Thank you.





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

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


 


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



  1   2   >