[android-developers] Re: Problem with Dialog theme when launching from another activity

2009-08-28 Thread ANKIT SOMANI
Thanks Niko,

Yes I think that was the problem. It worked for me that way.

Regards
~Ankit Somani



2009/8/27 niko20 nikolatesl...@yahoo.com


 Use the handler class with a postDelayed call on it, and in the
 function the handler calls it will look like this:

 private Runnable ShowHelpFirstTime = new Runnable(){
public void run()
{

Intent i = new Intent(electrum.this, helppage.class);

startActivityForResult(i, 12);

}
};


 On Aug 25, 11:49 pm, ANKIT SOMANI ankitsomani...@gmail.com wrote:
  Any Suggestions ...??
 
  Regards
  ~Ankit Somani
 
  2009/8/24 ANKIT SOMANI ankitsomani...@gmail.com
 
   This Problem is with the Cupcake 1.5 release, I tried it with 1.1 it
 was
   working there.
 
   Regards
   ~Ankit Somani
 
   2009/8/24 suchita bhardwaj suchi.bhard...@gmail.com
 
   Hi,
   I am also facing the same problem. Can anyone suggest something?
 
   On Mon, Aug 24, 2009 at 12:00 PM, ANKIT SOMANI 
 ankitsomani...@gmail.comwrote:
 
   Problem is with the Child activity, with the Theme.dialog
 
   2009/8/24 ANKIT SOMANI ankitsomani...@gmail.com
  
   Hi all,
 
   I am facing a strange problem. I have 2 activities.  The Second
 activity
   having the theme.Dialog (set in manifest). when I launched the
 second
   activity from first activity via startActivityforResult(). The
 Second
   activity is not Visible. When i minimize it  launched it again then
 its
   showing.
 
   ahere are my 2 classes.
 
   Activity 1 :
 
   package com.startActivityTest;
 
   import android.app.Activity;
   import android.content.Intent;
   import android.os.Bundle;
 
   public class StartActivityTest extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   Intent intent = new Intent();
 
   setContentView(R.layout.main);
 
  
 intent.setClassName(com.startActivityTest,com.startActivityTest.StartActivityTest1);
 
   startActivityForResult(intent,1);
 
   }
   }
 
   Activity 2 :
 
   package com.startActivityTest;
 
   import android.app.Activity;
   import android.os.Bundle;
 
   public class StartActivityTest1 extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main2);
   }
   }
 
   main.xml
 
   ?xml version=1.0 encoding=utf-8?
   LinearLayout xmlns:android=
 http://schemas.android.com/apk/res/android
   
   android:orientation=vertical
   android:layout_width=fill_parent
   android:layout_height=fill_parent
 
   TextView
   android:layout_width=fill_parent
   android:layout_height=wrap_content
   android:text=Activity 1
   /
   /LinearLayout
 
   main2.xml
 
   ?xml version=1.0 encoding=utf-8?
   LinearLayout xmlns:android=
 http://schemas.android.com/apk/res/android
   
   android:orientation=vertical
   android:layout_width=fill_parent
   android:layout_height=fill_parent
 
   TextView
   android:layout_width=fill_parent
   android:layout_height=wrap_content
   android:text=Dialog Activity
   /
   /LinearLayout
 
   AndroidManifest.xml
 
   ?xml version=1.0 encoding=utf-8?
   manifest xmlns:android=http://schemas.android.com/apk/res/android
 
 package=com.startActivityTest
 android:versionCode=1
 android:versionName=1.0
   application android:icon=@drawable/icon
   android:label=@string/app_name
   activity android:name=.StartActivityTest
 android:label=Launcher Acitivity
   intent-filter
   action android:name=android.intent.action.MAIN /
   category
   android:name=android.intent.category.LAUNCHER /
   /intent-filter
   /activity
 
   activity android:name=.StartActivityTest1
   android:theme=@android:style/Theme.Dialog
 android:label=Dialog Activity
   intent-filter
   action android:name=android.intent.action.MAIN /
   category
 android:name=android.intent.category.DEFAULT
   /
   /intent-filter
   /activity
 
   /application
   uses-sdk android:minSdkVersion=3 /
   /manifest
 
   please suggest any solution or correct me if i am wrong.
 
   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: Problem Using Jar File

2009-08-28 Thread Atif

Thanks Mark,

But my jar file is referring number of layouts (about 10) and these
layouts contains number of ids (about 100). It is difficult to pass so
many ids as parameters. We also try to include the R file in jar and
in code we refer this R file as com.mypackage.R.layout.* and
com.mypackage.R.id.* etc.

But still client file look ups its own generated R file.

Any workaround?

Thanks and regards,
Atif Gulzar

On Aug 28, 11:36 am, Mark Murphy mmur...@commonsware.com wrote:
             Thanks for your reply.Right now we are not using the R file of
  that project whose jar file is created.Jar file does not contains R files
  of
  that project.So R.layout and R.id's are created in the client project
  where
  i am using jar file.

 And that is precisely your problem, if the Java code in the JAR file tries
 using R.layout, R.id, and kin.

 Go through the Java code that is going into the JAR. Remove all references
 to R.layout, R.id, R.drawable, and so on. Augment your API such that those
 values are passed in as parameters.

 If your Java code in the JAR does not reference R.layout, R.id,
 R.drawable, and so on, then your JAR is fine. Do a clean build of your
 project (e.g., get rid of the contents of gen/ and bin/), and you should
 be OK.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to build adb.exe for windows.

2009-08-28 Thread Kyo Yin

old framework of adb in target === means i don`t use the composite
driver in target if the host is ubuntu.you know, before composite
gadget driver, the adb is a single gadget driver(kernel 2.6.25).
kernel 2.6.29 add a composite gadget driver, mass storage and adb are
the functions of this composite gadget driver.

 Are you saying that the usb transfer seen when using windows is same
as linux, except the 0 length packet ?=== yse, in ubuntu, host will
send 0 length packet after a packet which size is 4096 or the multiple
of 64 and our usb protocol analyzer can catch this 0 length packet. In
windows, our analyzer cannot catch this 0 length packet. But i have
checked the usb_windows.c, it will send a 0 length packet.So i guess
the usb driver in windows block this 0 length packet?

2009/8/28 Tejas tejas.path...@gmail.com

 I am assuming you meant 4096 bytes.. What do you mean by.. BTW, For
 linux host, i use old framework of adb in target ? Are you saying
 that the usb transfer seen when using windows is same as linux, except
 the 0 length packet ?

 On Aug 27, 12:21 am, Kyo Yin kyo@gmail.com wrote:
  thank you for help.i have built the adb.exe
 
  and i have a question:
  In my opinion, adb will send a 0 length packet after a packet if thie packet
  length is multiple of the max length of endpoint.
  For example, our endpoint is 64 bytes. So after every 4096 packets, adb.exe
  should send a 0 length packet.
 
  I found the adb.exe has already try to send a 0 length packet.but
  1.in linux host, our usb analyzer can catch the 0 length packet.
  2.in windows host, our usb analyzer can not catch this 0 length packet.
 
  Did the widows driver block this 0 length packet?
 
  BTW, For linux host, i use old framework of adb in target, The composite
  driver can not run in ubuntu 8.04.
  For windows host, i use composite driver which has mass storage and adb in
  target.
 
  2009/8/19 Roman ( T-Mobile USA) roman.baumgaert...@t-mobile.com
 
 
 
 
 
   For being able to compile an exe file on Ubuntu you would have to
   cross compile on Ubuntu which means you have to have a Windows cross
   compiler on it. Do you?
 
   If not then install Cygwin on your windows environment and try it
   again. Make sure that you read the related topics about Android/Cygwin
   compilation to be aware of any possible provlems.
 
   --
   Roman Baumgaertner
   Sr. SW Engineer-OSDC
   ·T· · ·Mobile· stick together
   The views, opinions and statements in this email are those of the
   author solely in their individual capacity, and do not necessarily
   represent those of T-Mobile USA, Inc.
 
   On Aug 18, 9:38 pm, Kyo Yin kyo@gmail.com wrote:
hi roman    1.How do you try to compile?
    i just use make HOST_OS=windows in ubuntu.
    2.Are you doing this on Cygwin?
    no.i use ubuntu.
 
    do you mean i should use cygwin to build adb.exe for windows?
 
kyo
3273
 
2009/8/19 Roman ( T-Mobile USA) roman.baumgaert...@t-mobile.com
 
 How do you try to compile? Are you doing this on Cygwin?
 
 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.
 
 On Aug 18, 5:41 am, Kyo kyo@gmail.com wrote:
  hi,everyone.
      i want to modify the usb_windows.c in /system/core/adb and
  recompile a new adb.exe to test our platform.
      but, when i use make HOST_OS=windows, it failed.
      i use ubuntu 8.04 and i can build with make HOST_OS=linux.
      does anyone know how to build my adb.exe?
 
      thanks
 
  kyo
 

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



[android-developers] Apn Switching to default

2009-08-28 Thread santosh kumar

Hi,

when ever Apn Swithed to default, if already one data application is
running with the specified APN, Does it will wait up to that data
application ends? or it will close that Data application also?

How can we set our Specified APN from the application?


Thanks
Santosh.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 do we take a Screenshot using ADB Comand Line

2009-08-28 Thread Prakash Vel

Thanks for the Reply on how to go about trying on Command Line using
the DDMS.Would dig into the framebufer_service.c for more clarity.

Thanks to others too for their input on  it

Regards
Prakash Vel


On Aug 27, 10:21 pm, Yusuf Saib (T-Mobile USA) yusuf.s...@t-
Mobile.com wrote:
 DDMS sends a string that essentially says give me ascreenshot to
 the device, which sends back image data, all through a socket. You
 could in theory take the DDMS code and repurpose it to your needs. You
 might start by taking a look at system/core/adb/framebuffer_service.c
 and who calls it. Bear in mind that you can't screencapture on the
 device unless you're running as root. DDMS gets around this by sending
 the string to a root process.

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

 On Aug 27, 5:48 am, Prakash Vel prakash...@gmail.com wrote:

  Read through Couple of articles , Most of them point to the DDMS
  through that we could take theScreenshot.

  However i am trying to capture the Emulator  screen from the Command
  Line.
  Not Sure how to tweak the framebuffer /Surface flinger to do the job.

  or is there any app that we could run in the background and get the
  job done.

  help will be much appreciated.

  Thanks and Regards
  Prakash Vel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Is the limit of memory heap only 6M?

2009-08-28 Thread Ramesh

Even after trying these methods i am getting the same error. The issue
is in my application i am trying to load lots of images and when i
navigate from one view to other, it still increases the memory. i.e.
it's not freeing up / optimizing the memory which is now unused.

Any idea how to deal with this ?


On Jul 1, 6:58 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Load the picture in the size you need it, by setting the
 BitmapFactory.Options.inSampleSize to a value larger than 1 (so far, i
 have only managed to use value that are powers of 2 for this
 inSampleSize attribute). Look at the api-docs for more info on this
 attribute.

 What i mean is that if you load the picture to be shown on your
 screen, you need only a 320x480 pic, i.e. a inSampleSize=4 would do.

 If you load your pic as a small thumbnail, even a larger value of
 inSampleSize would do.

 Also, if you load a pic to be shown on the screen, use RGB_565 and not
 ARGB_. RGB_565 uses only 2 bytes per pixel, ARGB_ uses 4 bytes
 per pixel.

 In my app, i have managed to load on full-sized RGB_565 (2048x1536)
 and a bunch of smaller pics at the same time. Or a 2 half-sized
 ARGB_ (1024x768) and a bunch of smaller sized pics at the same
 time.
 Two full-sized RGB_565 always got me that out-of-memory exception.

 I also wrote a 'bitmap-memory' notifier: Each class that created
 bitmaps listens to this notifier. If notified, these classes will
 recycle bitmaps and empty bitmap-caches (where possible). If another
 class needs to create a large bitmap it will signal this 'bitmap-
 notifier' to ask its listeners to clean up as much memory as possible.
 This has worked for me so far.

 On Jun 30, 11:00 pm, 楊健 y...@cycomtech.co.jp wrote:

  Thank you for you answer.

  I monitored the memory heap  by  Runtime.getRuntime().freeMemory() and
  totalMemory();.
  When my app starts (free is 700k,total is 2.7M)
  When I take picture,the picture is 1.2M (free is 700k,total 5M)
  The log shows 07-01 11:31:27.062: INFO/dalvikvm-heap(395): Grow heap (frag
  case) to 5.020MB for 1337498-byte allocation
  If I do not call System.gc() before i load the picture it will throw the OOM
  exception as I pasted.
  I thought at that time  I just to allocate for 1.2M.
  Is it means it is very dangerous to load picture ,I had better to check and
  release the memory every time?

  -Original Message-
  From: android-developers@googlegroups.com
  [mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy
  Sent: Wednesday, July 01, 2009 11:38 AM
  To: android-developers@googlegroups.com
  Subject: [android-developers] Re: Is the limit of memory heap only 6M?

  楊健 wrote:
   07-01 11:32:02.192: VERBOSE/QualcommCameraHardware(35): state
   transition QCS_WAITING_JPEG -- QCS_IDLE
   07-01 11:32:02.232: ERROR/dalvikvm-heap(395): 6291456-byte external
   allocation too large for this process.
   07-01 11:32:02.232: ERROR/(395): VM won't let us allocate 6291456
   bytes
   07-01 11:32:02.242: DEBUG/AndroidRuntime(395): Shutting down VM
   07-01 11:32:02.242: WARN/dalvikvm(395): threadid=3: thread exiting
   with uncaught exception (group=0x4000fe70)
   07-01 11:32:02.242: ERROR/AndroidRuntime(395): Uncaught handler:
   thread main exiting due to uncaught exception
   07-01 11:32:02.302: ERROR/AndroidRuntime(395):
   java.lang.OutOfMemoryError: bitmap size exceeds VM budget

   My app shut down when i load a jpg file,i can avoid it by call
   system.gc().But I think memory limit  will be 14M or 16M.

  The available heap is 16MB. That does not necessarily mean that there is
  a contiguous 6MB buffer that you can allocate, depending on what else
  your application is doing.

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

  Android App Developer Books:http://commonsware.com/books.html-Hide quoted 
  text -

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



[android-developers] How send DTMF in android?

2009-08-28 Thread Gulfam

Hi all,

I am facing a problem on sending DTMF in android.
I am sending DTMF in this format  tel:+15187127050,9563547896#
Its working fine on G1 but when i install the app on HTC Hero /HTC
Magic its dispalying error message like this (Invalid MMI)

Any one can help me regarding this.

Thanks in advance.
Gulfam




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

2009-08-28 Thread santosh kumar

Hi Suziki,

Thanks for quick reply.

Can you please tell me where can i find in Android Source Code?

Thanks
Santosh

On Aug 28, 9:28 am, suziki suziki790...@gmail.com wrote:
 Hi santosh kumar:I think using API mapping RIL /AT command (CPIN) for check
 is sim card
 using CRSM = CLA(0x00=3G) check is USIM, in ISIM card, please using Open
 channel command packet in CRSM or CSIM for
 enter to open a new logical  channel,
 using CSIM =read command (EFdir) for get ISIM aid.

 2009/8/28 santosh kumar santosh.1...@gmail.com





  Hi All,

  I have gone through the Android Source Code, I did't find any API to
  read ISIM information from the SIM Card.

  when does Android Support USIM and ISIM ?

  Can any body clarify me in this regard?

  Thanks
  Santosh- Hide quoted text -

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



[android-developers] Re: Problem Using Jar File

2009-08-28 Thread Mark Murphy

Thanks for your reply.Right now we are not using the R file of
 that project whose jar file is created.Jar file does not contains R files
 of
 that project.So R.layout and R.id's are created in the client project
 where
 i am using jar file.

And that is precisely your problem, if the Java code in the JAR file tries
using R.layout, R.id, and kin.

Go through the Java code that is going into the JAR. Remove all references
to R.layout, R.id, R.drawable, and so on. Augment your API such that those
values are passed in as parameters.

If your Java code in the JAR does not reference R.layout, R.id,
R.drawable, and so on, then your JAR is fine. Do a clean build of your
project (e.g., get rid of the contents of gen/ and bin/), and you should
be OK.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: Can an application get event that it is installed?

2009-08-28 Thread Mark Murphy

 In application, I want to do some operations when it is installed, how can
 I implement this feature?

You can't, short of modifying the Android firmware. The user must run your
application the first time.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: Monitoring cpu charge/usage : is it possible?

2009-08-28 Thread DaminouU

Thanks you very much !!

That's what I was searching for =D

D.

On Aug 27, 8:52 pm, Yusuf Saib (T-Mobile USA) yusuf.s...@t-
Mobile.com wrote:
 Just to be clear, this does not necessarily give you all the CPU-
 related data you're looking for, but it's all you can get
 programmatically.

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

 On Aug 27, 10:22 am, Yusuf Saib (T-Mobile USA) yusuf.s...@t-

 Mobile.com wrote:
 http://developer.android.com/reference/android/app/ActivityManager.html

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

  On Aug 27, 7:45 am, DaminouU dam.le...@gmail.com wrote:

   Ok but I want to get these values in my application, and maybe use
   them.

   So is it possible to recover these values from a running Android
   application?

   On Aug 27, 3:58 pm, Balwinder Kaur (T-Mobile USA) balwinder.k...@t-

   mobile.com wrote:
adb shell top

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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

On Aug 27, 5:45 am, DaminouU dam.le...@gmail.com wrote:

 Hello,

 Is it possible to find some information about CPU?

 Actually I would like to find the CPU usage. (50% for example)

 Just to know if the program is very light or if it is a heavy app'

 Thanks,

 D.


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

2009-08-28 Thread salza

Maybe I misunderstand something.

Let's say thread A of process A has the priority very important and
thread B of process B has the priority not so important.
In Android every process has its own Dalvik VM instance - so thread A
is in another instance than thread B. Therefor the priority of the
threads does only have an effect on other threads of the same Dalvik
VM instance. Right?
That's why (in my opinion) the thread priorities would not have an
effect on whether thread A or thread B will be done first as they are
in different Dalvik VM instances.

The thing I want to accomplish: I have another system environment
where very critical processes exist that need a high priority. If it
is not possible to sign it with a high priority I can't use Android
for development in that system environment.

Thanks.

On Aug 27, 8:23 pm, Dianne Hackborn hack...@android.com wrote:
 No, and Linux doesn't have this facility.  When you set the nice on a
 process, you are setting it on the main thread of the process.  Any threads
 it creates after that will inherit the priority of the original thread,
 however it will not impact any existing threads, and threads can later
 modify their priority.

 The only thing you can do afaik is restrict the best priority any thread can
 get, and that is associated with the uid and not the process.

 I have no clue what the relationship is between killing processes and
 setting process priorities.

 What exactly are you wanting to accomplish?



 On Thu, Aug 27, 2009 at 8:52 AM, salza floriansa...@googlemail.com wrote:

  So is there any method I can use, to set the priority for a process?
  Linux normally has this ability (e.g. nice - Set process priority of
  new processes)

  In the Android API I found a method to kill processes: killProcess(int
  pid)

  So is there any possibility for me as a developer to use a method like
  the killProcess-method zu manage the priority of a process?

  On Aug 26, 6:48 pm, Dianne Hackborn hack...@android.com wrote:
   Linux doesn't really associate priorities with processes...  or more
   accurately, in Linux a process is a unit of execution, so each thread is
   also actually a process (running in the same address space), with their
  own
   independent priorities.

   On Wed, Aug 26, 2009 at 4:29 AM, mstu...@googlemail.com 

   mstu...@googlemail.com wrote:

Thanks!

Ok, I can set priority for threads... but threads running in
processes... is it therefore possible to set priority for processes as
well...?

On 26 Aug., 00:04, 3crowntech 3crownt...@gmail.com wrote:
 Hi Matthias,

 You can set thread priority by android.os.Process.setThreadPriority
 method. This is how android controls resource allocation.
 Thanks.

 On Aug 26, 5:45 am, mstu...@googlemail.com mstu...@googlemail.com

 wrote:

  hi all,

  the Android web site indicates that all applications are created
  equal. What is the strategy to ensure that critical applications/
  services have priority?

  Are there any facilities Android does provide to ensure certain
  applications and/or threads to receive a minimum of CPU bandwith
  (and
  other apps/threads are prevented from consuming all the CPU
  bandwith)?

  Matthias- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

   --
   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.

 --
 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] Load of applications in RAM

2009-08-28 Thread salza

Does someone know when application are loaded into RAM?

I think I have do differentiate between home applications / built-in
applications like the phone application and application that are not
needed immediately after boot-up.

So are these different types of applications loaded into RAM at boot-
up or when they are first activated or when the first service is
requested (e.g. an incoming phone call)?

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



[android-developers] Re: Drawable

2009-08-28 Thread quill

Use a map to map your key and drawable id.

On Aug 28, 12:48 pm, Sasi Kumar sasikumar.it1...@gmail.com wrote:
 my code is:-

 Drawabel partlycloud=res.getDrawable(R.drawable.a65_color_31);

 I have more images like

 a65_color_31
 a66_color_31
 a67_color_31
 a68_color_31
 a69_color_31
 a70_color_31
 a71_color_31

 If user gives input as 67 then my drawable should be

 Drawabel partlycloud=res.getDrawable(R.drawable.a67_color_31);

 if it is 70

 Drawabel partlycloud=res.getDrawable(R.drawable.a70_color_31);

 like this i have more than 100 images how can give in simple code with
 less codes.

 please reply 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] CPU bandwidth control for threads/apps

2009-08-28 Thread salza

Does Android provide a facility to ensure certain applications and/or
threads receive a minimum of CPU bandwidth (and other apps/threads are
prevented from consuming all the CPU bandwidth)?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Toggling clicked item icon in gridView

2009-08-28 Thread RickardF

I found from looking at the stack trace that only GridView
(view).measure() gets called when I call myGrid.requestLayout() (see
first code snippet) but never GridView(view).layout(). Is this a bug
or how do I force layout to be done on my gridview? (I've tried
myGrid.forceLayout()...)

Thanks,
Rickard


On 27 Aug, 16:01, RickardF rickard.fahlqu...@gmail.com wrote:
 Hi all,
 I have agridViewwhere I want to be able to toggle the item icons
 when clicking them. So, when I click an item it gets selected which
 is indicated by, say, bitmap B and when I click it again it should be
 unselected and the item changes back to bitmap A.

 The problem is that I cannot get the grid to redraw after I have
 clicked one of the items so the clicked item never changes icon. I
 have tried to call requestLayout() but for some reason it only results
 in a two successive calls to the adaptor's getView(), both with
 position zero regardless of which item I clicked. What am I missing
 here?

 Here are some code snippets:



 ...
 finalGridViewmyGrid = (GridView) findViewById(...);
 ...
 myGrid.setOnItemClickListener(new AdapterView.OnItemClickListener()
         {
             @Override
             public void onItemClick(AdapterView? parent,
                     View view,
                     int position,
                     long id)
             {
                 // Toggle icon.
                 toggleIconState(position);

                myGrid.requestLayout();
             }
         });

  From my adaptor class (The getIcon() returns one of two bitmaps depending 
  on a state var. (selected/unselected))

 �...@override
     public View getView(int position, View convertView, ViewGroup
 parent)
     {
         ImageView imageView;

         if (convertView == null)
         {
             // Create the image view if we aren't recycling an old
 view.
             imageView = new ImageView(context);
             imageView.setScaleType(ImageView.ScaleType.FIT_XY);
         }
         else
         {
             imageView = (ImageView) (convertView);
         }

         // Use this position's asset group icon as the image view
 contents.
         imageView.setImageBitmap(getIcon(position));
         return imageView;
     }

 Any ideas are most welcome.

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



[android-developers] Re: Camera preview

2009-08-28 Thread Pavel

Hey tinyang,

Could you please share the code you use for picture taking? I am
working on the same thing and having weird issues with it - it does
not take full sized pictures for unknown reason...

And yeah, sorry, no answer to your question from my side at the moment.

Pavlo



On Thu, Aug 27, 2009 at 9:14 PM, tinyanggnay...@gmail.com wrote:

 Hello.

 I just got my camera preview working for my app, but it is not
 appearing
 where I want it to appear, and I'm not sure how to get it there.
 Instead of
 using the entire screen for the preview, I would like to put it inside
 a
 surfaceview in an activity xml gui.  What do I need to change?  Here
 is my
 code:

 public class TakePic extends Activity {

 SurfaceView camSurface;

 Preview camPreview;

 @Override

 protected void onCreate(Bundle savedInstanceState) {

 super.onCreate(savedInstanceState);

 requestWindowFeature(Window.FEATURE_NO_TITLE);//hide window title

 camPreview = new Preview(this); //create preview

 setContentView(R.layout.takepic);

 setContentView(camPreview); //set preview as activity content

 camSurface = (SurfaceView) findViewById(R.id.camsurface);

 }
 


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

2009-08-28 Thread Mark Murphy

 I think I have do differentiate between home applications / built-in
 applications like the phone application and application that are not
 needed immediately after boot-up.

 So are these different types of applications loaded into RAM at boot-
 up or when they are first activated or when the first service is
 requested (e.g. an incoming phone call)?

They are loaded into RAM when an Intent triggers them to be loaded into
RAM. Examples include clicking on an icon in the Launcher, responding to a
system broadcast Intent (e.g., BOOT_COMPLETED), when another application
starts one of their activities or remote services, etc.

As little as possible is loaded into RAM at system startup.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: Is the limit of memory heap only 6M?

2009-08-28 Thread Ramesh

08-28 11:16:26.785: ERROR/AndroidRuntime(1433): Uncaught handler:
thread main exiting due to uncaught exception
08-28 11:16:26.825: ERROR/AndroidRuntime(1433):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.graphics.drawable.Drawable.createFromResourceStream
(Drawable.java:663)
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.content.res.Resources.loadDrawable(Resources.java:1637)
08-28 11:16:26.825: ERROR/AndroidRuntime(1433): at
android.content.res.Resources.getDrawable(Resources.java:535)


On Jul 1, 6:58 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Load the picture in the size you need it, by setting the
 BitmapFactory.Options.inSampleSize to a value larger than 1 (so far, i
 have only managed to use value that are powers of 2 for this
 inSampleSize attribute). Look at the api-docs for more info on this
 attribute.

 What i mean is that if you load the picture to be shown on your
 screen, you need only a 320x480 pic, i.e. a inSampleSize=4 would do.

 If you load your pic as a small thumbnail, even a larger value of
 inSampleSize would do.

 Also, if you load a pic to be shown on the screen, use RGB_565 and not
 ARGB_. RGB_565 uses only 2 bytes per pixel, ARGB_ uses 4 bytes
 per pixel.

 In my app, i have managed to load on full-sized RGB_565 (2048x1536)
 and a bunch of smaller pics at the same time. Or a 2 half-sized
 ARGB_ (1024x768) and a bunch of smaller sized pics at the same
 time.
 Two full-sized RGB_565 always got me that out-of-memory exception.

 I also wrote a 'bitmap-memory' notifier: Each class that created
 bitmaps listens to this notifier. If notified, these classes will
 recycle bitmaps and empty bitmap-caches (where possible). If another
 class needs to create a large bitmap it will signal this 'bitmap-
 notifier' to ask its listeners to clean up as much memory as possible.
 This has worked for me so far.

 On Jun 30, 11:00 pm, 楊健 y...@cycomtech.co.jp wrote:

  Thank you for you answer.

  I monitored the memory heap  by  Runtime.getRuntime().freeMemory() and
  totalMemory();.
  When my app starts (free is 700k,total is 2.7M)
  When I take picture,the picture is 1.2M (free is 700k,total 5M)
  The log shows 07-01 11:31:27.062: INFO/dalvikvm-heap(395): Grow heap (frag
  case) to 5.020MB for 1337498-byte allocation
  If I do not call System.gc() before i load the picture it will throw the OOM
  exception as I pasted.
  I thought at that time  I just to allocate for 1.2M.
  Is it means it is very dangerous to load picture ,I had better to check and
  release the memory every time?

  -Original Message-
  From: android-developers@googlegroups.com
  [mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy
  Sent: Wednesday, July 01, 2009 11:38 AM
  To: android-developers@googlegroups.com
  Subject: [android-developers] Re: Is the limit of memory heap only 6M?

  楊健 wrote:
   07-01 11:32:02.192: VERBOSE/QualcommCameraHardware(35): state
   transition QCS_WAITING_JPEG -- QCS_IDLE
   07-01 11:32:02.232: ERROR/dalvikvm-heap(395): 6291456-byte external
   allocation too large for this process.
   07-01 11:32:02.232: ERROR/(395): VM won't let us allocate 6291456
   bytes
   07-01 11:32:02.242: DEBUG/AndroidRuntime(395): Shutting down VM
   07-01 11:32:02.242: WARN/dalvikvm(395): threadid=3: thread exiting
   with uncaught exception (group=0x4000fe70)
   07-01 11:32:02.242: ERROR/AndroidRuntime(395): Uncaught handler:
   thread main exiting due to uncaught exception
   07-01 11:32:02.302: ERROR/AndroidRuntime(395):
   java.lang.OutOfMemoryError: bitmap size exceeds VM budget

   My app shut down when i load a jpg file,i can avoid it by call
   system.gc().But I think memory limit  will be 14M or 16M.

  The available heap is 16MB. That does not necessarily mean that there is
  a contiguous 6MB buffer that you can allocate, depending on what else
  your application is doing.

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

  Android App Developer Books:http://commonsware.com/books.html-Hide quoted 
  text -

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

[android-developers] Re: Mapview deprecated

2009-08-28 Thread Zod

Hi!

To achive the same functionality use this code instead:

mapView = (MapView) findViewById(R.id.MapView);
mapView.setBuiltInZoomControls(true);

As a side effect you don't need to put the mapview in a relative
layout with a view for the zoom controls. Just put the mapview
anywhere in your layout xml just as you would with any other view.

On Aug 28, 9:54 am, sweet junkybr...@gmail.com wrote:
 Hi i've tested to do the tuto HelloMapView ti the URL:http://
 developer.android.com/intl/fr/guide/tutorials/views/hello-mapview.html
 and when i wrote the step 9:

 linearLayout = (LinearLayout) findViewById(R.id.zoomview);
 mapView = (MapView) findViewById(R.id.mapview);
 mZoom = (ZoomControls) mapView.getZoomControls();

 eclipse says that mapView.getZoomControls is deprecated ... By what
 can i replace that ???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] playing sound on active call

2009-08-28 Thread Honest

I am playing one audio file when call arrives so the  caller can
receive it at other side but the issue is  yet the opposite caller is
not able to listen it what could be wrong in it. Can some one tell me
what can be the issue in it ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Monitoring cpu charge/usage : is it possible?

2009-08-28 Thread DaminouU

Thanks you very much !!

That's what I was searching for =D

D.

On Aug 27, 8:52 pm, Yusuf Saib (T-Mobile USA) yusuf.s...@t-
Mobile.com wrote:
 Just to be clear, this does not necessarily give you all the CPU-
 related data you're looking for, but it's all you can get
 programmatically.

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

 On Aug 27, 10:22 am, Yusuf Saib (T-Mobile USA) yusuf.s...@t-

 Mobile.com wrote:
 http://developer.android.com/reference/android/app/ActivityManager.html

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

  On Aug 27, 7:45 am, DaminouU dam.le...@gmail.com wrote:

   Ok but I want to get these values in my application, and maybe use
   them.

   So is it possible to recover these values from a running Android
   application?

   On Aug 27, 3:58 pm, Balwinder Kaur (T-Mobile USA) balwinder.k...@t-

   mobile.com wrote:
adb shell top

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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

On Aug 27, 5:45 am, DaminouU dam.le...@gmail.com wrote:

 Hello,

 Is it possible to find some information about CPU?

 Actually I would like to find the CPU usage. (50% for example)

 Just to know if the program is very light or if it is a heavy app'

 Thanks,

 D.


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

2009-08-28 Thread sweet

thanks for your answer Zod I've done what you say but there are an
other problem but i can't find it with the debug mode.
I think it's in this part of code:

public void onCreate(Bundle savedInstanceState) {
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
linearLayout.addView(mZoom);
}

do you see anything wrong ?
thanks again
Sweet

On 28 août, 10:15, Zod zsolt.ba...@gmail.com wrote:
 Hi!

 To achive the same functionality use this code instead:

 mapView = (MapView) findViewById(R.id.MapView);
 mapView.setBuiltInZoomControls(true);

 As a side effect you don't need to put the mapview in a relative
 layout with a view for the zoom controls. Just put the mapview
 anywhere in your layout xml just as you would with any other view.

 On Aug 28, 9:54 am, sweet junkybr...@gmail.com wrote:

  Hi i've tested to do the tuto HelloMapView ti the URL:http://
  developer.android.com/intl/fr/guide/tutorials/views/hello-mapview.html
  and when i wrote the step 9:

  linearLayout = (LinearLayout) findViewById(R.id.zoomview);
  mapView = (MapView) findViewById(R.id.mapview);
  mZoom = (ZoomControls) mapView.getZoomControls();

  eclipse says that mapView.getZoomControls is deprecated ... By what
  can i replace that ???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: My sub activity doesn't die...

2009-08-28 Thread Charles

whaoo your command give me a large report.
Do you know how to avoid the restarting of my activity B, i close it
with finish();

adb shell dumpsys activity :

aProcessRecord{438b96e8 2966:com.android.mms/10009}
class=com.android.mms.MmsApp
manageSpaceActivityName=null
dir=/system/app/Mms.apk publicDir=/system/app/Mms.apk data=/data/
data/com.an
droid.mms
packageList=[com.android.mms]
instrumentationClass=null instrumentationProfileFile=null
instrumentationArguments=null
thread=android.app.applicationthreadpr...@43523428
curReceiver=null
pid=2966 starting=false lastPss=2527232
maxAdj=15 hiddenAdj=7 curRawAdj=7 setRawAdj=7 curAdj=7 setAdj=7
isForeground=false setIsForeground=false foregroundServices=false
forcingToF
oreground=null
persistent=false removed=false persistentActivities=0
debugging=false crashing=false null notResponding=false null
bad=false
activities=[]
services=[ServiceRecord{4379da78
com.android.mms/.transaction.TransactionSer
vice}]
executingServices=[]
connections=[]
pubProviders={}
conProviders=[ContentProviderRecord{435cdad0
com.android.providers.settings.
SettingsProvider}]
receivers=[ReceiverList{437f2240 2966 com.android.mms/10009 client
437f2010}
, ReceiverList{4354df00 2966 com.android.mms/10009 client 43576ce8},
ReceiverLis
t{43648380 2966 com.android.mms/10009 client 43653968}]
  *PERSISTENT* Process [system] UID 1000
ProcessRecord{4364ea00 56:system/1000}
class=null
manageSpaceActivityName=null
dir=/system/framework/framework-res.apk publicDir=/system/
framework/framewor
k-res.apk data=/data/system
packageList=[com.android.providers.subscribedfeeds,
com.google.android.serve
r.checkin, com.android.providers.settings, android]
instrumentationClass=null instrumentationProfileFile=null
instrumentationArguments=null
thread=android.app.activitythread$applicationthr...@4353b3f0
curReceiver=nul
l
pid=56 starting=false lastPss=0
maxAdj=-16 hiddenAdj=11 curRawAdj=0 setRawAdj=-100 curAdj=-16
setAdj=-100
isForeground=false setIsForeground=false foregroundServices=false
forcingToF
oreground=null
persistent=true removed=false persistentActivities=0
debugging=false crashing=false null notResponding=false null
bad=false
activities=[]
services=[ServiceRecord{436aa898
com.google.android.server.checkin/.CheckinS
ervice}]
executingServices=[]
connections=[ConnectionRecord{436b5760
com.android.inputmethod.latin/.LatinI
ME:@43754d48}]
pubProviders={android.content.SyncProvider=ContentProviderRecord
{435c4638 an
droid.content.SyncProvider},
com.android.providers.settings.SettingsProvider=Con
tentProviderRecord{435cdad0
com.android.providers.settings.SettingsProvider}, co
m.android.providers.subscribedfeeds.GoogleSubscribedFeedsProvider=ContentProvide
rRecord{435c54b0
com.android.providers.subscribedfeeds.GoogleSubscribedFeedsProv
ider},
com.google.android.server.checkin.CheckinProvider=ContentProviderRecord
{4
35caea0 com.google.android.server.checkin.CheckinProvider}}
conProviders=[]
receivers=[ReceiverList{436212c0 56 system/1000 client 43634778},
ReceiverLi
st{436aa3c0 56 system/1000 client 436aa290}, ReceiverList{43692900 56
system/100
0 client 436927b0}, ReceiverList{436fad48 56 system/1000 client
436fab08}, Recei
verList{43648408 56 system/1000 client 43648240}, ReceiverList
{43692f88 56 syste
m/1000 client 43692e38}, ReceiverList{43694508 56 system/1000 client
436943c8},
ReceiverList{436a9710 56 system/1000 client 436a9568}, ReceiverList
{436a2710 56
system/1000 client 436a24c8}, ReceiverList{43668f90 56 system/1000
client 43668f
30}, ReceiverList{4363af50 56 system/1000 client 43529c80},
ReceiverList{43736a5
8 56 system/1000 client 43738f80}, ReceiverList{43545498 56 system/
1000 client 4
3521950}, ReceiverList{435ef958 56 system/1000 client 434fca58},
ReceiverList{43
65f198 56 system/1000 client 4365f048}, ReceiverList{4369da18 56
system/1000 cli
ent 4369d8b8}, ReceiverList{436a0898 56 system/1000 client 436a0728},
ReceiverLi
st{436a9120 56 system/1000 client 436a8fe0}, ReceiverList{436a6da0 56
system/100
0 client 436a6c20}, ReceiverList{436519e0 56 system/1000 client
436127b8}, Recei
verList{43521ae0 56 system/1000 client 4354f688}, ReceiverList
{4361dca0 56 syste
m/1000 client 43558c40}, ReceiverList{435f6a60 56 system/1000 client
436283d0},
ReceiverList{436fd6e8 56 system/1000 client 436fd548}, ReceiverList
{436a1568 56
system/1000 client 436a13c0}, ReceiverList{43616f68 56 system/1000
client 4362c5
c8}, ReceiverList{43665268 56 system/1000 client 435af370},
ReceiverList{43645e2
8 56 system/1000 client 43636070}, ReceiverList{435ebee8 56 system/
1000 client 4
3557788}, ReceiverList{43670468 56 system/1000 client 43670328},
ReceiverList{43
6fcd70 56 system/1000 client 436fcbd0}, ReceiverList{435275b0 56
system/1000 cli
ent 43573420}, ReceiverList{4369e730 56 system/1000 client 4369e5d0},
ReceiverLi
st{4359f2f8 56 system/1000 client 

[android-developers] Android Animation. How to remove flashing effect ?

2009-08-28 Thread LD

Hi,

I am still trying to resolve task with animation flashing.

I use two ImageViews to create animation of moving ball. The animation
has following scenario:

ball is moving from left to right (TranslateAnimation is started).
ball stops (TranslateAnimation reached the end)
in animation listener I set left ImageView's drawable to NULL and set
right ImageView to display ball bitmap. Here I have flash effect.
after this I run second animation which moves ball from right to left.
Could you please help with the animation issue? What I didn't take
into account or what I missed here?

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



[android-developers] Re: How to capture and save the image of Google Map(MapView)...

2009-08-28 Thread idoun

Sorry. My solution is useless. I misunderstood the processes of DDMS
and maps library.

You don't have to inherit MapView class and override some methods of
that class.

Transfering image file from an emulator or a phone to my dev computer
using DDMS takes long time, about one more minute.
So, I thought that the image file creating was faild at that time

The codes that palce on top of this thread is no problem
programmatically.

Just attach one button or menu and move the saving codes from onCreate
method to other method which would be called by EventLister of the
button or menu.


On Aug 24, 3:57 pm, idoun idou...@gmail.com wrote:
 I solved this problem.

 The main issue of this problem is that theMapViewclass extends View
 class has 0 value of width and height. (I think every View classes
 have this issue...)

 To set the right size what I want, I extended theMapViewto MyMapView
 and overrided protected onSizeChanged method into MyMapView.

 And I called that method before saving the map.

 Then It works!

 Additionally, I should attach menu button to my app. for saving the
 map because the loading method of the map is asynchronous as you
 know
 Saving process is ended before loading the map if the process is in
 the onCreate method. :)

 On Aug 21, 9:10 pm, idoun idou...@gmail.com wrote:

  Dear Developers!

  I'm trying to develop a map application which can save some part of
  map inside a phone.

  So, refering to the example of google developer site, I created my
  activity that using theMapViewclass to display the location what I
  want to see. It works.

  And I attached some code to save that view into png format file using
  Bitmap and Canvas classes. But it didn't work.

  One image file was created but it didn't contain any information of
  the map. I don't know the reason why those codes didn't work and
  couldn't find any related information on the Web...

  code is...

  public class AndroidTest extends MapActivity {

         MapViewmapView;
          ListOverlay mapOverlays;
          Drawable drawable;
          HelloItemizedOverlay itemizedOverlay;

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

                  // build map and mark point
                 mapView= (MapView) findViewById(R.id.mapview);
                 mapView.setBuiltInZoomControls(true);

                  mapOverlays =mapView.getOverlays();
                  drawable = this.getResources().getDrawable
  (R.drawable.androidmarker);
                  itemizedOverlay = new HelloItemizedOverlay(drawable);

                  GeoPoint point = new GeoPoint(1924, -9912);
                  OverlayItem overlayitem = new OverlayItem(point, , );

                  itemizedOverlay.addOverlay(overlayitem);
                  mapOverlays.add(itemizedOverlay);

                  // copyMapViewto canvas
                  Bitmap bitmap = Bitmap.createBitmap(400, 800,
  Bitmap.Config.ARGB_);
                  Canvas canvas = new Canvas(bitmap);
                 mapView.draw(canvas);

                  // save it!
                  FileOutputStream fo = null;

                  try {
                          fo = this.openFileOutput(test.png, 
  Context.MODE_WORLD_WRITEABLE);
                  } catch (FileNotFoundException e) {
                          e.printStackTrace();
                  }

                  bitmap.compress(CompressFormat.PNG, 100, fo);

                  try {
                          fo.flush();
                  } catch (IOException e) {
                          e.printStackTrace();
                  }

                  try {
                          fo.close();
                  } catch (IOException e) {
                          e.printStackTrace();
                  }
          }

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



[android-developers] Re: Problem Using Jar File

2009-08-28 Thread Mark Murphy

 But my jar file is referring number of layouts (about 10) and these
 layouts contains number of ids (about 100). It is difficult to pass so
 many ids as parameters.

You can try Resources#getIdentifier(). If you get this working, please
cache your results, as these lookups are apparently expensive (Note: use
of this function is discouraged. It is much more efficient to retrieve
resources by identifier than by name.).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] advice sought - grid of thumbnails that do something when you click on them.

2009-08-28 Thread sdphil

i want to create a scrollable grid of thumbnail images with text
underneath each thumbnail.  when you click on one it will do
something.

should i use a GridView, a multi-column ListView, a TableLayout, or
other??

thoughts?

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



[android-developers] Mapview deprecated

2009-08-28 Thread sweet

Hi i've tested to do the tuto HelloMapView ti the URL:http://
developer.android.com/intl/fr/guide/tutorials/views/hello-mapview.html
and when i wrote the step 9:

linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mZoom = (ZoomControls) mapView.getZoomControls();

eclipse says that mapView.getZoomControls is deprecated ... By what
can i replace that ???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: advice sought - grid of thumbnails that do something when you click on them.

2009-08-28 Thread sdphil

http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-of-images.html

uses a GridView - but I don't see text under each photo...

On Aug 28, 1:00 am, sdphil phil.pellouch...@gmail.com wrote:
 i want to create a scrollable grid of thumbnail images with text
 underneath each thumbnail.  when you click on one it will do
 something.

 should i use a GridView, a multi-column ListView, a TableLayout, or
 other??

 thoughts?

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



[android-developers] Re: Is the limit of memory heap only 6M?

2009-08-28 Thread Mark Murphy

 Even after trying these methods i am getting the same error. The issue
 is in my application i am trying to load lots of images and when i
 navigate from one view to other, it still increases the memory. i.e.
 it's not freeing up / optimizing the memory which is now unused.

 Any idea how to deal with this ?

Tactically, load fewer images.

Strategically, find ways to help out with improvements to the Android
garbage collector.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] TextView Movement Method Issue

2009-08-28 Thread skink

hi,

when TextView's movement method is LinkMovementMethod i'm observing
weird behavior.

i have TextView inside ScrollView. TextView has some links
(ClickableSpans) and its text is quite large so it doesn't fit the
TextView's area. when i use DPAD down/up arrows TextView jumps on
links, scrolling accordingly to show current link. this is ok.

but when i for example jump to bottom link, then using touch scroll to
the middle of TextView and then try to use up DPAD arrow i have to
press up key several times to see any change in scrolling: as if up
arrow key jumped on links but without any visual effect (i mean
without any scrolling)

is it expected behavior or some kind of bug?

btw the same can be observed in Linkify demo when you enlarge text
size to some big value or add some extra text so that it doesn't fit
the screen.

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

2009-08-28 Thread Atif Gulzar
Thanks Mark, It works, I will look into it how to optimize it.


--
Best Regards,
Atif Gulzar

I  Unicode, ɹɐzlnƃ ɟıʇɐ



On Fri, Aug 28, 2009 at 1:52 PM, Mark Murphy mmur...@commonsware.comwrote:


  But my jar file is referring number of layouts (about 10) and these
  layouts contains number of ids (about 100). It is difficult to pass so
  many ids as parameters.

 You can try Resources#getIdentifier(). If you get this working, please
 cache your results, as these lookups are apparently expensive (Note: use
 of this function is discouraged. It is much more efficient to retrieve
 resources by identifier than by name.).

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com
 Android App Developer Books: http://commonsware.com/books.html



 


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



[android-developers] unable to get android:windowNoTitle to work when it's a style...

2009-08-28 Thread sdphil

AndroidManifest.xml
===
...
activity android:name=.MyScreen style=@style/my_window/
...

res/values/styles.xml

resources
style name=my_window
item name=android:windowNoTitletrue/item
item name=android:background@drawable/player_background/
item
item name=android:layout_widthfill_parent/item
item name=android:layout_heightfill_parent/item
item name=android:orientationvertical/item
/style
/resources

everything except android:windowNoTitle seems to work...

If i put in the java code to do this in OnCreate()
requestWindowFeature(Window.FEATURE_NO_TITLE);

It works fine...

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



[android-developers] Re: Mapview deprecated

2009-08-28 Thread sweet

I've done what you say mark but i've already the same error the
mistake should not be here i will pass you the full code

java:

public class Map extends MapActivity {
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
linearLayout.addView(mZoom);
}
protected boolean isRouteDisplayed() {
return false;
}

Xml:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
com.google.android.maps.MapView
android:id=@+id/mapview
android:layout_width=fill_parent
android:layout_height=fill_parent
android:clickable=true
android:apiKey=0GWRUwsy0_POHxdWofVfhZeFLwtgkcn7ouMfwcg/
LinearLayout
android:id=@+id/zoomview
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignBottom=@id/mapview
android:layout_centerHorizontal=true/
/LinearLayout


If you see anything ... Thanks for your time
sweet

On 28 août, 10:48, Mark Murphy mmur...@commonsware.com wrote:
  thanks for your answer Zod I've done what you say but there are an
  other problem but i can't find it with the debug mode.
  I think it's in this part of code:

  public void onCreate(Bundle savedInstanceState) {
             linearLayout = (LinearLayout) findViewById(R.id.zoomview);
             mapView = (MapView) findViewById(R.id.mapview);
             mapView.setBuiltInZoomControls(true);
          super.onCreate(savedInstanceState);
          setContentView(R.layout.map);
          linearLayout.addView(mZoom);
      }

  do you see anything wrong ?

 1. You must call setContentView() before using findViewById().

 2. Unless you have a very good reason to do otherwise, call
 super.onCreate() first, before anything else.

 3. You have not defined mZoom and therefore should not be adding it to
 your LinearLayout.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How i can pass my String to Another page

2009-08-28 Thread Panut Sunyakorn

You can use SharedPreferences or set static variable for solve this problem.

2009/8/28 ragavendran s sraghav.ra...@gmail.com:

 Hi ,

   I am new to Android development.I want to transfer transfer my
 String(username) to another page.
 i m having some problems on it...so wil u please tel me the answer.

 with regards
 S.Raghav

 




-- 
Panut Sunyakorn
087-800-3456

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 i can pass my String to Another page

2009-08-28 Thread ragavendran s
Hi ,

  I am new to Android development.I want to transfer transfer my
String(username) to another page.
i m having some problems on it...so wil u please tel me the answer.

with regards
S.Raghav

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



[android-developers] Is it possible to add custom menu items in the native Contact list ?

2009-08-28 Thread Lex

Hi everyone,

Is it possible to add custom menu items in the native Contact list ?

I mean when the user selects a user from his contact list, is it
possible to add a custom action there ? ( for those who are familiar
with Blackberry development, something similar to the MenuItem class )

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: Overlay ConcurrentModificationException (continued)

2009-08-28 Thread Lex

Zsolt,

the methods are defined as follows:

- receiveMessage() - Service Class
- showTrafficMessages() - Activity Class
- updateOverlay - ItemizedOverlay Class

The receiveMessage() method is called in the run method of the
receiving thread object. I see now that other methods are then
executed in the receiving thread (due to callback) as well.

I will check out the Handler and get back to you later. Thanks a lot
for your advice!

Lex



On Aug 27, 6:40 pm, Zod zsolt.ba...@gmail.com wrote:
 Hi!

 It's not clear where your code is located and called. If it's in the
 thread which receives the messages, than you're modifying UI elements
 from another thread which is really bad.

 If your code is in the activity object, and you call it directly from
 the network thread, than you also execute code in a thread which is
 not the UI thread (very bad again), and therefore if the Overlay is
 currently drawn and at that moment you receive a new message you will
 try to modify a List while it is accessed by another thread (the UI).

 There is already a facility in the android api which can help you put
 your data into the UI thread in a safe way.

 See:http://developer.android.com/reference/android/os/Handler.html

 Heres a simple example using Handler.post()

 In you activity where your UI components are. Create a Handler object,
 (eg: mHandler = new Handler())

 Pass this mHandler object to your network thread. When your network
 thread receives a message use this handler to send a Runnable object
 to be executed in the UI thread. Eg:

 receiveMessage(String msg) {
     // send a runnable to execution in the thread which created the
 handler
     mHandler.post(new Runnable() { // implement the Runnable interface
             public void run() {
                 activity.updateUI();  // - what to call in the
 handler thread.
             }
         });

 }

 If your thread is implemented as an inner class of your activity, you
 can call the necessary method directly in the Runnable.run method.

 I hope this helps.

    Zsolt.

 On Aug 27, 12:41 pm, Lex hakkinen1...@gmail.com wrote:

  This post is in addition 
  to:http://groups.google.com/group/android-developers/browse_thread/threa...

  I have exactly the same problem and Doug pinpointed what's probably
  the issue in my case exactly:

  So here's the deal: I have a Vector containing traffic messages
  (received from a server via UDP in an own thread). Each time a message
  is received, I create a new overlay object and populate it with the
  traffic messages:

  public void receiveMessage(BinaryMessage binaryMsg) {

                  
               TrafficMessage message = createMessage(binaryMsg);
               // adds message to vector
               addTrafficMessage(message,
  CoCarMapView.trafficMessages);
               CoCarMapView.showTrafficMessages();
                                  

  }

  public static void showTrafficMessages() {
                  ListOverlay overlays = mapView.getOverlays();
                  if (overlays.size()  1) {
                          overlays.remove(1);
                  }
                  Drawable warningIcon = context.getResources().getDrawable
  (R.drawable.sign_warning_small);
                  CoCarItemizedOverlay trafficEventsOverlay = new 
  CoCarItemizedOverlay
  (warningIcon);

                  // the overlay is populated here
                  trafficEventsOverlay.updateOverlay(trafficMessages);

                  mapView.getOverlays().add(trafficEventsOverlay);
                  mapView.postInvalidate();

  }

  public void updateOverlay(VectorTrafficMessage messages) {
                  for(int i=0; i  messages.size(); i++) {

                          TrafficMessage message = messages.elementAt(i);
                          Drawable messageIcon = getMessageIcon(message);
                          GeoPoint point = getGeoPoint(message);
                          OverlayItem messageItem = createItem(messageIcon, 
  point);
                          this.addItem(messageItem);

                  }

  }

  I don't understand yet exactly where the error is caused, that is
  where to start improving stuff...

  Thanks for your advice,

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

2009-08-28 Thread Mark Murphy

 thanks for your answer Zod I've done what you say but there are an
 other problem but i can't find it with the debug mode.
 I think it's in this part of code:

 public void onCreate(Bundle savedInstanceState) {
   linearLayout = (LinearLayout) findViewById(R.id.zoomview);
   mapView = (MapView) findViewById(R.id.mapview);
   mapView.setBuiltInZoomControls(true);
 super.onCreate(savedInstanceState);
 setContentView(R.layout.map);
 linearLayout.addView(mZoom);
 }

 do you see anything wrong ?

1. You must call setContentView() before using findViewById().

2. Unless you have a very good reason to do otherwise, call
super.onCreate() first, before anything else.

3. You have not defined mZoom and therefore should not be adding it to
your LinearLayout.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: Is it possible to add custom menu items in the native Contact list ?

2009-08-28 Thread Mark Murphy

 Is it possible to add custom menu items in the native Contact list ?

Unfortunately, no. Android has a framework for this (addIntentOptions()),
but last I checked, nothing in Android uses it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] How can i transfer username to next page by Intent:

2009-08-28 Thread ragavendran s
How can i transfer username to next page by the Intent:

package add.sam1;


import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class user extends Activity {
/** Called when the activity is first created. */


EditText username,pass;
Button enter;
public static String str1;
 @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);


 username=(EditText)findViewById(R.id.username);
 pass=(EditText)findViewById(R.id.pass);
 enter=(Button)findViewById(R.id.enter);

 enter.setOnClickListener(new OnClickListener() {
 public void onClick(View v) {

  str1=username.getText().toString();
 String str2=pass.getText().toString();

 if(str1.equals(raghav)  str2.equals(123))
 {

 showint();




 }

 else
 {
 Dialog locationError = new AlertDialog.Builder(
user.this).setIcon(0).setTitle(
Error).setPositiveButton(ok, null)
.setMessage(
Sorry, your u r not a Valid User)
.create();
locationError.show();
username.setText();
pass.setText();
 }



 }


 });


}

public void showint( )
   {
 Intent intent = new Intent(this,welcome.class);

  startActivity(intent);



}



}

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

2009-08-28 Thread alucard20004

I'm building a custom Home app. I want to change the lock screen to
match my theme.

Forexample changing the wallpaper.

What I see in the lock screen now is the default wallpaper.

I've tried searching this forum but can't find the solution. Yet I
found some apps on the market that can do this.

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 use shell command in Android app

2009-08-28 Thread tstanly

hi all,

I want to use command like ls,mkdir,cd,./..etc, in the app,
somebody says use Runtime class,

Runtime.getRuntime().exec(ls);


but there is nothing happen..
I also use logcat to observe, but have the same result.


so could app use (linux) command?


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 i can pass my String to Another page

2009-08-28 Thread Mark Murphy

   I am new to Android development.I want to transfer transfer my
 String(username) to another page.

If by another page you mean another activity, use Intent#putExtra() to
store the String in your Intent that you use to start the second activity,
and use Intent#getStringIntent() in the second activity to retrieve the
value.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: How can i transfer username to next page by Intent:

2009-08-28 Thread Panut Sunyakorn

use startActivityForResult(intent) and implement onActivityResult(int
requestCode, int resultCode, Intent data) method.




startActivityForResult(new Intent(this, YouClass.class), LOGIN_REQUEST);

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == LOGIN_REQUEST) {
SharedPreferences settings =
PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = settings.edit();
editor.putString(username, username);
}
}



2009/8/28 ragavendran s sraghav.ra...@gmail.com:

 How can i transfer username to next page by the Intent:

 package add.sam1;


 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.EditText;


 public class user extends Activity {
     /** Called when the activity is first created. */


     EditText username,pass;
     Button enter;
     public static String str1;
     �...@override
     public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);


  username=(EditText)findViewById(R.id.username);
  pass=(EditText)findViewById(R.id.pass);
  enter=(Button)findViewById(R.id.enter);

  enter.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {

           str1=username.getText().toString();
              String str2=pass.getText().toString();

              if(str1.equals(raghav)  str2.equals(123))
              {

                          showint();




              }

              else
              {
                  Dialog locationError = new AlertDialog.Builder(
                             user.this).setIcon(0).setTitle(
                             Error).setPositiveButton(ok, null)
                             .setMessage(
                                     Sorry, your u r not a Valid User)
                             .create();
                     locationError.show();
                     username.setText();
                     pass.setText();
              }



          }


  });


     }

     public void showint( )
    {
  Intent intent = new Intent(this,welcome.class);

   startActivity(intent);



 }



 }

 




-- 
Panut Sunyakorn
087-800-3456

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

2009-08-28 Thread Mark Murphy

 I've done what you say mark

Not completely.

 but i've already the same error the
 mistake should not be here i will pass you the full code

 java:

 public class Map extends MapActivity {
   LinearLayout linearLayout;
   MapView mapView;
   ZoomControls mZoom;

You will note that mZoom is not initialized.

   @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 setContentView(R.layout.map);
   linearLayout = (LinearLayout) findViewById(R.id.zoomview);
   mapView = (MapView) findViewById(R.id.mapview);
   mapView.setBuiltInZoomControls(true);

You will note that mZoom is still not initialized.

 linearLayout.addView(mZoom);

This should blow up. Delete this line from your code.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Can not access my own service

2009-08-28 Thread Lutz Schönemann

Hi, my current problem is to access my own service. The thing is I  
have 2 interfaces for my service and want to restrict one of them to  
applications that have a special permission.


I have a service and an activity in one package. The application has  
that special permission but I always get a security exception:

I've tried the to following things:

1) put the check inside the onBind() method:

@Override
public IBinder onBind(Intent intent) {
if(intent.getAction() != null 

intent.getAction().equals(ACTION_SERVICE_MANAGEMENT)) {
// check permission
if(checkCallingPermission(PERMISSION_MANAGEMENT) ==  
PackageManager.PERMISSION_DENIED) {
Log.d(TAG, Checked for permission:  + 
PERMISSION_MANAGEMENT +  
\nresult:  + checkCallingPermission(PERMISSION_MANAGEMENT));
throw new SecurityException();
}

// return management binder
return mManagementBinder;
}

if(_DEBUG) Log.d(TAG, onBind finished);
// call was not local so return public binder
return mBinder;
}

2) ptu the check inside a method of the binder it self:

private IServiceManagement.Stub mManagementBinder = new  
IServiceManagement.Stub() {

public String[] getRoles() throws RemoteException {
return PDPService.this.getRoles();
}

public void updatePolicy(String policyuri) {
// check permission
if(checkCallingPermission(PERMISSION_MANAGEMENT) ==  
PackageManager.PERMISSION_DENIED) {
Log.d(TAG, Checked for permission:  + 
PERMISSION_MANAGEMENT +  
\nresult:  + checkCallingPermission(PERMISSION_MANAGEMENT));
throw new SecurityException();
}
Uri uri = Uri.parse(policyuri);
Service.this.updateFile(uri, Service.POLICY_FILE);
}
}


both cases end with a security exception (the one I throw). The result  
of checkCallingPermission is always -1  
(PackageManager.PERMISSION_DENIED). I have doublechecked that the name  
of the permission in code is the same as the one specified in the  
manifest file.

What am I doing wrong?

Thanks for help

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



[android-developers] Re: How i can pass my String to Another page

2009-08-28 Thread Lutz Schönemann

You also can put your string into the intents data bundle object if  
you are using intents to start your next page:


Intent intent = new Intent(YourAction);
intent.setExtras(Username, username);

startActivity(intent);




Am 28.08.2009 um 12:05 schrieb Panut Sunyakorn:


 You can use SharedPreferences or set static variable for solve this  
 problem.

 2009/8/28 ragavendran s sraghav.ra...@gmail.com:

 Hi ,

   I am new to Android development.I want to transfer transfer my
 String(username) to another page.
 i m having some problems on it...so wil u please tel me the  
 answer.

 with regards
 S.Raghav






 -- 
 Panut Sunyakorn
 087-800-3456

 



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

2009-08-28 Thread Sasi Kumar


eSkyGuide.java

public class eSkyGuide extends Activity implements
Button.OnClickListener
{

 public void homepage()
{
setContentView(R.layout.homepage);

flight_schedule=(Button)findViewById(R.id.fschedule);
flight_schedule.setOnClickListener(this);

flight_status=(Button)findViewById(R.id.fstatus);
flight_status.setOnClickListener(this);

weather=(Button)findViewById(R.id.weather);
weather.setOnClickListener(this);
}

}


weather.java

public class Weather extends Activity implements
Button.OnClickListener
{


// now i want to call here.. thathomepage method.


}





can any one know about these .
please help in these concepts.


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] Make some part of an image transparent: Cut a hole to see the background image

2009-08-28 Thread Raman

Hi All,

I have a scenario at hand, for which I need a solution as soons as
possible. Here is the problem statement:

I need to show an image overlapped by some other image, 100%. The
condition is that the picture in background should also be visible
through the foreground picture but only through some part of the
foreground picture.
Please try to visualise how it should look like. There is a picture
shown and in middle of it, there is a transparent area through which
the background image is visible.
I knew that I can make an image transparent and make the background
image visible but here I want only some part of the foreground image
to be transparent so that it looks like sort of picture frame applied
to the background puicture.
And for those who read the statement carefully would have understood
that the ultimate thing desired is to have a picture frame applied to
the picture.
Can anyone please suggest a good way to do this.

Thanks
Raman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 i can pass my String to Another page

2009-08-28 Thread Desu Vinod Kumar
HI

go throught this link

http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen

it vl be hwlpful for u

2009/8/28 Lutz Schönemann lutz.schoenem...@sit.fraunhofer.de


 You also can put your string into the intents data bundle object if
 you are using intents to start your next page:


 Intent intent = new Intent(YourAction);
 intent.setExtras(Username, username);

 startActivity(intent);




 Am 28.08.2009 um 12:05 schrieb Panut Sunyakorn:

 
  You can use SharedPreferences or set static variable for solve this
  problem.
 
  2009/8/28 ragavendran s sraghav.ra...@gmail.com:
 
  Hi ,
 
I am new to Android development.I want to transfer transfer my
  String(username) to another page.
  i m having some problems on it...so wil u please tel me the
  answer.
 
  with regards
  S.Raghav
 
 
 
 
 
 
  --
  Panut Sunyakorn
  087-800-3456
 
  
 


 



-- 
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] View with both text and progress bar

2009-08-28 Thread Deepak

I need to pass a view with both TEXT and a PROGRESS icon.  can this be
done with a single view.???

Here I can pass only single view , so looking for a view which can
have both TEXT and PROGRESS ICON.


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

2009-08-28 Thread Photics

Hi,

This story has a happy ending... somewhat :-)

So, my Google AdSense account was reactivated. Although, my previous
earnings were eliminated as invalid clicks. I received an email
explaining the situation. Apparantly, AdSense for Content and Android
Apps are not supposed to mix. How was I supposed to know that before,
I don't know. I was advised to try out for the AdSense for Mobile Apps
Beta, but I don't have 100,000 pageviews a day. Heh, not yet anyway.

The good part of the story is the strength of this community. I'm not
too concerned about the money lost, rather, I'm more concerned about
the future of Android. Should I continue to create apps or will I get
burned by Google again? I'm thinking no. The Android team seems very
cool and the developers here seemed rather friendly.

So hey, I'm sharing my experience in this matter... don't mix AFC with
Android / iPhone apps.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Mobile Application Developers.

2009-08-28 Thread Sasi Kumar


http://groups.google.com/group/mobile-application-developers

Join this group

To share mobile application datas, ideas and doubts.

Its only for mobile application developers.

More Experience Guys are there to reply for free of costs.

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: Android Camera : My photo is completely black :-/

2009-08-28 Thread DaminouU

Can Nobody help me?

On Aug 25, 7:44 pm, DaminouU dam.le...@gmail.com wrote:
 Hi,

 I am creating a little application where I use the Android Camera
 class. Everything seems to work but the result is a black picture.

 I think I forget to set a parameter.

 Do you have any ideas on which parameter I must set up ?

 The code:

             public boolean takeIt() {
                 ImageCaptureCallback iccb = null;
                 try {
                         String filename = photo.jpeg;
                         ContentValues values = new ContentValues();
                         values.put(Media.TITLE, filename);
                         values.put(Media.DESCRIPTION, Image capture by 
 camera);
                         iccb = new ImageCaptureCallback(new 
 FileOutputStream(new File
 (dataMgr.getRoot(), filename)));
                 } catch(Exception ex ){
                         ex.printStackTrace();
                 }

                 camera.takePicture(mShutterCallback, mPictureCallbackRaw, 
 iccb);

                 return true;
             }

 If you need something else, just tell it ;p

 Thanks,

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

2009-08-28 Thread sweet

I found it thanks again for your help ^^

On 28 août, 13:53, sweet junkybr...@gmail.com wrote:
 Just an other question
 How can i make an other itemized to switch the view (satelite view to
 map view) ???

 On 28 août, 13:39, sweet junkybr...@gmail.com wrote:

  It's work very well ^^
  Thanks a lot guys

  On 28 août, 12:14, Mark Murphy mmur...@commonsware.com wrote:

I've done what you say mark

   Not completely.

but i've already the same error the
mistake should not be here i will pass you the full code

java:

public class Map extends MapActivity {
   LinearLayout linearLayout;
   MapView mapView;
   ZoomControls mZoom;

   You will note that mZoom is not initialized.

  �...@override
    public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
        setContentView(R.layout.map);
           linearLayout = (LinearLayout) findViewById(R.id.zoomview);
           mapView = (MapView) findViewById(R.id.mapview);
           mapView.setBuiltInZoomControls(true);

   You will note that mZoom is still not initialized.

        linearLayout.addView(mZoom);

   This should blow up. Delete this line from your code.

   --
   Mark Murphy (a Commons Guy)http://commonsware.com
   Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Fullscreen IME problem

2009-08-28 Thread loctarar

Hello!

I have some problems with custom editable views on devices that don't
poses a hardware keyboard. Setting the device in landscape mode
enables the fullscreen IME to show up. This one covers my custom view
but instead provides it's on view on the top of the screen for preview
(?). It initially contains the hint assigned in the EditorInfo
class.
Using an EditableInputConnection + EditText enables the preview to
synchronize with what I type on the keyboard. Using my custom view it
doesn't and all I can see is just the hint text. However the key
presses are recorded by my custom view.
I looked through the sources of EditText and EditableInputConnection
but I couldn't find anything that suggests how to make the preview to
work.

Any type of guidance would be really helpful. As I stated in my
previous posts I can't use the TextView widgets and solving this is a
must :(.

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

2009-08-28 Thread Wouter

No one knows how to do this?

On 20 aug, 11:39, Wouter wouterg...@gmail.com wrote:
 Hey,

 I want to make something like this:

 http://bto.cnet.com/i/bto/20081212/Loopt_270x675.jpg

 And specially the list of images at the bottom of the screen. How have
 they made this? Is it a listview with only images and text or another
 method?

 Thank you for helping me!

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



[android-developers] Nice Opportunities for mobile application developers

2009-08-28 Thread Sasi Kumar


://groups.google.com/group/mobile-application-developers

(use before the link http)

Join this group.

more experience professor to guide 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: Mapview deprecated

2009-08-28 Thread sweet

Just an other question
How can i make an other itemized to switch the view (satelite view to
map view) ???

On 28 août, 13:39, sweet junkybr...@gmail.com wrote:
 It's work very well ^^
 Thanks a lot guys

 On 28 août, 12:14, Mark Murphy mmur...@commonsware.com wrote:

   I've done what you say mark

  Not completely.

   but i've already the same error the
   mistake should not be here i will pass you the full code

   java:

   public class Map extends MapActivity {
      LinearLayout linearLayout;
      MapView mapView;
      ZoomControls mZoom;

  You will note that mZoom is not initialized.

     �...@override
       public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
           setContentView(R.layout.map);
              linearLayout = (LinearLayout) findViewById(R.id.zoomview);
              mapView = (MapView) findViewById(R.id.mapview);
              mapView.setBuiltInZoomControls(true);

  You will note that mZoom is still not initialized.

           linearLayout.addView(mZoom);

  This should blow up. Delete this line from your code.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How i get the Selected item from the list Adapter.

2009-08-28 Thread ragavendran s
i m a beginner for Android development

  How i get the Selected item from the list Adapter.

  for example i m having the code:



  Code:

 final Spinner spinner = (Spinner) findViewById(R.id.testSpinner);
ArrayAdapterString adapter = new ArrayAdapterString(this,
android.R.layout.simple_spinner_item, Months);

adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);



   /---some code/

  static final String[] Months = new String[]{
January,February,March,April,May,June,July,August,
September,October,November,December
};



  public void changeOption(Spinner spinner){
if (spinner.isEnabled()){
spinner.setEnabled(false);



}
else{
spinner.setEnabled(true);
}
}


Question:

In this above code if i selected March from the Dropdown Adapter means then
how can i retrieve the Manth March to show in a textview.

Please tell me the ANswer...


with Regard,
Raghav.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: Mapview deprecated

2009-08-28 Thread sweet

It's work very well ^^
Thanks a lot guys

On 28 août, 12:14, Mark Murphy mmur...@commonsware.com wrote:
  I've done what you say mark

 Not completely.

  but i've already the same error the
  mistake should not be here i will pass you the full code

  java:

  public class Map extends MapActivity {
     LinearLayout linearLayout;
     MapView mapView;
     ZoomControls mZoom;

 You will note that mZoom is not initialized.

    �...@override
      public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
          setContentView(R.layout.map);
             linearLayout = (LinearLayout) findViewById(R.id.zoomview);
             mapView = (MapView) findViewById(R.id.mapview);
             mapView.setBuiltInZoomControls(true);

 You will note that mZoom is still not initialized.

          linearLayout.addView(mZoom);

 This should blow up. Delete this line from your code.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to call another class method.

2009-08-28 Thread Lutz Schönemann

you need a reference to the class that contains the method you want to  
call.

To access the mehtod homepage() inside the eSkyGuide from the class  
Weather, you need an instance of the eSkyGuide class inside the  
instance of the Weather class.

for example:

public class Weather extends Activity implements  
Button.OnClickListener {
private eSkyGuide meSkyGuide = new eSkyGuide();

private someMethod() {
meSkyGuide.homepage();
}

}

But you shouldn't do this, because you are trying to set the content  
view of an activity from inside an other activity. Things like  
setContentView(), setOnClickListener(), ... should be done once at  
creation time of an activity:

public class eSkyGuide extends Activity implements  
Button.OnCickListener {
public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.homepage);
flight_schedule=(Button)findViewById(R.id.fschedule);
flight_schedule.setOnClickListener(this);

flight_status=(Button)findViewById(R.id.fstatus);
flight_status.setOnClickListener(this);

weather=(Button)findViewById(R.id.weather);
weather.setOnClickListener(this);
}
}


In addition: instead of implementing the OnClickListener interface you  
can implement an OnClickListener like this:

flight_schedule.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// put your code here
// to call methods of the eSkyGuide class do it like 
this
eSkyGuide.this.methodName();
}
});


Am 28.08.2009 um 13:15 schrieb Sasi Kumar:



 eSkyGuide.java

 public class eSkyGuide extends Activity implements
 Button.OnClickListener
 {

 public void homepage()
{
   setContentView(R.layout.homepage);

flight_schedule=(Button)findViewById(R.id.fschedule);
flight_schedule.setOnClickListener(this);

flight_status=(Button)findViewById(R.id.fstatus);
flight_status.setOnClickListener(this);

weather=(Button)findViewById(R.id.weather);
weather.setOnClickListener(this);
 }

 }


 weather.java

 public class Weather extends Activity implements
 Button.OnClickListener
 {


 // now i want to call here.. thathomepage method.


 }





 can any one know about these .
 please help in these concepts.


 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: How i can pass my String to Another page

2009-08-28 Thread Sasi Kumar

public static String username;


s2.java

private String df;

df=s1.username;

thats all!.

On Aug 28, 2:22 pm, ragavendran s sraghav.ra...@gmail.com wrote:
 Hi ,

   I am new to Android development.I want to transfer transfer my
 String(username) to another page.
 i m having some problems on it...so wil u please tel me the answer.

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

2009-08-28 Thread loctarar

Fixed :). I read the doc in
http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html
. I had to also implement the getExtractedText method.
Sorry for wasting space on the group servers :P.

On Aug 28, 3:19 pm, loctarar andrei.bu...@gmail.com wrote:
 Hello!

 I have some problems with custom editable views on devices that don't
 poses a hardware keyboard. Setting the device in landscape mode
 enables the fullscreen IME to show up. This one covers my custom view
 but instead provides it's on view on the top of the screen for preview
 (?). It initially contains the hint assigned in the EditorInfo
 class.
 Using an EditableInputConnection + EditText enables the preview to
 synchronize with what I type on the keyboard. Using my custom view it
 doesn't and all I can see is just the hint text. However the key
 presses are recorded by my custom view.
 I looked through the sources of EditText and EditableInputConnection
 but I couldn't find anything that suggests how to make the preview to
 work.

 Any type of guidance would be really helpful. As I stated in my
 previous posts I can't use the TextView widgets and solving this is a
 must :(.

 Thanks,
 Andrei
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Make some part of an image transparent: Cut a hole to see the background image

2009-08-28 Thread Streets Of Boston

I don't understand the issue if you know how to make an image
transparent.

Make the foreground image transparent only in certain areas. E.g. for
a photo-frame effect, make an image of a photo-frame and make the
center of the image transparent. This image will then be your
foreground image.

To be able to use transparent images, use PNG.

On Aug 28, 7:14 am, Raman raman86...@gmail.com wrote:
 Hi All,

 I have a scenario at hand, for which I need a solution as soons as
 possible. Here is the problem statement:

 I need to show an image overlapped by some other image, 100%. The
 condition is that the picture in background should also be visible
 through the foreground picture but only through some part of the
 foreground picture.
 Please try to visualise how it should look like. There is a picture
 shown and in middle of it, there is a transparent area through which
 the background image is visible.
 I knew that I can make an image transparent and make the background
 image visible but here I want only some part of the foreground image
 to be transparent so that it looks like sort of picture frame applied
 to the background puicture.
 And for those who read the statement carefully would have understood
 that the ultimate thing desired is to have a picture frame applied to
 the picture.
 Can anyone please suggest a good way to do this.

 Thanks
 Raman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 i get the Selected item from the list Adapter.

2009-08-28 Thread Sasi Kumar

join the below group to discuss more

http://groups.google.com/group/mobile-application-developers

use like this

lv=(ListView)findViewById(R.id.ListView01);
lv.setChoiceMode(lv.CHOICE_MODE_SINGLE);
lv.setAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1 , airport_list));
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int
position, long id) {
System.out.println(selected item position is =
+position );
System.out.println(selected item is
=+lv.getItemAtPosition(position));
if(list_selected == arrival)
arrival_list_selected=(String) lv.getItemAtPosition
(position);
else if(list_selected == depature)
depature_list_selected=(String) lv.getItemAtPosition
(position);
if(airport_selectedby.equals(flightschedule))
flight_schedule();
else if(airport_selectedby.equals(flightstatus))
flight_status();
}
});


here lv is a listview.


On Aug 28, 5:35 pm, ragavendran s sraghav.ra...@gmail.com wrote:
 i m a beginner for Android development

   How i get the Selected item from the list Adapter.

   for example i m having the code:

   Code:

  final Spinner spinner = (Spinner) findViewById(R.id.testSpinner);
     ArrayAdapterString adapter = new ArrayAdapterString(this,
     android.R.layout.simple_spinner_item, Months);

 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
     spinner.setAdapter(adapter);

        /---some code/

   static final String[] Months = new String[]{
     January,February,March,April,May,June,July,August,
     September,October,November,December
     };

   public void changeOption(Spinner spinner){
     if (spinner.isEnabled()){
     spinner.setEnabled(false);

     }
     else{
     spinner.setEnabled(true);
     }
     }

 Question:

 In this above code if i selected March from the Dropdown Adapter means then
 how can i retrieve the Manth March to show in a textview.

 Please tell me the ANswer...

 with Regard,
 Raghav.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: View with both text and progress bar

2009-08-28 Thread Mark Murphy

 I need to pass a view with both TEXT and a PROGRESS icon.  can this be
 done with a single view.???

LinearLayout. RelativeLayout. TableLayout. And so on. All subclass
android.view.View, and all would allow you to wrap a TextView and a
ProgressBar (or ImageView or whatever) into a single View.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: Is the limit of memory heap only 6M?

2009-08-28 Thread Streets Of Boston

Examine your code. Check if you keep references to your bitmaps
somewhere (e.g. caches). Clean up these references and call
bitmap.recycle() on the bitmaps that you can let go. After a clean-up,
call System.gc(). This should not be necessary, but i found it does
actually help a little.

Use as few images as possible (e.g. if you have a list-view with items
containing images, be sure to reuse the 'contentView' parameter in the
getView() method of your adapter, if you have one defined).


On Aug 28, 1:51 am, Ramesh uthir...@gmail.com wrote:
 Even after trying these methods i am getting the same error. The issue
 is in my application i am trying to load lots of images and when i
 navigate from one view to other, it still increases the memory. i.e.
 it's not freeing up / optimizing the memory which is now unused.

 Any idea how to deal with this ?

 On Jul 1, 6:58 pm, Streets Of Boston flyingdutc...@gmail.com wrote:



  Load the picture in the size you need it, by setting the
  BitmapFactory.Options.inSampleSize to a value larger than 1 (so far, i
  have only managed to use value that are powers of 2 for this
  inSampleSize attribute). Look at the api-docs for more info on this
  attribute.

  What i mean is that if you load the picture to be shown on your
  screen, you need only a 320x480 pic, i.e. a inSampleSize=4 would do.

  If you load your pic as a small thumbnail, even a larger value of
  inSampleSize would do.

  Also, if you load a pic to be shown on the screen, use RGB_565 and not
  ARGB_. RGB_565 uses only 2 bytes per pixel, ARGB_ uses 4 bytes
  per pixel.

  In my app, i have managed to load on full-sized RGB_565 (2048x1536)
  and a bunch of smaller pics at the same time. Or a 2 half-sized
  ARGB_ (1024x768) and a bunch of smaller sized pics at the same
  time.
  Two full-sized RGB_565 always got me that out-of-memory exception.

  I also wrote a 'bitmap-memory' notifier: Each class that created
  bitmaps listens to this notifier. If notified, these classes will
  recycle bitmaps and empty bitmap-caches (where possible). If another
  class needs to create a large bitmap it will signal this 'bitmap-
  notifier' to ask its listeners to clean up as much memory as possible.
  This has worked for me so far.

  On Jun 30, 11:00 pm, 楊健 y...@cycomtech.co.jp wrote:

   Thank you for you answer.

   I monitored the memory heap  by  Runtime.getRuntime().freeMemory() and
   totalMemory();.
   When my app starts (free is 700k,total is 2.7M)
   When I take picture,the picture is 1.2M (free is 700k,total 5M)
   The log shows 07-01 11:31:27.062: INFO/dalvikvm-heap(395): Grow heap (frag
   case) to 5.020MB for 1337498-byte allocation
   If I do not call System.gc() before i load the picture it will throw the 
   OOM
   exception as I pasted.
   I thought at that time  I just to allocate for 1.2M.
   Is it means it is very dangerous to load picture ,I had better to check 
   and
   release the memory every time?

   -Original Message-
   From: android-developers@googlegroups.com
   [mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy
   Sent: Wednesday, July 01, 2009 11:38 AM
   To: android-developers@googlegroups.com
   Subject: [android-developers] Re: Is the limit of memory heap only 6M?

   楊健 wrote:
07-01 11:32:02.192: VERBOSE/QualcommCameraHardware(35): state
transition QCS_WAITING_JPEG -- QCS_IDLE
07-01 11:32:02.232: ERROR/dalvikvm-heap(395): 6291456-byte external
allocation too large for this process.
07-01 11:32:02.232: ERROR/(395): VM won't let us allocate 6291456
bytes
07-01 11:32:02.242: DEBUG/AndroidRuntime(395): Shutting down VM
07-01 11:32:02.242: WARN/dalvikvm(395): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
07-01 11:32:02.242: ERROR/AndroidRuntime(395): Uncaught handler:
thread main exiting due to uncaught exception
07-01 11:32:02.302: ERROR/AndroidRuntime(395):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget

My app shut down when i load a jpg file,i can avoid it by call
system.gc().But I think memory limit  will be 14M or 16M.

   The available heap is 16MB. That does not necessarily mean that there is
   a contiguous 6MB buffer that you can allocate, depending on what else
   your application is doing.

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

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

   - Show quoted text -- Hide quoted text -

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

[android-developers] Re: How to call another class method.

2009-08-28 Thread Sasi Kumar

eSkyGuide.this.methodName();

This one i tryed.

but it is showing error.

please give some other suggestion

On Aug 28, 5:12 pm, Lutz Schönemann
lutz.schoenem...@sit.fraunhofer.de wrote:
 you need a reference to the class that contains the method you want to  
 call.

 To access the mehtod homepage() inside the eSkyGuide from the class  
 Weather, you need an instance of the eSkyGuide class inside the  
 instance of the Weather class.

 for example:

 public class Weather extends Activity implements  
 Button.OnClickListener {
         private eSkyGuide meSkyGuide = new eSkyGuide();

         private someMethod() {
                 meSkyGuide.homepage();
         }

 }

 But you shouldn't do this, because you are trying to set the content  
 view of an activity from inside an other activity. Things like  
 setContentView(), setOnClickListener(), ... should be done once at  
 creation time of an activity:

 public class eSkyGuide extends Activity implements  
 Button.OnCickListener {
         public void onCreate(Bundle savedInstanceState) {
                 setContentView(R.layout.homepage);
                 flight_schedule=(Button)findViewById(R.id.fschedule);
                 flight_schedule.setOnClickListener(this);

                 flight_status=(Button)findViewById(R.id.fstatus);
                 flight_status.setOnClickListener(this);

                 weather=(Button)findViewById(R.id.weather);
                 weather.setOnClickListener(this);
         }

 }

 In addition: instead of implementing the OnClickListener interface you  
 can implement an OnClickListener like this:

         flight_schedule.setOnClickListener(new OnClickListener() {
                 public void onClick(View v) {
                         // put your code here
                         // to call methods of the eSkyGuide class do it like 
 this
                         eSkyGuide.this.methodName();
                 }
         });

 Am 28.08.2009 um 13:15 schrieb Sasi Kumar:



  eSkyGuide.java

  public class eSkyGuide extends Activity implements
  Button.OnClickListener
  {

  public void homepage()
     {
             setContentView(R.layout.homepage);

         flight_schedule=(Button)findViewById(R.id.fschedule);
         flight_schedule.setOnClickListener(this);

         flight_status=(Button)findViewById(R.id.fstatus);
         flight_status.setOnClickListener(this);

         weather=(Button)findViewById(R.id.weather);
         weather.setOnClickListener(this);
  }

  }

  weather.java

  public class Weather extends Activity implements
  Button.OnClickListener
  {

  // now i want to call here.. thathomepage method.

  }

  can any one know about these .
  please help in these concepts.

  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: Ressource Management / Priorization of applications?

2009-08-28 Thread Streets Of Boston

*Why* do you need this? What critical code do you need to execute?
Maybe there is another solution... maybe not...

If you could make some code 'critical', what if other processes tried
to do the same?

On Aug 28, 3:00 am, salza floriansa...@googlemail.com wrote:
 Maybe I misunderstand something.

 Let's say thread A of process A has the priority very important and
 thread B of process B has the priority not so important.
 In Android every process has its own Dalvik VM instance - so thread A
 is in another instance than thread B. Therefor the priority of the
 threads does only have an effect on other threads of the same Dalvik
 VM instance. Right?
 That's why (in my opinion) the thread priorities would not have an
 effect on whether thread A or thread B will be done first as they are
 in different Dalvik VM instances.

 The thing I want to accomplish: I have another system environment
 where very critical processes exist that need a high priority. If it
 is not possible to sign it with a high priority I can't use Android
 for development in that system environment.

 Thanks.

 On Aug 27, 8:23 pm, Dianne Hackborn hack...@android.com wrote:



  No, and Linux doesn't have this facility.  When you set the nice on a
  process, you are setting it on the main thread of the process.  Any threads
  it creates after that will inherit the priority of the original thread,
  however it will not impact any existing threads, and threads can later
  modify their priority.

  The only thing you can do afaik is restrict the best priority any thread can
  get, and that is associated with the uid and not the process.

  I have no clue what the relationship is between killing processes and
  setting process priorities.

  What exactly are you wanting to accomplish?

  On Thu, Aug 27, 2009 at 8:52 AM, salza floriansa...@googlemail.com wrote:

   So is there any method I can use, to set the priority for a process?
   Linux normally has this ability (e.g. nice - Set process priority of
   new processes)

   In the Android API I found a method to kill processes: killProcess(int
   pid)

   So is there any possibility for me as a developer to use a method like
   the killProcess-method zu manage the priority of a process?

   On Aug 26, 6:48 pm, Dianne Hackborn hack...@android.com wrote:
Linux doesn't really associate priorities with processes...  or more
accurately, in Linux a process is a unit of execution, so each thread is
also actually a process (running in the same address space), with their
   own
independent priorities.

On Wed, Aug 26, 2009 at 4:29 AM, mstu...@googlemail.com 

mstu...@googlemail.com wrote:

 Thanks!

 Ok, I can set priority for threads... but threads running in
 processes... is it therefore possible to set priority for processes as
 well...?

 On 26 Aug., 00:04, 3crowntech 3crownt...@gmail.com wrote:
  Hi Matthias,

  You can set thread priority by android.os.Process.setThreadPriority
  method. This is how android controls resource allocation.
  Thanks.

  On Aug 26, 5:45 am, mstu...@googlemail.com mstu...@googlemail.com

  wrote:

   hi all,

   the Android web site indicates that all applications are created
   equal. What is the strategy to ensure that critical applications/
   services have priority?

   Are there any facilities Android does provide to ensure certain
   applications and/or threads to receive a minimum of CPU bandwith
   (and
   other apps/threads are prevented from consuming all the CPU
   bandwith)?

   Matthias- Zitierten Text ausblenden -

  - Zitierten Text anzeigen -

--
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.

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

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

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



[android-developers] Re: How i get the Selected item from the list Adapter.

2009-08-28 Thread Martin Obreshkov

You can register public abstract void onItemSelected (AdapterView?
parent, View view, int position, long id) and to retrieve the selected
value from ArrayAdapter.getItem(int position) using the selected
position as parameter.

On Fri, Aug 28, 2009 at 3:35 PM, ragavendran ssraghav.ra...@gmail.com wrote:
 i m a beginner for Android development

   How i get the Selected item from the list Adapter.

   for example i m having the code:



   Code:

  final Spinner spinner = (Spinner) findViewById(R.id.testSpinner);
     ArrayAdapterString adapter = new ArrayAdapterString(this,
     android.R.layout.simple_spinner_item, Months);

 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
     spinner.setAdapter(adapter);



    /---some code/

   static final String[] Months = new String[]{
     January,February,March,April,May,June,July,August,
     September,October,November,December
     };



   public void changeOption(Spinner spinner){
     if (spinner.isEnabled()){
     spinner.setEnabled(false);



     }
     else{
     spinner.setEnabled(true);
     }
     }


 Question:

 In this above code if i selected March from the Dropdown Adapter means then
 how can i retrieve the Manth March to show in a textview.

 Please tell me the ANswer...


 with Regard,
 Raghav.S

 




-- 
When I raise my flashing sword, and my hand takes hold on judgment, I
will take vengeance upon mine enemies, and I will repay those who haze
me. Oh, Lord, raise me to Thy right hand and count me among Thy
saints.

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

2009-08-28 Thread ragavendran s
I think u may use like this ...Intent to call another .java class
if successs u reply to me...thanks



 weather.java

 public class Weather extends Activity implements
 Button.OnClickListener
 {


 Intent intent = new Intent(this, homepage.class);
 startActivity(intent);


 }









--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: advice sought - grid of thumbnails that do something when you click on them.

2009-08-28 Thread Streets Of Boston

GridView.
And each item the GridView is a ViewGroup that contains an ImageView
and a TextView.

On Aug 28, 5:00 am, sdphil phil.pellouch...@gmail.com wrote:
 http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-...

 uses a GridView - but I don't see text under each photo...

 On Aug 28, 1:00 am, sdphil phil.pellouch...@gmail.com wrote:



  i want to create a scrollable grid of thumbnail images with text
  underneath each thumbnail.  when you click on one it will do
  something.

  should i use a GridView, a multi-column ListView, a TableLayout, or
  other??

  thoughts?

  tia.- 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] In which layout it can easy to arrange the more number of editviewfield and textview.

2009-08-28 Thread ragavendran s
In which layout it can easy to arrange the more number of editviewfield and
textview..


for example to create New user page...

can u tel me pls...


thanks,

with regards,
Raghav.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: Is there a way to get icons for apps on the Market?

2009-08-28 Thread happydroid

It must be possible to do through a request to the Market, because
websites like www.cyrket.com or www.androlib.com show the icons of the
apps.

On Aug 22, 6:19 pm, craiget crai...@gmail.com wrote:
 Just wondering if it is possible to get icons for applications on the
 Android Market?

 For example, if there is an application called
 com.mycompany.someapp, is there a way to programmatically grab an
 image (icon) for that application either through an Android API or by
 simply downloading it from someplace on the net? I know it is possible
 to get the icon for an installed app using the PackageManager API;
 however, I don't believe that works for apps that are not installed.

 Failing that, since PackageManager can get a list of icons for
 installed applications, it should be possible to compile a fairly
 comprehensive list by creating an app that queries the PackageManger
 and uploads all the installed app icons to a webserver. That's not as
 nice as a true API, but it seems like it would work reasonably well.
 Can anyone think of anything particularly wrong with that approach?

 Thanks for your ideas and suggestions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Overlay ConcurrentModificationException (continued)

2009-08-28 Thread Lex

So, this is what I have now:

public void receiveMessage(BinaryMessage binaryMsg) {


...
if ( validateMessage(binaryMsg) ) {
final TrafficMessage message = 
createMessage(binaryMsg);

Log.i( CoCarMapView.TAG, traffic 
messages vector size:  + new
Integer(CoCarMapView.trafficMessages.size()).toString() );
// update the UI - show the messages
/* the traffic container and the UI 
update should be
 * executed from the UI and not from 
the receiving
 * thread, therefore a handler is used 
to return
 * these operations to the UI thread
 */
handler.post(new Runnable() {
public void run() {


addTrafficMessage(message, CoCarMapView.trafficMessages);

CoCarMapView.showTrafficMessages();
}
});


}

}

} // end of method

I assumed I had to put addTrafficMessage inside the handler thread, as
the collection is modified here. The exception is gone!

Thanks,

Lex

On Aug 28, 10:12 am, Lex hakkinen1...@gmail.com wrote:
 Zsolt,

 the methods are defined as follows:

 - receiveMessage() - Service Class
 - showTrafficMessages() - Activity Class
 - updateOverlay - ItemizedOverlay Class

 The receiveMessage() method is called in the run method of the
 receiving thread object. I see now that other methods are then
 executed in the receiving thread (due to callback) as well.

 I will check out the Handler and get back to you later. Thanks a lot
 for your advice!

 Lex

 On Aug 27, 6:40 pm, Zod zsolt.ba...@gmail.com wrote:

  Hi!

  It's not clear where your code is located and called. If it's in the
  thread which receives the messages, than you're modifying UI elements
  from another thread which is really bad.

  If your code is in the activity object, and you call it directly from
  the network thread, than you also execute code in a thread which is
  not the UI thread (very bad again), and therefore if the Overlay is
  currently drawn and at that moment you receive a new message you will
  try to modify a List while it is accessed by another thread (the UI).

  There is already a facility in the android api which can help you put
  your data into the UI thread in a safe way.

  See:http://developer.android.com/reference/android/os/Handler.html

  Heres a simple example using Handler.post()

  In you activity where your UI components are. Create a Handler object,
  (eg: mHandler = new Handler())

  Pass this mHandler object to your network thread. When your network
  thread receives a message use this handler to send a Runnable object
  to be executed in the UI thread. Eg:

  receiveMessage(String msg) {
      // send a runnable to execution in the thread which created the
  handler
      mHandler.post(new Runnable() { // implement the Runnable interface
              public void run() {
                  activity.updateUI();  // - what to call in the
  handler thread.
              }
          });

  }

  If your thread is implemented as an inner class of your activity, you
  can call the necessary method directly in the Runnable.run method.

  I hope this helps.

     Zsolt.

  On Aug 27, 12:41 pm, Lex hakkinen1...@gmail.com wrote:

   This post is in addition 
   to:http://groups.google.com/group/android-developers/browse_thread/threa...

   I have exactly the same problem and Doug pinpointed what's probably
   the issue in my case exactly:

   So here's the deal: I have a Vector containing traffic messages
   (received from a server via UDP in an own thread). Each time a message
   is received, I create a new overlay object and populate it with the
   traffic messages:

   public void receiveMessage(BinaryMessage binaryMsg) {

                   
                TrafficMessage message = createMessage(binaryMsg);
                // adds message to vector
                addTrafficMessage(message,
   CoCarMapView.trafficMessages);
                CoCarMapView.showTrafficMessages();
                                   

   }

   public static void showTrafficMessages() {
                   ListOverlay overlays = mapView.getOverlays();
                   if (overlays.size()  1) {
                           overlays.remove(1);
                   }
                   Drawable warningIcon = context.getResources().getDrawable
   (R.drawable.sign_warning_small);
                   CoCarItemizedOverlay 

[android-developers] Async Task Problem

2009-08-28 Thread glory

Hi All,

I am facing the problem of timelag between execution of onPreExecute()
and execution of doInbackground(String... params).On postExecute() of
the Asyc task I am starting a service.
First time when I am executing the async task it is working fine but
If I again executing the same Async task immediately then there is a
lag in execution of onPreExecute() and execution of doInbackground
(String... params).
I am doing nothing on onPreExecute() ,so doInbackground(String...
params) should execute immediately, is I am missing something

Thanks in Advance
Regards,
Glory
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 kill background applications?

2009-08-28 Thread Hong
Thanks Hackborn!

It works really well!

On Tue, Jul 14, 2009 at 9:51 PM, Dianne Hackborn hack...@android.comwrote:

 This is what the system's manage applications force stop button uses:


 http://developer.android.com/reference/android/app/ActivityManager.html#restartPackage%28java.lang.String%29

 On Tue, Jul 14, 2009 at 5:26 PM, sychee cseng...@gmail.com wrote:


 Hi, I am currently writing a program to kill processes that the users
 choose to end. From the logCat, I notice that a Signal 9 has been sent
 to the application but the process is still running. I am only able to
 kill my own process through the code below. I understand that the
 kernel only allow killing of processes that have some relation to my
 program, but how do I kill other processes other than my own? Please
 help. Thank you very much !

 Below is my code:

 android.os.Process.killProcess(processID);






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

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



 


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



[android-developers] Re: How to call another class method.

2009-08-28 Thread Roman ( T-Mobile USA)

I am assuming that you want to get the activity eSkyGuide in the
foreground, correct?

In this case as ragavendran suggested, call an Intent to start up the
new activity. Something like

   Intent eSkyGuideIntent = new Intent() ;
   eSkyGuideIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

   eSkyGuideIntent.setClassName
(yourPackageName.eSkyGuide,yourPackageName.eSkyGuide);

   mContext.startActivity(eSkyGuideIntent);

Make sure that you have a valid context instance. With doing this your
new activity should be started.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Aug 28, 7:07 am, ragavendran s sraghav.ra...@gmail.com wrote:
 I think u may use like this ...Intent to call another .java class
 if successs u reply to me...thanks



  weather.java

  public class Weather extends Activity implements
  Button.OnClickListener
  {

  Intent intent = new Intent(this, homepage.class);
  startActivity(intent);

  }


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

2009-08-28 Thread Martin Obreshkov

Thanks a lot it's really very simple and clear using ContextMenu

On Fri, Aug 28, 2009 at 3:45 PM, Sasi Kumarsasikumar.it1...@gmail.com wrote:

 join the below group to discuss more

 http://groups.google.com/group/mobile-application-developers

 use like this

                lv=(ListView)findViewById(R.id.ListView01);
                lv.setChoiceMode(lv.CHOICE_MODE_SINGLE);
        lv.setAdapter(new ArrayAdapterString(this,
                android.R.layout.simple_list_item_1 , airport_list));
        lv.setTextFilterEnabled(true);
        lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView parent, View v, int
 position, long id) {
                System.out.println(selected item position is =
 +position );
                System.out.println(selected item is
 =+lv.getItemAtPosition(position));
                if(list_selected == arrival)
                        arrival_list_selected=(String) lv.getItemAtPosition
 (position);
                else if(list_selected == depature)
                        depature_list_selected=(String) lv.getItemAtPosition
 (position);
                if(airport_selectedby.equals(flightschedule))
                        flight_schedule();
                else if(airport_selectedby.equals(flightstatus))
                flight_status();
            }
        });


 here lv is a listview.


 On Aug 28, 5:35 pm, ragavendran s sraghav.ra...@gmail.com wrote:
 i m a beginner for Android development

   How i get the Selected item from the list Adapter.

   for example i m having the code:

   Code:

  final Spinner spinner = (Spinner) findViewById(R.id.testSpinner);
     ArrayAdapterString adapter = new ArrayAdapterString(this,
     android.R.layout.simple_spinner_item, Months);

 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
     spinner.setAdapter(adapter);

        /---some code/

   static final String[] Months = new String[]{
     January,February,March,April,May,June,July,August,
     September,October,November,December
     };

   public void changeOption(Spinner spinner){
     if (spinner.isEnabled()){
     spinner.setEnabled(false);

     }
     else{
     spinner.setEnabled(true);
     }
     }

 Question:

 In this above code if i selected March from the Dropdown Adapter means then
 how can i retrieve the Manth March to show in a textview.

 Please tell me the ANswer...

 with Regard,
 Raghav.S
 




-- 
When I raise my flashing sword, and my hand takes hold on judgment, I
will take vengeance upon mine enemies, and I will repay those who haze
me. Oh, Lord, raise me to Thy right hand and count me among Thy
saints.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Force Close pop up when uncaught exception during background service

2009-08-28 Thread Streets Of Boston

That is very handy for bug-processing.

But Dianne's answer is better :=)
Fix the issue that throws the exception causing the thread to exit and
the activity for force-close. Or handle the exception by catching and
dealing with it.


On Aug 28, 1:55 am, dweebo dwe...@gmail.com wrote:
 I was looking to do the same thing, or rather to log the stacktraces
 remotely for later debugging.
 Seehttp://code.google.com/p/android-remote-stacktrace/for how
 someone else handled it, works great!

 You could modify their code to suppress android's force close dialog,
 I think you just have to not call the default exception handler at the
 end of DefaultExceptionHandler.
 -Peter

 On Aug 1, 11:30 pm, life0...@gmail.com life0...@gmail.com wrote:



  Hi,
      I started a background service process...however, when there is an
  uncaught java exception in one of the threads in that background
  service process, a Force Close dialog pops up oo the screen saying
  Application XXX stopped unexpectly. My question is, why a thread in
  background service process can cause this Force Close dialog ? where
  is the code to draw that dialog ? Can I suppress the android platform
  to do thathow ? this is annoying as the background process will
  restart itselfand I do not want this type of window to destroy the
  UI.

  Thanks,- Hide quoted text -

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



[android-developers] Re: Move focus to top of activity on create

2009-08-28 Thread jsdf

Thanks for the response.
The answer turned out to be less intuitive than I thought.

Instead of:
ScrollView main = (ScrollView) findViewById(R.id.main);
main.scrollTo(0,0);

I used:
final ScrollView main = (ScrollView) findViewById(R.id.main);
main.post(new Runnable() {
public void run() {
main.scrollTo(0,0);
}
});

and achieved the desired results.

(source: 
http://groups.google.com/group/android-developers/browse_thread/thread/1a36f62df821d771
)

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

2009-08-28 Thread Chris Stratton

On Aug 28, 5:54 am, tstanly tsai.sta...@gmail.com wrote:

 I want to use command like ls,mkdir,cd,./..etc, in the app,
 somebody says use Runtime class,

 Runtime.getRuntime().exec(ls);

 but there is nothing happen..

ls may  not be a great choice as it's not going to have any way to
display output unless  you go to some effort to give it one.

Try touching a dummy file in /sdcard

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

2009-08-28 Thread Tony Wong

Thanks for your reply Zsolt, but the elements in your example don't
appear to scroll with the map. The behaviour I want is seen in Google
Maps, when the user scrolls around the map, the next and previous
buttons are anchored to a specific OverlayItem. To state in another
way, I want to have buttons that remain at a certain latitude and
longitude on the map.


On Aug 27, 10:59 am, Zod zsolt.ba...@gmail.com wrote:
 Hi!

 The easiest way to put buttons on your map is to use a RelativeLayout.
 Put the MapView into it and after that you can put there other layout
 objects too.
 In the RelativeLayout the view you put after the map view can be over
 it, so you can draw anything over the map this way, and you don't need
 to worry about the draw() part.

 Here is a simple layout xml I used to put a left and right arrow and a
 textView over the map.

 ?xml version=1.0 encoding=utf-8?

 RelativeLayout android:id=@+id/MainLayout xmlns:android=http://
 schemas.android.com/apk/res/android
 android:layout_height=fill_parent
 android:layout_width=fill_parent

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/AJE
 android
     android:id=@+id/MapLayout
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent

     com.google.android.maps.MapView
         android:id=@+id/MapView
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:clickable=true
         android:apiKey=--apikey--
     /

 /LinearLayout

 LinearLayout android:id=@+id/ButtonLayout
 android:layout_centerHorizontal=true
 android:layout_alignParentTop=true
 android:layout_width=wrap_content
 android:layout_height=fill_parent android:layout_marginTop=5px
 Button android:id=@+id/MapPrevButton
 android:layout_width=wrap_content android:drawableLeft=@drawable/
 ic_menu_back android:layout_height=wrap_content/Button

 Button android:layout_width=wrap_content
 android:layout_height=wrap_content android:id=@+id/
 MapDetailsButton android:layout_weight=1.0 android:text=b/
 ButtonButton android:id=@+id/MapNextButton
 android:layout_width=wrap_content android:drawableRight=@drawable/
 ic_menu_forward android:layout_height=wrap_content/Button

 /LinearLayout
 /RelativeLayout

 After this you can hide and show the MapLayout view as you wish, and
 bind event handlers to it as usual (and also design it in eclipse as
 you normally would).

 Bye,
     Zsolt

 On Aug 27, 4:28 pm, Tony Wong manifa..@gmail.com wrote:

  In Google Maps, when you complete a search and go to map mode
  browsing, you see two types of overlay objects. One of the overlays
  contain a title, description, and left and right buttons. The buttons
  have different states (normal, disabled, pressed down) so the overlay
  must be more complex than the default provided one. Can anyone point
  me to the right direction on how to implement this type of
  functionality? The only point of entry I can see from searching for
  examples is draw() in ItemizedOverlay, but is that an area where I can
  add buttons? Perhaps they are using something separate from the
  MapView classes altogether, can anyone enlighten 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] Eclipse: Debug Tab - Dead Debug Sessions.

2009-08-28 Thread sdphil

Using Eclipse - in the Debug tab, when you debug, a session appears
there.  When you stop, and hit the Double X's it goes away. (sorry
for all the technical jargon -- ha ha ha ha ha).

Anyway, when your project has errors and you attempt to debug, a
dialog pops up and says Your project contains error(s), please fix
them before running your application.  But a 'debug session' still
appears in the debug tab, and it doesn't seem like you can make it go
away (short of restarting eclipse).

Wondering if there's a way to clean those up?

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



[android-developers] Re: Force screen orientation and avoid destroy call

2009-08-28 Thread Derek

Another question:
android:screenOrientation=portrait locks the screen orientation,
that's fine.
But it is possible to do the same in Activity source code ? (i.e.
removing the screenOrientation in AndroidManifest.xml).

I've tried the following code to keep the initial orientation but it
fails.

private int initialOrientation =
Configuration.ORIENTATION_UNDEFINED;

public void onCreate(Bundle savedInstanceState) {
initialOrientation = getResources().getConfiguration
().orientation;
...
}

public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
setRequestedOrientation(initialOrientation);
}

I've also tried with:
initialOrientation = getResources().getConfiguration().orientation;
initialOrientation = getRequestedOrientation();
initialOrientation = getWindow().getWindowManager().getDefaultDisplay
().getOrientation();


Thanks for the help.

On Aug 27, 9:54 pm, Mark Murphy mmur...@commonsware.com wrote:
  I want my Activity to be always in portrait mode and I do NOT want the
  onDestroy() method to be called.
  There are some interesting articles about that at:
 http://www.androidguys.com/2008/11/24/rotational-forces-part-four/

  The solution seems to be:
  In AndroidManifest.xml:
          activity android:name=.MyActivity
                       android:screenOrientation=portrait
                       android:configChanges=keyboardHidden|orientation

  In Activity code:
      public void onConfigurationChanged(Configuration newConfig)
      {
             super.onConfigurationChanged(newConfig);
      }

  I've tried it and it seems to work. Is there any other alternative or
  is it the correct solution?

 Well, I think it's the correct solution. But, then again, I'm biased in
 favor of the author of that fine, upstanding blog post.

 ;-)

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: some way to check available activities

2009-08-28 Thread Balwinder Kaur (T-Mobile USA)

hmm...android.content.ActivityNotFoundException is a
java.lang.RuntimeException, and runtime exceptions are not enforced by
the compiler to be caught, but yes, they can be caught.

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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


On Aug 27, 7:10 pm, tansaku tans...@gmail.com wrote:
 Is there some way to check the set of available activities?  I want to
 check for the presence of android.speech.action.RECOGNIZE_SPEECH in
 order to disable buttons that will take the user to that function on
 phones that don't have the voice recognition support.

 At the moment all I can tell is that I get the following exception:

 android.content.ActivityNotFoundException: No Activity found to handle
 Intent { action=android.speech.action.RECOGNIZE_SPEECH (has extras) }

 Other posts on this list seem to suggest this exception can't be
 caught.  Perhaps there is a base level Java way to determine if the
 library is available.

 Any help greatly appreciated.

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

2009-08-28 Thread Balwinder Kaur (T-Mobile USA)

The android.preference package maybe a good candidate for what you
wish to do.

http://developer.android.com/reference/android/preference/package-summary.html

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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

On Aug 28, 12:37 am, mawa m...@gmx.de wrote:
 Hi,

 where is the right place to specify general user-defined properties,
 like a host address or a service mail address ? The properties should
 be accessible from my activities.

 I would like to specify such attributes within the
 AndroidManifest.xml, but there seems to be no elements available for
 user-defined properties. So the only way may be to put such properties
 into a resource file as strings or to hide them into the source code.

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



[android-developers] Other home applications breaking our app

2009-08-28 Thread for android
Hi,

Our application is being used by many users,unfortunately,when they start
the app with some desktop applications the application does not open at
all.This make users think that our app is buggy.Has this behaviour been
noticed by other developers.This is really bad for us.

Our app works perfectly fine when opened from the default Home application

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: Can not access my own service

2009-08-28 Thread Roman ( T-Mobile USA)

Only for testing purpose, instead of using your own created
permission, use an already defined system permission and check whether
your code works fine. If yes, you know that there are some problems
with how you define and expose your own permission.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Aug 28, 3:29 am, Lutz Schönemann
lutz.schoenem...@sit.fraunhofer.de wrote:
 Hi, my current problem is to access my own service. The thing is I  
 have 2 interfaces for my service and want to restrict one of them to  
 applications that have a special permission.

 I have a service and an activity in one package. The application has  
 that special permission but I always get a security exception:

 I've tried the to following things:

 1) put the check inside the onBind() method:

         @Override
         public IBinder onBind(Intent intent) {
                 if(intent.getAction() != null 
                                 
 intent.getAction().equals(ACTION_SERVICE_MANAGEMENT)) {
                         // check permission
                         if(checkCallingPermission(PERMISSION_MANAGEMENT) ==  
 PackageManager.PERMISSION_DENIED) {
                                 Log.d(TAG, Checked for permission:  + 
 PERMISSION_MANAGEMENT +  
 \nresult:  + checkCallingPermission(PERMISSION_MANAGEMENT));
                                 throw new SecurityException();
                         }

                         // return management binder
                         return mManagementBinder;
                 }

                 if(_DEBUG) Log.d(TAG, onBind finished);
                 // call was not local so return public binder
                 return mBinder;
         }

 2) ptu the check inside a method of the binder it self:

         private IServiceManagement.Stub mManagementBinder = new  
 IServiceManagement.Stub() {

                 public String[] getRoles() throws RemoteException {
                         return PDPService.this.getRoles();
                 }

                 public void updatePolicy(String policyuri) {
                         // check permission
                         if(checkCallingPermission(PERMISSION_MANAGEMENT) ==  
 PackageManager.PERMISSION_DENIED) {
                                 Log.d(TAG, Checked for permission:  + 
 PERMISSION_MANAGEMENT +  
 \nresult:  + checkCallingPermission(PERMISSION_MANAGEMENT));
                                 throw new SecurityException();
                         }
                         Uri uri = Uri.parse(policyuri);
                         Service.this.updateFile(uri, Service.POLICY_FILE);
                 }
         }

 both cases end with a security exception (the one I throw). The result  
 of checkCallingPermission is always -1  
 (PackageManager.PERMISSION_DENIED). I have doublechecked that the name  
 of the permission in code is the same as the one specified in the  
 manifest file.

 What am I doing wrong?

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



[android-developers] Re: how to pass an Object from one activity to another.

2009-08-28 Thread Balwinder Kaur (T-Mobile USA)

http://developer.android.com/guide/appendix/faq/framework.html#3

Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

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


On Aug 28, 9:24 am, sdphil phil.pellouch...@gmail.com wrote:
 I have an activity which implements an OnItemClickListener.

 in onItemClick() i start another activity --

                 Intent intent = new Intent();
                 intent.setClass(MyActivity1.this, MyActivity2.class);
                 startActivity(intent);

 However, I need to pass some objects from MyActivity1 to MyActivity2
 --

 I see there is an Intent.putExtra() for all the basic types, and I
 even see a Bundle which is a collection of basic types, but how can I
 pass a generic Object to MyActivity2 ?

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



[android-developers] TextView Line Breaks

2009-08-28 Thread Rud

I am trying to insert line breaks into a string resource so they
appear in a TextView. I put in \\n but all I get is \n appearing.
Is there a setting I'm missing?

Rud

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

2009-08-28 Thread Chris Stratton

On Aug 28, 1:11 pm, for android forandr...@gmail.com wrote:
 Hi,

 Our application is being used by many users,unfortunately,when they start
 the app with some desktop applications the application does not open at
 all.This make users think that our app is buggy.Has this behaviour been
 noticed by other developers.This is really bad for us.

 Our app works perfectly fine when opened from the default Home application

Have you obtained one of these alternate home applications and used it
to attempt to launch your application on an instrumented device/
emulator?  What did the various debug and crash logs show?

Business issues aside, I'd want to investigate the problem and figure
out whose fault it is technically.  It could be that the home
application is not starting apps properly, or it could be that you are
making unwarranted assumptions during startup...

You could also try contacting the developers of these alternate home
applications - it could be that there's something for you both to
learn.

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

2009-08-28 Thread Dianne Hackborn
Keep in mind that shell commands are not part of the SDK.  These commands
will and do change between releases, with no predictability (for example
different output, etc).  And for all of the commands that are simple enough
that they are less likely to change (such as mkdir), it is much more
efficient to use the appropriate Java APIs to do the same thing.

On Fri, Aug 28, 2009 at 2:54 AM, tstanly tsai.sta...@gmail.com wrote:


 hi all,

 I want to use command like ls,mkdir,cd,./..etc, in the app,
 somebody says use Runtime class,

 Runtime.getRuntime().exec(ls);


 but there is nothing happen..
 I also use logcat to observe, but have the same result.


 so could app use (linux) command?


 thanks!
 



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

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

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



[android-developers] Re: Force screen orientation and avoid destroy call

2009-08-28 Thread Dianne Hackborn
Just call setRequestedOrientation().  onConfigurationChanged() is a really
bad place to do this though -- you'd typically do it in onCreate().

Note that the transition to your app will be much better if you can specify
the orientation in the manifest, since that way the system knows what
orientation to switch in to before it starts launching your app.

On Fri, Aug 28, 2009 at 10:06 AM, Derek cram.de...@gmail.com wrote:


 Another question:
 android:screenOrientation=portrait locks the screen orientation,
 that's fine.
 But it is possible to do the same in Activity source code ? (i.e.
 removing the screenOrientation in AndroidManifest.xml).

 I've tried the following code to keep the initial orientation but it
 fails.

private int initialOrientation =
 Configuration.ORIENTATION_UNDEFINED;

public void onCreate(Bundle savedInstanceState) {
initialOrientation = getResources().getConfiguration
 ().orientation;
...
 }

public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
 setRequestedOrientation(initialOrientation);
}

 I've also tried with:
 initialOrientation = getResources().getConfiguration().orientation;
 initialOrientation = getRequestedOrientation();
 initialOrientation = getWindow().getWindowManager().getDefaultDisplay
 ().getOrientation();


 Thanks for the help.

 On Aug 27, 9:54 pm, Mark Murphy mmur...@commonsware.com wrote:
   I want my Activity to be always in portrait mode and I do NOT want the
   onDestroy() method to be called.
   There are some interesting articles about that at:
  http://www.androidguys.com/2008/11/24/rotational-forces-part-four/
 
   The solution seems to be:
   In AndroidManifest.xml:
   activity android:name=.MyActivity
android:screenOrientation=portrait
  
  android:configChanges=keyboardHidden|orientation
 
   In Activity code:
   public void onConfigurationChanged(Configuration newConfig)
   {
  super.onConfigurationChanged(newConfig);
   }
 
   I've tried it and it seems to work. Is there any other alternative or
   is it the correct solution?
 
  Well, I think it's the correct solution. But, then again, I'm biased in
  favor of the author of that fine, upstanding blog post.
 
  ;-)
 
  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html
 



-- 
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: programatically detect foreground application/ screen?

2009-08-28 Thread Hong
You can use ActivityManager to query list of running tasks
(getRunningTasks(int))

On Thu, Aug 20, 2009 at 2:22 AM, Chris Stratton cs07...@gmail.com wrote:


 Is there any way for a backfround task to programmatically detect or
 recognize by learned id which application or screen (different
 package) is showing?

 I don't really want to resort to analizing a screenshot...
 


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

2009-08-28 Thread Hong
ActivityManager : getRunningTasks(int)

On Thu, Aug 27, 2009 at 6:24 PM, GodsMoon godsm...@gmail.com wrote:


 That might be enough info for my app.
 Which api are you looking at?



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

2009-08-28 Thread Dianne Hackborn
Um, finish() closes and destroys the instance.  There isn't a way around
that, sorry.

On Fri, Aug 28, 2009 at 1:42 AM, Charles canss...@gmail.com wrote:


 whaoo your command give me a large report.
 Do you know how to avoid the restarting of my activity B, i close it
 with finish();

 adb shell dumpsys activity :

 aProcessRecord{438b96e8 2966:com.android.mms/10009}
class=com.android.mms.MmsApp
manageSpaceActivityName=null
dir=/system/app/Mms.apk publicDir=/system/app/Mms.apk data=/data/
 data/com.an
 droid.mms
packageList=[com.android.mms]
instrumentationClass=null instrumentationProfileFile=null
instrumentationArguments=null
thread=android.app.applicationthreadpr...@43523428
 curReceiver=null
pid=2966 starting=false lastPss=2527232
maxAdj=15 hiddenAdj=7 curRawAdj=7 setRawAdj=7 curAdj=7 setAdj=7
isForeground=false setIsForeground=false foregroundServices=false
 forcingToF
 oreground=null
persistent=false removed=false persistentActivities=0
debugging=false crashing=false null notResponding=false null
 bad=false
activities=[]
services=[ServiceRecord{4379da78
 com.android.mms/.transaction.TransactionSer
 vice}]
executingServices=[]
connections=[]
pubProviders={}
conProviders=[ContentProviderRecord{435cdad0
 com.android.providers.settings.
 SettingsProvider}]
receivers=[ReceiverList{437f2240 2966 com.android.mms/10009 client
 437f2010}
 , ReceiverList{4354df00 2966 com.android.mms/10009 client 43576ce8},
 ReceiverLis
 t{43648380 2966 com.android.mms/10009 client 43653968}]
  *PERSISTENT* Process [system] UID 1000
ProcessRecord{4364ea00 56:system/1000}
class=null
manageSpaceActivityName=null
dir=/system/framework/framework-res.apk publicDir=/system/
 framework/framewor
 k-res.apk data=/data/system
packageList=[com.android.providers.subscribedfeeds,
 com.google.android.serve
 r.checkin, com.android.providers.settings, android]
instrumentationClass=null instrumentationProfileFile=null
instrumentationArguments=null
thread=android.app.activitythread$applicationthr...@4353b3f0
 curReceiver=nul
 l
pid=56 starting=false lastPss=0
maxAdj=-16 hiddenAdj=11 curRawAdj=0 setRawAdj=-100 curAdj=-16
 setAdj=-100
isForeground=false setIsForeground=false foregroundServices=false
 forcingToF
 oreground=null
persistent=true removed=false persistentActivities=0
debugging=false crashing=false null notResponding=false null
 bad=false
activities=[]
services=[ServiceRecord{436aa898
 com.google.android.server.checkin/.CheckinS
 ervice}]
executingServices=[]
connections=[ConnectionRecord{436b5760
 com.android.inputmethod.latin/.LatinI
 ME:@43754d48}]
pubProviders={android.content.SyncProvider=ContentProviderRecord
 {435c4638 an
 droid.content.SyncProvider},
 com.android.providers.settings.SettingsProvider=Con
 tentProviderRecord{435cdad0
 com.android.providers.settings.SettingsProvider}, co

 m.android.providers.subscribedfeeds.GoogleSubscribedFeedsProvider=ContentProvide
 rRecord{435c54b0
 com.android.providers.subscribedfeeds.GoogleSubscribedFeedsProv
 ider},
 com.google.android.server.checkin.CheckinProvider=ContentProviderRecord
 {4
 35caea0 com.google.android.server.checkin.CheckinProvider}}
conProviders=[]
receivers=[ReceiverList{436212c0 56 system/1000 client 43634778},
 ReceiverLi
 st{436aa3c0 56 system/1000 client 436aa290}, ReceiverList{43692900 56
 system/100
 0 client 436927b0}, ReceiverList{436fad48 56 system/1000 client
 436fab08}, Recei
 verList{43648408 56 system/1000 client 43648240}, ReceiverList
 {43692f88 56 syste
 m/1000 client 43692e38}, ReceiverList{43694508 56 system/1000 client
 436943c8},
 ReceiverList{436a9710 56 system/1000 client 436a9568}, ReceiverList
 {436a2710 56
 system/1000 client 436a24c8}, ReceiverList{43668f90 56 system/1000
 client 43668f
 30}, ReceiverList{4363af50 56 system/1000 client 43529c80},
 ReceiverList{43736a5
 8 56 system/1000 client 43738f80}, ReceiverList{43545498 56 system/
 1000 client 4
 3521950}, ReceiverList{435ef958 56 system/1000 client 434fca58},
 ReceiverList{43
 65f198 56 system/1000 client 4365f048}, ReceiverList{4369da18 56
 system/1000 cli
 ent 4369d8b8}, ReceiverList{436a0898 56 system/1000 client 436a0728},
 ReceiverLi
 st{436a9120 56 system/1000 client 436a8fe0}, ReceiverList{436a6da0 56
 system/100
 0 client 436a6c20}, ReceiverList{436519e0 56 system/1000 client
 436127b8}, Recei
 verList{43521ae0 56 system/1000 client 4354f688}, ReceiverList
 {4361dca0 56 syste
 m/1000 client 43558c40}, ReceiverList{435f6a60 56 system/1000 client
 436283d0},
 ReceiverList{436fd6e8 56 system/1000 client 436fd548}, ReceiverList
 {436a1568 56
 system/1000 client 436a13c0}, ReceiverList{43616f68 56 system/1000
 client 4362c5
 c8}, ReceiverList{43665268 56 system/1000 client 435af370},
 ReceiverList{43645e2
 8 56 system/1000 client 43636070}, ReceiverList{435ebee8 56 system/
 1000 client 4
 3557788}, ReceiverList{43670468 56 

  1   2   3   >