[android-developers] Re: WebView and https post problem

2009-04-18 Thread Evgeny V
Thank you very much for feedback!

Regarding the loop. Of course I don't do it inside a loop. The sent code is
first attempt and contains this bug.

Will use BasicResponseHandler to handle result. It definitely can casue the
performance probpem. Do you think the way I'm extracting the resopnse string
can casue the other mentioned problems?
Thanks,
Evgeny

On Sun, Apr 19, 2009 at 6:37 AM, Chander Pechetty wrote:

>
>
> Not sure why you are initializing one time settings of WebView in a
> while loop. (and also the StringBuffer.toString inside a loop fed to
> WebView)
> It doesn't look right to me. Use 
> org.apache.http.impl.client.BasicResponseHandler  for getting the
> string from the http response  to feed 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: Anybody can help me with the control style?

2009-04-18 Thread AllSet

Hi Greg,

wow. Thanks a lot for such detailed information.

I have been trying to do what i described above with View and
Animation, just like you said.

and it seems to work just fine, though currently doesn't look so good
as "ZoomControls" :)

maybe i should use some images in the Views instead of pure text.

Thanks again and it helps a lot~:)

Fu


On Apr 5, 2:26 pm, Greg Krimer  wrote:
> Hi,
>
> A good place to start is to look at the ApiDemos application to see if
> there is anything there close to what you want. The best I found is
> com.example.android.apis.view.Animation2, which uses a ViewFlipper to
> transition from one view to another with various animations. It's not
> exactly what we want, because we actually want to fade in/out a single
> view. But Animation2 does give us the names of the fading animations:
> android.R.anim.fade_in and android.R.anim.fade_out.
>
> You can apply an animation to any view (and its children) by calling
> startAnimation(). So ...
>
>     myView.startAnimation(AnimationUtils.loadAnimation(mContext,
> android.R.anim.fade_in))
>
> ... would fade in the view and ...
>
>     myView.startAnimation(AnimationUtils.loadAnimation(mContext,
> android.R.anim.fade_out))
>
> ... would fade it out.
>
> The trick is that when the animation ends we want to change the
> visibility of the view. If we are fading in then at the end of the
> animation we want to make the view visible. If we are fading out then
> at the end of the animation we want to make the view invisible.
>
> Luckily, views have a onAnimationEnd() method that is called when the
> animation terminates. We can override this method and change the
> visibility of the view as appropriate. Because we want to override a
> method we will need a custom view. Our custom view might have methods
> like this:
>
>         public void fadeIn() {
>                 startAnimation(AnimationUtils.loadAnimation(mContext,
> android.R.anim.fade_in));
>                 mVisibilityOnAnimationEnd = VISIBLE;
>         }
>
>         public void fadeOut() {
>                 startAnimation(AnimationUtils.loadAnimation(mContext,
> android.R.anim.fade_out));
>                 mVisibilityOnAnimationEnd = INVISIBLE;
>         }
>
>         @Override public void onAnimationEnd() {
>                 super.onAnimationEnd();   // make sure to chain up to 
> superclass
> method
>                 setVisibility(mVisibilityOnAnimationEnd);
>         }
>
>         private int mVisibilityOnAnimationEnd;
>
> Anyway, that's the simplest way I can think of doing this. Anyone have
> other ideas?
>
> Now, we still need to figure out what View to extend. Every view
> accepts the onClick event, so we can extend ImageView. But the zoom
> control has two clickable images, so more likely we will need to
> extend a view group such as LinearLayout.
>
> Getting our view to appear now just requires calling fadeIn() and
> getting our view to disappear just requires calling fadeOut(). To get
> the view to disappear after a delay create a Handler and either send
> it a message with a delay or post a runnable with a delay.
>
> Hope that gets you started.
>
> Greg
>
> On Apr 4, 1:48 am, AllSet  wrote:
>
>
>
> > i am trying to make a control which looks like the ZoomControls.
>
> > it is supposed to show up when clicking in a certain area and
> > disappear a few seconds later.
>
> > also it should accept the onClick event.
>
> > but i don't know exactly how to realize such a control.
>
> > could anybody help me?
>
> > 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: Some problems in cupcake imf

2009-04-18 Thread Lewis

Hello, I am currently trying to work with InputMethodService.

Have you managed to successfully override the default keypad? I would
love to see the code if I could?

Thanks

Lewis

On Mar 27, 8:04 am, Paranoia  wrote:
> i am developing an ime on android. i have some questions.
>
> 1. why InputMethodService force the ime developer to follow the fixed
> layout - extracted text, candidate view and input view. i want to
> layout them by myself. can i do this via derive the
> AbstractInputMethodService? if yes, can android team keep this
> abstract class always open and stable? BTW: InputMethodService is
> really hard to use.
>
> 2. what's the correct behavior of the InputConnection.commitText?
> i write the following code. but it can not satisfy me.
> ...
> InputConnection ic = getInputConnection();
> ic.commitText(textA, 1);
> ic.commitText(textB, 0);
>
> i want the cursor to before the textB and after the textA. but it
> always be present after textB.
>
> anyone can answer my questions?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] how to parse and analyze the call stack of native code? any tools?

2009-04-18 Thread Paranoia

Thanks!

the following is the log from native code.

I/DEBUG   (  543): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (  543): Build fingerprint: 'generic/generic/generic/:1.5/
CUPCAKE/eng.xx.20090418.095237:eng/test-keys'
I/DEBUG   (  543): pid: 644, tid: 644  >>> com.xxx..xxx <<<
I/DEBUG   (  543): signal 7 (SIGBUS), fault addr 
I/DEBUG   (  543):  r0 0019a890  r1 054c  r2   r3 00198aa0
I/DEBUG   (  543):  r4 016a0002  r5 44d1b338  r6 0005  r7 0013f4f8
I/DEBUG   (  543):  r8 beb81550  r9 41049ba8  10 41049b94  fp 
I/DEBUG   (  543):  ip 00ce  sp beb813d0  lr afc1d698  pc
804216fc  cpsr 2030
I/DEBUG   (  543):  #00  pc 000216fc  /system/lib/lib.so
I/DEBUG   (  543):  #01  pc 0001279c  /system/lib/lib.so
I/DEBUG   (  543):  #02  pc d41a  /system/lib/lib.so
I/DEBUG   (  543):  #03  pc c59e  /system/lib/lib.so
I/DEBUG   (  543):  #04  pc b486  /system/lib/lib.so
I/DEBUG   (  543):  #05  pc c252  /system/lib/lib.so
I/DEBUG   (  543):  #06  pc 8a7a  /system/lib/lib.so
I/DEBUG   (  543):  #07  pc e3b4  /system/lib/libdvm.so


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



[android-developers] Re: WebView and https post problem

2009-04-18 Thread Chander Pechetty


Not sure why you are initializing one time settings of WebView in a
while loop. (and also the StringBuffer.toString inside a loop fed to
WebView)
It doesn't look right to me. Use 
org.apache.http.impl.client.BasicResponseHandler  for getting the
string from the http response  to feed 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] EditView inputType

2009-04-18 Thread Brian Conrad

Since "Numeric" has been deprecated what do you enter in the Layout 
properties for Input type?   For integer  I can use 
EditInfo.TYPE_CLASS_NUMBER when using  
setInputType(EditorInfo.TYPE_CLASS_NUMBER) but that doesn't work in the 
layout editor.  Are there some examples I haven't stumbled upon yet?

- Brian



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



[android-developers] Question about MotionEvents

2009-04-18 Thread pperotti

hi everyone,

Can anyone give me a clue about how can I do to make a list scroll
down or up programatically ?

I'm trying to understand how to trigger the same motion event that
happen when a list scrolls down or up as a consecuence o a touch.

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



[android-developers] Re: Distinguishing Between Edge and 3G network

2009-04-18 Thread Moto

I believe what you are saying is true, but as of now this is the best
and fastest way to achieve a "guess" as of how fast the users data
connection is...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: memory problems

2009-04-18 Thread Dianne Hackborn
You really should not be forcing the garbage collector to run like this, and
there should be no need to do so.

On Sat, Apr 18, 2009 at 11:31 AM, JP  wrote:

>
>
> You may get this resolved by calling the garbage collector right
> there; system.gc() after you dereference the byte array with
> buff=null;
>
>
> On Apr 17, 2:01 pm, petunio  wrote:
> > Hi
> >
> > I know this is more a java question, but I have been in many java
> > forums, and the theory seems to contradict the real thing...
> >
> > I have a very simple function that creates memory, do something with
> > it, and returns:
> >
> > static void test(int k)
> > {
> > byte [] buff = new byte[k];
> >
> > //do some stuff with  buff[]
> >
> > buff=null;
> >
> > }
> >
> > After a few calls to this function, it runs out memory
> > In C++ I would use delete at the end, and here in java I've been told
> > that GC takes care of it, but it seems that it does not
> > Am I doing something wrong? how can I free this temp memory after I
> > have used it?
> >
> > many 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: Distinguishing Between Edge and 3G network

2009-04-18 Thread Dianne Hackborn
Keep in mind that in the future there will be other network types, such as
on CDMA devices in the near future, and whatever new cell network protocols
appear even later.  Depending on comparing against a fixed set of types is
not robust.

On Sat, Apr 18, 2009 at 4:11 PM, Moto  wrote:

>
> How about you use:
>
> TelephonyManager c=(TelephonyManager) Context.getSystemService
> (Context.TELEPHONY_SERVICE);
>
>switch (c.getNetworkType())
>{
>case TelephonyManager.NETWORK_TYPE_UNKNOWN:
>Log.i("CONNECTION", "UNKNOWN");
>break;
>case TelephonyManager.NETWORK_TYPE_EDGE:
>Log.i("CONNECTION", "EDGE");
>break;
>case TelephonyManager.NETWORK_TYPE_GPRS:
>Log.i("CONNECTION", "GPRS");
>break;
>case TelephonyManager.NETWORK_TYPE_UMTS:
>Log.i("CONNECTION", "UMTS");
>break;
>}
>
> might do the trick ;)
>
> Moto!
> >
>


-- 
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: Check if a View contains another View

2009-04-18 Thread Dianne Hackborn
Er...  if you have an ArrayList that you are putting one item in, why not
just have a pointer?  Much less overhead.

Also you can assign your own id and still use findViewById().

And keep in mind that AbsoluteLayout is being deprecated in Cupcake, and we
strongly discourage its use since it is very likely you won't be dealing
with the screen being resized.  Generally the best solution would be to just
implement your own layout manager that does your desired layout, as needed,
and can also keep track of interesting views it has in it.

On Sat, Apr 18, 2009 at 4:22 PM, DeRon Brown  wrote:

> I'm not using XML, so that won't work for me, I don't think. However, I
> found another solution. I'm just going to use a button ArrayList (of size
> 1). Each time I'll check to see if the ArrayList's size is greater than
> zero, if it is, I remove the button in the list from the view.
>
>
> On Sat, Apr 18, 2009 at 7:15 PM, Marco Nelissen wrote:
>
>> View.findViewById() ?
>>
>>
>>
>> On Sat, Apr 18, 2009 at 2:52 PM, xspotlivin wrote:
>>
>>>
>>> Is there a way to check if a view contains another certain view? I
>>> have an AbsoluteLayout view that I add multiple views to (buttons). I
>>> have a certain button, let's call it reportButton, and I want to check
>>> to see if its already within my AbsoluteLayout view. Is there like an
>>> AbsoluteLayout.contains(reportButton) method or something of the kind?
>>>
>>> This is what I want to do. "myLayout" is the absolutelayout and
>>> "reportAll" is the button.
>>>
>>>class reportAllButtonThread implements Runnable {
>>>//@Override
>>>public void run() {
>>>while(true) {
>>>if (myLayout.contains(reportAll)) {
>>>//Do something
>>>}
>>>}
>>>}
>>>}
>>>
>>> Suggestions?
>>>
>>> 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: Check if a View contains another View

2009-04-18 Thread DeRon Brown
I'm not using XML, so that won't work for me, I don't think. However, I
found another solution. I'm just going to use a button ArrayList (of size
1). Each time I'll check to see if the ArrayList's size is greater than
zero, if it is, I remove the button in the list from the view.

On Sat, Apr 18, 2009 at 7:15 PM, Marco Nelissen  wrote:

> View.findViewById() ?
>
>
>
> On Sat, Apr 18, 2009 at 2:52 PM, xspotlivin  wrote:
>
>>
>> Is there a way to check if a view contains another certain view? I
>> have an AbsoluteLayout view that I add multiple views to (buttons). I
>> have a certain button, let's call it reportButton, and I want to check
>> to see if its already within my AbsoluteLayout view. Is there like an
>> AbsoluteLayout.contains(reportButton) method or something of the kind?
>>
>> This is what I want to do. "myLayout" is the absolutelayout and
>> "reportAll" is the button.
>>
>>class reportAllButtonThread implements Runnable {
>>//@Override
>>public void run() {
>>while(true) {
>>if (myLayout.contains(reportAll)) {
>>//Do something
>>}
>>}
>>}
>>}
>>
>> Suggestions?
>>
>> 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: Active Calendar app on Android Emulator?

2009-04-18 Thread Omer Saatcioglu

Emulator can not sync with Google Server. You should test the sync
with a real device that had activated with google ID.

On Feb 26, 1:52 pm, Steven Farley  wrote:
> I have the same problem, running the emulator on Mac OS X.  Any
> suggesstions would be appreciated.
>
> On Feb 21, 3:24 am, Tim Bao  wrote:
>
> > Hi, all,
>
> > I am sorry to bring this into such a board audience but seems nobody
> > has posted similar problem or solution on the internet.
>
> > I am trying to use Calendar.apk in the emulator on a windows xp
> > system. The SDK version I am using is 1.1r1. However, the calendar app
> > will always go away with a message "Your events will appear shortly".
> > My guess is that the app is bound with Google account so I go to
> > "Setup"->"DataSynchronization". Once I click the "Data
> >Synchronization", I got a failure reading "The application Google Apps
> > (process com.google.process.gapps) has stopped unexpectedly. Please
> > try again". By check logcat output, I got the following(see the msg at
> > the end). Anybody can help me out how to install the App/Service or
> > configure the service or activate the signin service so that I can use
> > Calendar on emulator? Your help is highly appreciated.
>
> > I/ActivityManager(   52): Starting activity: Intent
> > { action=android.intent.acti
> > on.MAIN comp={com.android.settings/
> > com.android.settings.SyncSettings} }
> > W/GoogleLoginService(  181): Device has no accounts: sending Intent
> > { action=and
> > roid.accounts.LOGIN_ACCOUNTS_MISSING }
> > I/GoogleLoginService.PasswordEncrypter(  181): no public key available
> > I/ActivityManager(   52): Stopping service:
> > com.google.android.googleapps/.Googl
> > eLoginService
> > I/ActivityManager(   52): Displayed activity
> > com.android.settings/.SyncSettings:
> >  883 ms
> > I/ActivityManager(   52): Starting activity: Intent { comp=
> > {com.google.android.g
> > oogleapps/com.google.android.googleapps.RunSetupWizardActivity} (has
> > extras) }
> > I/ActivityManager(   52): Start proc com.google.process.app for
> > activity com.goo
> > gle.android.googleapps/.RunSetupWizardActivity: pid=449 uid=10016 gids=
> > {3003}
> > I/ActivityManager(   52): Starting activity: Intent { comp=
> > {com.android.setupwiz
> > ard/com.android.setupwizard.AccountIntroActivity} (has extras) }
> > D/AndroidRuntime(  449): Shutting down VM
> > W/dalvikvm(  449): threadid=3: thread exiting with uncaught exception
> > (group=0x4
> > 000fe68)
> > E/AndroidRuntime(  449): Uncaught handler: thread main exiting due to
> > uncaught e
> > xception
> > E/AndroidRuntime(  449): java.lang.RuntimeException: Unable to start
> > activity Co
> > mponentInfo{com.google.android.googleapps/
> > com.google.android.googleapps.RunSetup
> > WizardActivity}: android.content.ActivityNotFoundException: Unable to
> > find expli
> > cit activity class {com.android.setupwizard/
> > com.android.setupwizard.AccountIntro
> > Activity}; have you declared this activity in your
> > AndroidManifest.xml?
> > E/AndroidRuntime(  449):        at
> > android.app.ActivityThread.performLaunchActiv
> > ity(ActivityThread.java:2141)
> > E/AndroidRuntime(  449):        at
> > android.app.ActivityThread.handleLaunchActivi
> > ty(ActivityThread.java:2157)
> > E/AndroidRuntime(  449):        at android.app.ActivityThread.access
> > $1800(Activi
> > tyThread.java:112)
> > E/AndroidRuntime(  449):        at android.app.ActivityThread
> > $H.handleMessage(Ac
> > tivityThread.java:1581)
> > E/AndroidRuntime(  449):        at android.os.Handler.dispatchMessage
> > (Handler.ja
> > va:88)
> > E/AndroidRuntime(  449):        at android.os.Looper.loop(Looper.java:
> > 123)
> > E/AndroidRuntime(  449):        at android.app.ActivityThread.main
> > (ActivityThrea
> > d.java:3739)
> > E/AndroidRuntime(  449):        at
> > java.lang.reflect.Method.invokeNative(Native
> > Method)
> > E/AndroidRuntime(  449):        at java.lang.reflect.Method.invoke
> > (Method.java:5
> > 15)
> > E/AndroidRuntime(  449):        at com.android.internal.os.ZygoteInit
> > $MethodAndA
> > rgsCaller.run(ZygoteInit.java:739)
> > E/AndroidRuntime(  449):        at
> > com.android.internal.os.ZygoteInit.main(Zygot
> > eInit.java:497)
> > E/AndroidRuntime(  449):        at dalvik.system.NativeStart.main
> > (Native Method)
>
> > E/AndroidRuntime(  449): Caused by:
> > android.content.ActivityNotFoundException: U
> > nable to find explicit activity class {com.android.setupwizard/
> > com.android.setup
> > wizard.AccountIntroActivity}; have you declared this activity in your
> > AndroidMan
> > ifest.xml?
> > E/AndroidRuntime(  449):        at
> > android.app.Instrumentation.checkStartActivit
> > yResult(Instrumentation.java:1467)
> > E/AndroidRuntime(  449):        at
> > android.app.Instrumentation.execStartActivity
> > (Instrumentation.java:1441)
> > E/AndroidRuntime(  449):        at
> > android.app.Activity.startActivityForResult(A
> > ctivity.java:2526)
> > E/AndroidRuntime(  449):        at
>

[android-developers] Re: Check if a View contains another View

2009-04-18 Thread Marco Nelissen
View.findViewById() ?


On Sat, Apr 18, 2009 at 2:52 PM, xspotlivin  wrote:

>
> Is there a way to check if a view contains another certain view? I
> have an AbsoluteLayout view that I add multiple views to (buttons). I
> have a certain button, let's call it reportButton, and I want to check
> to see if its already within my AbsoluteLayout view. Is there like an
> AbsoluteLayout.contains(reportButton) method or something of the kind?
>
> This is what I want to do. "myLayout" is the absolutelayout and
> "reportAll" is the button.
>
>class reportAllButtonThread implements Runnable {
>//@Override
>public void run() {
>while(true) {
>if (myLayout.contains(reportAll)) {
>//Do something
>}
>}
>}
>}
>
> Suggestions?
>
> 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: Distinguishing Between Edge and 3G network

2009-04-18 Thread Moto

How about you use:

TelephonyManager c=(TelephonyManager) Context.getSystemService
(Context.TELEPHONY_SERVICE);

switch (c.getNetworkType())
{
case TelephonyManager.NETWORK_TYPE_UNKNOWN:
Log.i("CONNECTION", "UNKNOWN");
break;
case TelephonyManager.NETWORK_TYPE_EDGE:
Log.i("CONNECTION", "EDGE");
break;
case TelephonyManager.NETWORK_TYPE_GPRS:
Log.i("CONNECTION", "GPRS");
break;
case TelephonyManager.NETWORK_TYPE_UMTS:
Log.i("CONNECTION", "UMTS");
break;
}

might do the trick ;)

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



[android-developers] Check if a View contains another View

2009-04-18 Thread xspotlivin

Is there a way to check if a view contains another certain view? I
have an AbsoluteLayout view that I add multiple views to (buttons). I
have a certain button, let's call it reportButton, and I want to check
to see if its already within my AbsoluteLayout view. Is there like an
AbsoluteLayout.contains(reportButton) method or something of the kind?

This is what I want to do. "myLayout" is the absolutelayout and
"reportAll" is the button.

class reportAllButtonThread implements Runnable {
//@Override
public void run() {
while(true) {
if (myLayout.contains(reportAll)) {
//Do something
}
}
}
}

Suggestions?

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 apply LOCAL_AAPT_FLAGS to eclipse project?

2009-04-18 Thread Xavier Ducrohet

There is no way to do this in ADT at this time, sorry.

Xav

On Tue, Apr 7, 2009 at 8:42 PM, moontain  wrote:
> Hi,
>
> In the Android.mk, there are AAPT flags set as below.
> LOCAL_AAPT_FLAGS := -0 .dat
>
> I'm wondering how to apply this AAPT flag in the eclipse project, so that
> the .dat raw data files will not be compressed in .apk? thanks.
>
>
> Regards,
> Moontain
>
> >
>



-- 
Xavier Ducrohet
Android Engineer, Google.

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



[android-developers] Re: maps api and 1.5

2009-04-18 Thread Xavier Ducrohet

As long as you set the build target to be "Google APis" and set the
uses-library you should be good.

Is the class net.company.android.OrgMapActivity in a different project
referenced by your app project?

Xav

On Sat, Apr 18, 2009 at 7:15 AM, wayne mcfadden- Red Droid
 wrote:
>
> Sorry guys, originally i posted to discussion which is the wrong
> place.
>
>
>
> I'm migrating over an application from 1.1 to 1.5 and it uses the
> Google maps. I got through most of the class path issues resolved I
> think but when launching the application I get the following message.
>
> 04-18 13:19:11.598: WARN/dalvikvm(816): Class resolved by unexpected
> DEX: Lnet/company/android/OrgMapActivity;(0x43732af0):0x192310 ref
> [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/
> MapActivity;(0x43732af0):0x188228
> 04-18 13:19:11.598: WARN/dalvikvm(816): Unable to resolve superclass
> of Lnet/company/android/OrgMapActivity; (106)
> 04-18 13:19:11.608: WARN/dalvikvm(816): Link of class 'Lnet/company/
> android/OrgMapActivity;' failed
>
> So it looks like the error is Unable to resolve superclass  which I
> think is caused by not having
> 
> in the androidmanifest.
>
> In my case, this line is in there. Is there a new uses-library for
> 1.5? Docs say that it's ok. Or specific classpath settings since the
> maps.jar has been moved out? I'm not getting compilation errors, just
> runtime.
>
> I tried moving the maps.jar into the assets directory and that did not
> work either.
>
> Some other trace is below.
> Thanks in advance!
> Wayne McFadden
>
> 04-18 13:43:59.710: WARN/dalvikvm(776): threadid=3: thread exiting
> with uncaught exception (group=0x4000fe70)
> 04-18 13:43:59.710: ERROR/AndroidRuntime(776): Uncaught handler:
> thread main exiting due to uncaught exception
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):
> java.lang.ExceptionInInitializerError
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.Class.newInstanceImpl(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.Class.newInstance(Class.java:1472)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.Instrumentation.newActivity(Instrumentation.java:1097)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2186)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.os.Looper.loop(Looper.java:123)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:782)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> dalvik.system.NativeStart.main(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
> java.lang.NoClassDefFoundError: net.company.android.OrgMapActivity
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> net.company.android.MainActivity.(MainActivity.java:23)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     ... 15 more
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
> java.lang.IllegalAccessError: cross-loader access from pre-verified
> class
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> dalvik.system.DexFile.defineClass(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> dalvik.system.DexFile.loadClass(DexFile.java:193)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.ClassLoader.loadClass(ClassLoader.java:573)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     at
> java.lang.ClassLoader.loadClass(ClassLoader.java:532)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):     ... 16 more
>
>
> >
>



-- 
Xavier Ducrohet
Android Engineer, Google.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegrou

[android-developers] Re: maps api and 1.5

2009-04-18 Thread Brian Conrad

Did you set the project up for level see or Google Apps which include 
the Maps library and 1.5?  Just 1.5 won't do for MapActivity as I found 
out when I recompiled my program but setting it to Google Apps (the 
third setting) fixed it.

wayne mcfadden- Red Droid wrote:
> Sorry guys, originally i posted to discussion which is the wrong
> place.
>
>
>
> I'm migrating over an application from 1.1 to 1.5 and it uses the
> Google maps. I got through most of the class path issues resolved I
> think but when launching the application I get the following message.
>
> 04-18 13:19:11.598: WARN/dalvikvm(816): Class resolved by unexpected
> DEX: Lnet/company/android/OrgMapActivity;(0x43732af0):0x192310 ref
> [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/
> MapActivity;(0x43732af0):0x188228
> 04-18 13:19:11.598: WARN/dalvikvm(816): Unable to resolve superclass
> of Lnet/company/android/OrgMapActivity; (106)
> 04-18 13:19:11.608: WARN/dalvikvm(816): Link of class 'Lnet/company/
> android/OrgMapActivity;' failed
>
> So it looks like the error is Unable to resolve superclass  which I
> think is caused by not having
> 
> in the androidmanifest.
>
> In my case, this line is in there. Is there a new uses-library for
> 1.5? Docs say that it's ok. Or specific classpath settings since the
> maps.jar has been moved out? I'm not getting compilation errors, just
> runtime.
>
> I tried moving the maps.jar into the assets directory and that did not
> work either.
>
> Some other trace is below.
> Thanks in advance!
> Wayne McFadden
>
> 04-18 13:43:59.710: WARN/dalvikvm(776): threadid=3: thread exiting
> with uncaught exception (group=0x4000fe70)
> 04-18 13:43:59.710: ERROR/AndroidRuntime(776): Uncaught handler:
> thread main exiting due to uncaught exception
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776):
> java.lang.ExceptionInInitializerError
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.Class.newInstanceImpl(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.Class.newInstance(Class.java:1472)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.Instrumentation.newActivity(Instrumentation.java:1097)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2186)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.os.Looper.loop(Looper.java:123)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> android.app.ActivityThread.main(ActivityThread.java:3948)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:782)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> dalvik.system.NativeStart.main(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
> java.lang.NoClassDefFoundError: net.company.android.OrgMapActivity
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> net.company.android.MainActivity.(MainActivity.java:23)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): ... 15 more
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
> java.lang.IllegalAccessError: cross-loader access from pre-verified
> class
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> dalvik.system.DexFile.defineClass(Native Method)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> dalvik.system.DexFile.loadClass(DexFile.java:193)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:573)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:532)
> 04-18 13:43:59.979: ERROR/AndroidRuntime(776): ... 16 more
>
>
> >
>
>
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email

[android-developers] Re: memory problems

2009-04-18 Thread JP


You may get this resolved by calling the garbage collector right
there; system.gc() after you dereference the byte array with
buff=null;


On Apr 17, 2:01 pm, petunio  wrote:
> Hi
>
> I know this is more a java question, but I have been in many java
> forums, and the theory seems to contradict the real thing...
>
> I have a very simple function that creates memory, do something with
> it, and returns:
>
> static void test(int k)
> {
> byte [] buff = new byte[k];
>
> //do some stuff with  buff[]
>
> buff=null;
>
> }
>
> After a few calls to this function, it runs out memory
> In C++ I would use delete at the end, and here in java I've been told
> that GC takes care of it, but it seems that it does not
> Am I doing something wrong? how can I free this temp memory after I
> have used it?
>
> many 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: TrackBall an event states: is there always a ACTION_DOWN before ACTION_MOVE

2009-04-18 Thread Tjerk Wolterink
Aha tanks for the info,i dunnot have a device so i was not sure.
Thanks!

2009/4/18 Dianne Hackborn 

> Moves are completely independent from down/up in the trackball, since you
> can move it without having it pressed down.
>
> On Sat, Apr 18, 2009 at 3:09 AM, TjerkW  wrote:
>
>>
>> Hello all,
>>
>> Maybe a stupid question (i dunnot have an android phone),
>> but it is possible to move the trackball without generating an
>> ACTION_DOWN event.
>>
>> So is the trackball both a button and a trackball.. Or is there always
>> an action down event
>> before an action move, like there is with a touchscreen.
>>
>> So again to rephrase the question. Is this sequence of events possible
>> for a trackball:
>>
>> ACTION_MOVE
>> ACTION_DOWN
>> ACTION_MOVE
>> ACTION_UP
>> ACTION_MOVE
>>
>> For a touchscreen it is always
>>
>>
>> ACTION_DOWN
>> ACTION_MOVE
>> ACTION_UP
>>
>>
>> I want to know this for a game: wether i can use the trackball both
>> for shooting and moving.
>> The user should be able to move, but not to shoot..
>>
>>
>>
>>
>
>
> --
> 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.
>
>
>
> >
>


-- 
--
Tjerk Wolterink @ GMail

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



[android-developers] Intent to handle files opened in browser ending .droid.txt

2009-04-18 Thread Alec

Hi Im having an issue with intents. Im attempting to have the google
browser open my application when it opens a blahblah.droid.txt however
am having no luck. Here's what ive got so far:










Could anyone point out where im going wrong? At the moment the file
just opens in the browser.

Many thanks

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



[android-developers] Re: TrackBall an event states: is there always a ACTION_DOWN before ACTION_MOVE

2009-04-18 Thread Dianne Hackborn
Moves are completely independent from down/up in the trackball, since you
can move it without having it pressed down.

On Sat, Apr 18, 2009 at 3:09 AM, TjerkW  wrote:

>
> Hello all,
>
> Maybe a stupid question (i dunnot have an android phone),
> but it is possible to move the trackball without generating an
> ACTION_DOWN event.
>
> So is the trackball both a button and a trackball.. Or is there always
> an action down event
> before an action move, like there is with a touchscreen.
>
> So again to rephrase the question. Is this sequence of events possible
> for a trackball:
>
> ACTION_MOVE
> ACTION_DOWN
> ACTION_MOVE
> ACTION_UP
> ACTION_MOVE
>
> For a touchscreen it is always
>
>
> ACTION_DOWN
> ACTION_MOVE
> ACTION_UP
>
>
> I want to know this for a game: wether i can use the trackball both
> for shooting and moving.
> The user should be able to move, but not to shoot..
>
>
> >
>


-- 
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] Problems deleting an audio file using a media content uri

2009-04-18 Thread estivenrpo

Hi guys

I have a Uri like "content://media/external/audio/media/149" that is a
audio file and i want to delete it
i have tried:

Uri fileUri = Uri.parse("content://media/external/audio/media/149");
c.getContentResolver().delete(fileUri, null, null);

I have also tried:

File fileToDelete = new File(new URI("content://media/external/audio/
media/149"));
fileToDelete.delete();


The file was created using the Sound recorder Intent.  Actually, if I
create a MediaPlayer mp, I can set the source:

mp.setDataSource(QueryResults.this, Uri.parse(fileUri));
and then:

mp.prepare();
mp.start();

and the file is CORRECTLY played.

So if i want to delete the file i can't, why?, permision problems
maybe, because my app doesn't create the file..??

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] using custom data in message handler

2009-04-18 Thread DevilMayCry

Hi All ,
I am calling a remote service from my app which initiates a callback
from another thread. I have implemented the message handler and am
getting the message in my UI thread. the problem is the callback data
contains a boolean along with int which i need in my app.
stub in my avctivity
CBGetuserPresence(int type,boolean isCommunicatorRunning)
{
  mhandler.obtainmessage(type,0)//passing zero as i dont know how top
pass bool values);
} i am using mhandler.obtainmessage(what,obj) to partially get my
value. The thing is how do i get my boolean value in th message so
that i can retreive it from there.
Thanks All.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OnTouchListener: return true or false?

2009-04-18 Thread arnouf

Hi all,

Whe you try to manage the event on an element using OnTouchListener
you have 3 states:
DOWN, MOVE and UP.

The implement of this method must return a boolean value.

If in my MOVE case, I return true...the method continues to be parse
until the last return value. Why?

What is the normal behaviour when I return true? false?

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



[android-developers] Re: ReStarting An Activity From A Service

2009-04-18 Thread Mark Murphy

> I have a Service that starts an Activity on certain event passing to
> it some parameters.

I do not recommend this. What if the user is in the middle of doing
something else?

> The problem is if the Activity is still open, when the service tries
> to startActivity() again, the activity isn't started because it's
> already started.

http://developer.android.com/guide/topics/fundamentals.html#lmodes
http://developer.android.com/guide/topics/fundamentals.html#clearstack

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Re: ReStarting An Activity From A Service

2009-04-18 Thread Marco Nelissen

On Sat, Apr 18, 2009 at 8:50 AM, Mohamed Amir  wrote:
>
> I have a Service that starts an Activity on certain event passing to
> it some parameters.
>
> The problem is if the Activity is still open, when the service tries
> to startActivity() again, the activity isn't started because it's
> already started.
>
> Is there a way to force the destruction of the old Activity and start
> a new one with the new parameters?

Your existing Activity will receive the new Intent in its Activity.onNewIntent()

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



[android-developers] Re: TrackBall an event states: is there always a ACTION_DOWN before ACTION_MOVE

2009-04-18 Thread Marco Nelissen

Off the top of my head I don't know the specific events generated, but
given that you can use the trackball to e.g. scroll through a list
without clicking on items, what you want to do is obviously possible.


On Sat, Apr 18, 2009 at 3:09 AM, TjerkW  wrote:
>
> Hello all,
>
> Maybe a stupid question (i dunnot have an android phone),
> but it is possible to move the trackball without generating an
> ACTION_DOWN event.
>
> So is the trackball both a button and a trackball.. Or is there always
> an action down event
> before an action move, like there is with a touchscreen.
>
> So again to rephrase the question. Is this sequence of events possible
> for a trackball:
>
> ACTION_MOVE
> ACTION_DOWN
> ACTION_MOVE
> ACTION_UP
> ACTION_MOVE
>
> For a touchscreen it is always
>
>
> ACTION_DOWN
> ACTION_MOVE
> ACTION_UP
>
>
> I want to know this for a game: wether i can use the trackball both
> for shooting and moving.
> The user should be able to move, but not to shoot..
>
>
> >
>

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



[android-developers] ReStarting An Activity From A Service

2009-04-18 Thread Mohamed Amir

I have a Service that starts an Activity on certain event passing to
it some parameters.

The problem is if the Activity is still open, when the service tries
to startActivity() again, the activity isn't started because it's
already started.

Is there a way to force the destruction of the old Activity and start
a new one with the new parameters?


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: Question about animation

2009-04-18 Thread daniel.benedykt

Hi Mike

Actually I just got the solution :)
I was having this problem for a couple of days but just solved it.

Here is the solution:


When you want to animate from left to write do this:

absoluteLayout.post(new SwapViewsDifferent());

then you have a inner class:

private final class SwapViewsDifferent implements Runnable {

public void run() {
//first it scrolls, so android see the screen.
absoluteLayout.scrollBy(screenWidth * -1, 0);
//then the animation a little different from
yours. compare the values
Animation animation = new 
TranslateAnimation(Animation.ABSOLUTE,
-screenWidth, Animation.ABSOLUTE, 0, 
Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, 0);
animation.setDuration(500);
animation.setFillAfter(false);
absoluteLayout.startAnimation(animation);
}
};


Hope this helps...

Daniel


On Apr 18, 12:18 pm, "daniel.benedykt" 
wrote:
> Hi Mike,
>
> I am having the same issue here. I try a lot of things and nothing
> worked.
> Does anyone have the answer to this?
>
> Thanks
>
> Daniel
>
> On Apr 16, 11:34 pm, Mike Baroukh  wrote:
>
> > Hi.
>
> > Hi have an absolute layout with pictures.
> > Only 2 pictures are show simultaneously. Others are on the layout, but
> > out of view.
>
> > I wan't on user click to show others picture.
> > For this, I do an animation to translate the layer.
>
> > For translation from right to left, it works correctly : an other
> > picture come from right progressively while another exit on left side.
>
> > But, for translation from left to right, it don't work : the right
> > picture exits correctly on right side, but left picture only appear on
> > left side at the end of the animation.
> > while translating, an empty space appear on left until the end of
> > translation.
>
> > For translating, I make my own animation (not taken from XML because it
> > depends on image size) :
>
> >         scrollLeft = new TranslateAnimation(0, -(pictoWidth+hspace), 0, 0);
> >         scrollLeft.setDuration(300);
> >         scrollLeft.setAnimationListener(this);
> >         scrollRight = new TranslateAnimation(0, (pictoWidth+hspace), 0, 0);
> >         scrollRight.setDuration(300);
> >         scrollRight.setAnimationListener(this);
>
> > then, for translating, I do :
> >     layout.startAnimation(scrollRight);
>
> > (I join the widget source in case somebody is interesting on doing the
> > same thing ...)
>
> > Does somebody have any idea how tohave the same effect on left to right
> > scroll than right to left ?
>
> > Thanks in advance.
>
> > Mike
>
> > PS: I can't use filpper because I have to picture visible at the same
> > time and only one disappear at a time.
> > It ould be possible but more complicated I thing ...
>
> >  MbaFlipper.java
> > 3KViewDownload
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question about animation

2009-04-18 Thread daniel.benedykt

Hi Mike,

I am having the same issue here. I try a lot of things and nothing
worked.
Does anyone have the answer to this?

Thanks

Daniel

On Apr 16, 11:34 pm, Mike Baroukh  wrote:
> Hi.
>
> Hi have an absolute layout with pictures.
> Only 2 pictures are show simultaneously. Others are on the layout, but
> out of view.
>
> I wan't on user click to show others picture.
> For this, I do an animation to translate the layer.
>
> For translation from right to left, it works correctly : an other
> picture come from right progressively while another exit on left side.
>
> But, for translation from left to right, it don't work : the right
> picture exits correctly on right side, but left picture only appear on
> left side at the end of the animation.
> while translating, an empty space appear on left until the end of
> translation.
>
> For translating, I make my own animation (not taken from XML because it
> depends on image size) :
>
>         scrollLeft = new TranslateAnimation(0, -(pictoWidth+hspace), 0, 0);
>         scrollLeft.setDuration(300);
>         scrollLeft.setAnimationListener(this);
>         scrollRight = new TranslateAnimation(0, (pictoWidth+hspace), 0, 0);
>         scrollRight.setDuration(300);
>         scrollRight.setAnimationListener(this);
>
> then, for translating, I do :
>     layout.startAnimation(scrollRight);
>
> (I join the widget source in case somebody is interesting on doing the
> same thing ...)
>
> Does somebody have any idea how tohave the same effect on left to right
> scroll than right to left ?
>
> Thanks in advance.
>
> Mike
>
> PS: I can't use filpper because I have to picture visible at the same
> time and only one disappear at a time.
> It ould be possible but more complicated I thing ...
>
>  MbaFlipper.java
> 3KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] maps api and 1.5

2009-04-18 Thread wayne mcfadden- Red Droid

Sorry guys, originally i posted to discussion which is the wrong
place.



I'm migrating over an application from 1.1 to 1.5 and it uses the
Google maps. I got through most of the class path issues resolved I
think but when launching the application I get the following message.

04-18 13:19:11.598: WARN/dalvikvm(816): Class resolved by unexpected
DEX: Lnet/company/android/OrgMapActivity;(0x43732af0):0x192310 ref
[Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/
MapActivity;(0x43732af0):0x188228
04-18 13:19:11.598: WARN/dalvikvm(816): Unable to resolve superclass
of Lnet/company/android/OrgMapActivity; (106)
04-18 13:19:11.608: WARN/dalvikvm(816): Link of class 'Lnet/company/
android/OrgMapActivity;' failed

So it looks like the error is Unable to resolve superclass  which I
think is caused by not having

in the androidmanifest.

In my case, this line is in there. Is there a new uses-library for
1.5? Docs say that it's ok. Or specific classpath settings since the
maps.jar has been moved out? I'm not getting compilation errors, just
runtime.

I tried moving the maps.jar into the assets directory and that did not
work either.

Some other trace is below.
Thanks in advance!
Wayne McFadden

04-18 13:43:59.710: WARN/dalvikvm(776): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
04-18 13:43:59.710: ERROR/AndroidRuntime(776): Uncaught handler:
thread main exiting due to uncaught exception
04-18 13:43:59.979: ERROR/AndroidRuntime(776):
java.lang.ExceptionInInitializerError
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.Class.newInstanceImpl(Native Method)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.Class.newInstance(Class.java:1472)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2186)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.os.Handler.dispatchMessage(Handler.java:99)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.os.Looper.loop(Looper.java:123)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.main(ActivityThread.java:3948)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.reflect.Method.invokeNative(Native Method)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.reflect.Method.invoke(Method.java:521)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
dalvik.system.NativeStart.main(Native Method)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
java.lang.NoClassDefFoundError: net.company.android.OrgMapActivity
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
net.company.android.MainActivity.(MainActivity.java:23)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): ... 15 more
04-18 13:43:59.979: ERROR/AndroidRuntime(776): Caused by:
java.lang.IllegalAccessError: cross-loader access from pre-verified
class
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
dalvik.system.DexFile.defineClass(Native Method)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
dalvik.system.DexFile.loadClass(DexFile.java:193)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-18 13:43:59.979: ERROR/AndroidRuntime(776): ... 16 more


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

2009-04-18 Thread murphy

Hi, I'm currently downloading information from an online source which
is saved in a textfile on the device. i'm just wondering what function
is used in order to "clean out" the textfiles once the program has
ended. 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: String comparison with Text in EditText with online data.

2009-04-18 Thread murphy

Thanks for the help guys, I shouldn't have been using the ==, a
compareto() and including a boolean to check against managed to solve.


On Apr 16, 9:14 pm, Jason Proctor  wrote:
> in the vast majority of cases, compare Java strings with equals() or
> equalsIgnoreCase()
>
> == tests for reference equality - ie the same *exact* string object,
> not just one which happens to have the same contents.
>
> >Hi, I'm trying to use the code below to connect to an online source,
> >then compare the data as it is read line by line against what is typed
> >in an EditText field before displaying the next page. At the moment
> >when I run it and press the "Sign In" button nothing happens. The
> >problem seems to be with the comparison of the data. Can anyone help.
>
> >try{
>
> >            URL myURL = new URL("http://www.donalokeeffe.com/
> >usernames.txt");
>
> >                    URLConnection conn = myURL.openConnection();
> >                    conn.connect();
>
> >                    BufferedReader is = new BufferedReader(new 
> > InputStreamReader
> >(conn.getInputStream(), "UTF-8"));
>
> >                    String istr;
> >                    EditText username = 
> > (EditText)findViewById(R.id.username2);
> >                    String usrname = username.getText().toString();
>
> >                    while ((istr = is.readLine()) != null)
> >                    {
> >                            if(is.readLine() == usrname)
> >                            {
> >                                    setContentView(R.layout.menu);
>
> >                    Button button2 = (Button)findViewById(R.id.timetable);
> >                        button2.setOnClickListener(mShowttListener);
>
> >                        Button button3 = (Button)findViewById(R.id.news);
> >                        button3.setOnClickListener(mShowlatnewsListener);
>
> >                        Button button4 = (Button)findViewById(R.id.lecturer);
> >                        button4.setOnClickListener(mShowlecturerListener);
>
> >                        Button logout = (Button)findViewById(R.id.logout);
> >                        logout.setOnClickListener(mShowmainListener);
>
> >                            }
> >                    }
>
> >            }catch ( IOException e )
> >             {
> >                 Log.d(TAG, "Can not connect to the target server!" );
> >                 try {
> >                                    throw new IOException();
> >                            } catch (IOException e1) {
> >                                    // TODO Auto-generated catch block
> >                                    e1.printStackTrace();
> >                            }
> >             }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView and https post problem

2009-04-18 Thread Evgeny V
Thanks,

It works but partially only. I didn't get the full expected page.
I tried also paramtrized url insted parametized POST request.
"
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mym...@mail.com&item_name=mydescr&no_shipping=1&no_note=1¤cy_code=USD&tax=0&lc=IL&bn=PP-DonationsBF";
The result is better than I used POST but again the returned page was not
displayed properly. Probably when the page contains flash or activex it
cause the problem...

Additional question. Why I'm loosing my view context when some link pressed
from returned page. For example I loaded the page webContent.loadUrl(
http://www.paypal.com)
into layout :
http://schemas.android.com/apk/res/android";
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 >






I can see the paypal page and my descr properly on the bottom of screen.
The main paypal page contains Login functionality.
So after I pressed Login the new page opened inside new WebView and my
txtDescr disappeared.
Missed I something or is it "by design"  functionality?


Thanks in advance,
Evgeny

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 there a way to navigate android SDK documentation online for multiple releases??

2009-04-18 Thread Satya Komatineni

Going forward will Android maintain the sites for multiple SDKs that
might be in use.

For example at this very moment there may development teams that are
working on 1.0, 1.1 and possibly 1.5.

If the main site carries documentation only for 1.1 (current release)
will Android make an effort to make the documentation available online
for both 1.1 and 1.5 simultaneously when 1.5 is released?

Or the online docs only reflect the current release?

Appreciate your response
Satya

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



[android-developers] Maps API

2009-04-18 Thread alexdonnini

Hello,

Access to the maps API at

http://www.google.com/glm/mmap

was disabled some time ago.

Would someone be able to tell if it was replaced, and what the current
access path is?

Alternatively, I would appreciate it if someone could give me some
information regarding getting access equivalent to that provided by
Yahoo via

http://zonetag.research.yahooapis.com/services/rest/V1/cellLookup.php

Thanks.

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



[android-developers] Re: Changing ringer volume

2009-04-18 Thread Mark Murphy


>
> Hi everybody;
>
> I am trying to change ringer volume but I am a bit confused. I can
> reach the volume_ring level by using the code
>
>
> String vr = System.getString(this.getContentResolver
> (),System.VOLUME_RING);
>
>
> However it says in the explanation "Ringer volume. This is used
> internally, changing this value will not change the volume. See
> AudioManager. "
>
> How can I change Ringer Volume? What should I do?

Follow the documentation!

Get an AudioManager and change the volume of the ring stream.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] DDMS Heap view format

2009-04-18 Thread Zhubham

Hi,

Can anyone please help me to know what do the following mean in the
Heap view of DDMS:
1) Data Object
2) Class Object
3) 1,2,4,8-byte array : which arrays are we talking about here??
4) non- Java object

Thanks in advance.

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



[android-developers] "automatic location finder"

2009-04-18 Thread Zhubham

Hi Experts,

I want to integrate an additional "automatic location finder"
functionality in android already existing map application. The idea is
to retrieve the current location from GPS and automatically focus
first to your city and then the area. BUT, how do i retrieve location
from GPS (this would be the same as it comes on top right corner of
every mobile phone).

Please help me with this.

Thanks in advance.

Best Regards,
Zhubham.

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



[android-developers] TrackBall an event states: is there always a ACTION_DOWN before ACTION_MOVE

2009-04-18 Thread TjerkW

Hello all,

Maybe a stupid question (i dunnot have an android phone),
but it is possible to move the trackball without generating an
ACTION_DOWN event.

So is the trackball both a button and a trackball.. Or is there always
an action down event
before an action move, like there is with a touchscreen.

So again to rephrase the question. Is this sequence of events possible
for a trackball:

ACTION_MOVE
ACTION_DOWN
ACTION_MOVE
ACTION_UP
ACTION_MOVE

For a touchscreen it is always


ACTION_DOWN
ACTION_MOVE
ACTION_UP


I want to know this for a game: wether i can use the trackball both
for shooting and moving.
The user should be able to move, but not to shoot..


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



[android-developers] Re: Profiling ->memory usage

2009-04-18 Thread Zhubham

Hi,

I am trying to convert the hprof generated by android to standard
format using the code at http://bigflake.com/HprofConv.c.txt. For this
i goto unix and
1) type gcc HprofConv.c (this is the file containg the code from above
link)
2) next i type,  ./a.out heap-profile.hprof standard1.hprof

This creates the standard1.hprof file. On double clicking this file
JProfiler tries to open this file, but, the following error comes:

"An unrecoverable error occured:
java.lang.ArithmeticEception: / by zero"

Can you please help me to come out of this..

Thanks in advance

Best Regards,
Zhubham


qvark wrote:
> Hi, you can find the steps in this thread:
>
> http://groups.google.com/group/android-developers/browse_thread/thread/6659aaf069e462d2/2f2327e87dfdf639
>
> The posts by fadden are specially important, please note that you have
> to "convert" the hprof generated by Android to a standard format with
> the utility posted here:
>
> http://bigflake.com/HprofConv.c.txt
>
> Regards,
>
> Jose Luis
>
> On 17 abr, 15:57, Zhubham  wrote:
> > Hi,
> >
> > This has concern to the profiling discussion 
> > @http://groups.google.com/group/android-developers/browse_thread/threa...
> >
> > As mentioned in the second message, i can generate the hprof files.
> > But I m facing difficulty in opening this file using Jprofiler. Can u
> > please help me out??
> >
> > Thanks in advance.
> >
> > Best Regards,
> > Shubham Sinha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView and Button in layout, only one of them can be clicked.

2009-04-18 Thread kevin

I programmed the layout instead of layout.xml (for our own reason).
Following is the code:

LinearLayout mainPanel = new LinearLayout(ctx);
mainPanel.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT));
mainPanel.setOrientation(LinearLayout.VERTICAL);
mainPanel.setEnabled(true);
mainPanel.setClickable(true);

Button button = new Button(ctx);
button.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.WRAP_CONTENT,
 
LinearLayout.LayoutParams.WRAP_CONTENT));
button.setText("  Done  ");
button.setGravity(Gravity.CENTER);
button.setOnClickListener(this);
button.setPadding(3,3,6,3);
button.setClickable(false);
button.setEnabled(false);

WebView mWebView = new WebView(ctx);
mWebView.setLayoutParams(new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT,
 
LinearLayout.LayoutParams.WRAP_CONTENT));
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
mWebView.setFocusable(true);
mWebView.setFocusableInTouchMode(true);
mWebView.setClickable(true);
mWebView.setEnabled(true);
mWebView.setLongClickable(true);
mWebView.setOnClickListener(this);

mainPanel.addView(button);
mainPanel.addView(mWebView);

setContentView(mainPanel);

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



[android-developers] Re: memory problems

2009-04-18 Thread Carl Whalley

Try running that in DDMS and watching how often the GC is called.

--
Android Academy: http://www.androidacademy.com

On Apr 17, 10:01 pm, petunio  wrote:
> Hi
>
> I know this is more a java question, but I have been in many java
> forums, and the theory seems to contradict the real thing...
>
> I have a very simple function that creates memory, do something with
> it, and returns:
>
> static void test(int k)
> {
>         byte [] buff = new byte[k];
>
>         //do some stuff with  buff[]
>
>         buff=null;
>
> }
>
> After a few calls to this function, it runs out memory
> In C++ I would use delete at the end, and here in java I've been told
> that GC takes care of it, but it seems that it does not
> Am I doing something wrong? how can I free this temp memory after I
> have used it?
>
> many 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: Changing ringer volume

2009-04-18 Thread John Doe

Ok. I found it. AudioManager adjustvolume does it. Thanks :)

On Apr 17, 11:07 pm, John Doe  wrote:
> Hi everybody;
>
> I am trying to change ringer volume but I am a bit confused. I can
> reach the volume_ring level by using the code
>
> String vr = System.getString(this.getContentResolver
> (),System.VOLUME_RING);
>
> However it says in the explanation "Ringer volume. This is used
> internally, changing this value will not change the volume. See
> AudioManager. "
>
> How can I change Ringer Volume? What should I do?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---