Re: [android-developers] php enviroment

2011-04-30 Thread Knutsford Software


- Original Message - 
From: Miguel Morales

To: android-developers@googlegroups.com
Sent: Friday, April 29, 2011 9:30 PM
Subject: Re: [android-developers] php enviroment


http://www.phpforandroid.net/ first link when googling php + android


On Thu, Apr 28, 2011 at 6:09 AM, Knutsford Software 
 wrote:


Hi,
   How do I set up a testing environement on windows xp to test php apps 
for android. I have xamp loaded for normal xp development. I presume I need 
eclipse but I can't find any instructions for php only Java







What I was trying to do was to set up eclispe on my Windows xp PC so that I 
can learn how to write php apps for android but I couldn't see any 
instructions in google on how to set it up. I had already found 
http://www.phpforandroid.net but is that for eclipse and if it is how for I 
set it up and how do I set up eclipse so that I can test anything in php 
written for android.. I presume is possible - there seems to have been other 
people who have manage it from what I have found in google




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: Flaky Touch Screen on Nexus One

2011-04-30 Thread Doug
On Apr 29, 1:20 pm, lbendlin  wrote:
> If the touchscreen on the Nexus One acts up there's a simple short term
> remedy. Put the device into standby and wake it up again. That seems to
> recalibrate the screen.

My N1 has regular touch screen problems that are resolved by turning
the device off and on again.  There is a certain "state" that the
device gets into that regularly misinterprets presses as other
things.  I'll get random menus, vibration, and other strange behavior
until I perform to on/off sequence.

I got my N1 directly from Google last year from the developer support
program that rewarded either a ranking entry in ADC2 or a successful
Android Market app.  I can't tell which because I also got a Droid
from one of those programs.  But I do have regular touch screen
problems.  It seems to have a greater chance of flaring up after being
idle for a long time or after Maps navigation (it is a my primary
personal device these days).

While I'm griping about my N1, I'll point out that plugging it in
doesn't charge the battery until it gets lower than 90%, then will go
up to 100%.  That's just weird.

Doug

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


Re: [android-developers] Removing a specific over lay item

2011-04-30 Thread Marcin Orlowski
On 29 April 2011 20:46, TreKing  wrote:


>  Please i need help its  urgent any  help
>
> WHAT KIND OF RESPONSE DO YOU EXPECT IN 4 MINUTES?
>

Urgent? :)

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

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

[android-developers] Re: Rotating a fragment

2011-04-30 Thread Zsolt Vasvari
Why would you need to handle the rotation changed event in the first
place?  I have a complex state data as well in some of my activities,
but I have no problems saving it using the normal callbacks.

On Apr 29, 2:54 am, Erik  wrote:
> I have an Activity with different layouts for portrait and landscape.
> Since it has some complex state data I don't want to lose on rotation,
> I'm listening for rotation config changes. In onConfigurationChanged()
> I call setContentView() to rebuild the view hierarchy using the new
> layout.
>
> Now I'm converting the activity to use a Fragment. I want the Fragment
> to behave just like the Activity, rebuilding the view hierarchy with
> the new layout when it gets onConfigurationChanged(), but there
> doesn't seem to be any way to change a Fragment's view after it's been
> created. The only way seems to be to create a new Fragment, but then I
> lose all the state data from the original Fragment.
>
> Does anyone have any ideas on how to make this work?

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


[android-developers] VPN: L2TP: always timeout when Sending SCCRQ

2011-04-30 Thread Jiejing.Zhang
Hi All,

Hi Chia-CHi Yeh, I cc you since I found your kernel commit which is enable
VPN stuff.

I'm doing enable VPN function in an android froyo/gingerbread porting.
After apply android pppol2tp, pppopptp related patch in android/common.git,
I can success enable PPTP protocol, but I meet problem with L2TP profile.

My error is:
mtpd is keeping print error like this, then the connection will timeout

D/mtpd( 3020): Timeout -> Sending SCCRQ
D/mtpd( 3020): Timeout -> Sending SCCRQ

but SCCRQ in PPTP profile in return quite fast,
(I tested in Samsung 's Galax tab with same account and website, it works
with L2TP profile)

So, I'm suspecting maybe I missed some patch in kernel or some patch needed,
can anyone give some suggestion ?

Below is full vpn enable log:

D/VpnManager( 2336): succeeded to connect to VPN service
I/SProxy_mtpd( 2603): Stop VPN daemon: mtpd
D/SProxy_mtpd( 2603): mtpd is stopped after 0 msec
D/SProxy_mtpd( 2603): stopping mtpd, success? true
I/SProxy_racoon( 2603): Stop VPN daemon: racoon
D/SProxy_racoon( 2603): racoon is stopped after 0 msec
D/SProxy_racoon( 2603): stopping racoon, success? true
D/VpnService( 2603):   Local IP: 172.21.229.212, if: ppp0
D/VpnService( 2603):VPN UP: down
I/SProxy_mtpd( 2603): Start VPN daemon: mtpd
D/mtpd( 3022): Waiting for control socket
D/com.android.settings.vpn.AuthenticationActor( 2336): ~~ connect()
succeede
d!
D/VpnSettings( 2336): received connectivity: S2lt: connected? CONNECTING
err=0
D/SProxy_mtpd( 2603): mtpd is running after 200 msec
D/mtpd( 3022): Received 19 arguments
I/mtpd( 3022): Using protocol l2tp
I/mtpd( 3022): Connecting to 178.18.17.149 port 1701
I/mtpd( 3022): Connection established (socket = 11)
D/mtpd( 3022): Sending SCCRQ (local_tunnel = 10642)
I/SProxy_mtpd( 2603): got data from control socket: 19
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/dalvikvm( 2603): GC_EXPLICIT freed 1251 objects / 62352 bytes in 29ms
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
D/mtpd( 3022): Timeout -> Sending SCCRQ
E/VpnService( 2603): onError()
E/VpnService( 2603): java.io.IOException: Connecting timed out
E/VpnService( 2603):at
com.android.server.vpn.VpnService.waitUntilConnectedO
rTimedout(VpnService.java:206)
E/VpnService( 2603):at
com.android.server.vpn.VpnService.onConnect(VpnServic
e.java:136)
E/VpnService( 2603):at
com.android.server.vpn.VpnServiceBinder$2.run(VpnServ
iceBinder.java:114)
E/VpnService( 2603):at java.lang.Thread.run(Thread.java:1096)
I/VpnService( 2603): disconnecting VPN...
I/SProxy_mtpd( 2603): Stop VPN daemon: mtpd
D/mtpd( 3022): Timeout -> Sending SCCRQ
I/mtpd( 3022): Received signal 15
D/mtpd( 3022): Sending STOPCCN
I/mtpd( 3022): Mtpd is terminated (status = 6)
D/VpnSettings( 2336): received connectivity: S2lt: connected?
DISCONNECTING   er
r=0
D/SProxy_mtpd( 2603): mtpd is stopped after 200 msec
D/SProxy_mtpd( 2603): stopping mtpd, success? true
I/SProxy_racoon( 2603): Stop VPN daemon: racoon
D/SProxy_racoon( 2603): racoon is stopped after 0 msec
D/SProxy_racoon( 2603): stopping racoon, success? true
D/VpnService( 2603): onFinalCleanUp()
I/VpnService( 2603): restore original suffices --> null
D/VpnSettings( 2336): received connectivity: S2lt: connected? IDLE   err=101

Thank you in advance!!!

BR,
Jiejing

Best regards,
Zhang Jiejing

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

[android-developers] Re: Update Contacts

2011-04-30 Thread Ali Chousein
Hhhmmm, maybe you should try

newUpdate(ContactsContract.Data.CONTENT_URI)

instead of

newUpdate(ContactsContract.Contacts.CONTENT_URI)

I hope it helps :-)

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


[android-developers] Thread escape group

2011-04-30 Thread a a
I'm modifying the app Gallery3D on android. Meet an issue about thread.

There have a DataSouce class which child class object hold the datasouce.

MediaFeed is implement the Runnable, and also have a datasouce object.

Now, a create a new thread in the datasouce which i wan't to get other
data like "comment", "tag", "note".

But when datasouce thread is stopped by MediaFeed, my new thead in the
datasouce also be stopped.

So, How can my new thread is not stopped either? Can my new thead in
the datasouce escape the thead group?

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


[android-developers] Security exception with launchMode="singleTask"

2011-04-30 Thread Akshay Goel
Hello,

I have declared the launch mode of my activity to be singleTask. If I
launch my application, press the home button, go to an email client
(gmail in this case) & preview an attachment using my application, I
am experiencing a security exception on Android versions 2.3 & later,
which says that I do not have the permissions to access gmail
attachments. The exception does not occur on prior versions & if I do
not use singleTask as the launchMode.

Is this a known issue?

Any help will be really appreciated.

Thanks,
Akshay

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


[android-developers] Re: Security exception with launchMode="singleTask"

2011-04-30 Thread Akshay Goel
To add, the exception occurs on this line-

mContext.getContentResolver().openInputStream(intent.getData());

where mContext is the activity context.

-Akshay

On Apr 30, 2:14 pm, Akshay Goel  wrote:
> Hello,
>
> I have declared the launch mode of my activity to be singleTask. If I
> launch my application, press the home button, go to an email client
> (gmail in this case) & preview an attachment using my application, I
> am experiencing asecurityexceptionon Android versions 2.3 & later,
> which says that I do not have the permissions to access gmail
> attachments. Theexceptiondoes not occur on prior versions & if I do
> not use singleTask as the launchMode.
>
> Is this a known issue?
>
> Any help will be really appreciated.
>
> Thanks,
> Akshay

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


[android-developers] Re: VPN: L2TP: always timeout when Sending SCCRQ

2011-04-30 Thread Jiejing.Zhang
Hi All,

After apply this patch https://lkml.org/lkml/2011/1/2/82

pure l2tp VPN is working.

But I found L2TP+IPSec PSK, and L2TP+IPSec CRT profile is not working.

I can't capture any package in tcpdump, I suspect some crypto related
config.
could you give me some suggestions ?

Thanks.


log is :

n
D/VpnManager( 2579): succeeded to connect to VPN service
I/SProxy_mtpd( 2570): Stop VPN daemon: mtpd
D/SProxy_mtpd( 2570): mtpd is stopped after 0 msec
D/SProxy_mtpd( 2570): stopping mtpd, success? true
I/SProxy_racoon( 2570): Stop VPN daemon: racoon
D/SProxy_racoon( 2570): racoon is stopped after 0 msec
D/SProxy_racoon( 2570): stopping racoon, success? true
D/com.android.settings.vpn.AuthenticationActor( 2579): ~~ connect()
succeede
d!
D/VpnSettings( 2579): received connectivity: Psk: connected? CONNECTING
err=0
D/VpnService( 2570):   Local IP: 172.20.132.170, if: ppp0
D/VpnService( 2570):VPN UP: down
I/SProxy_racoon( 2570): Start VPN daemon: racoon
D/racoon  ( 2619): Waiting for control socket
D/SProxy_racoon( 2570): racoon is running after 200 msec
D/racoon  ( 2619): Received 3 arguments
I/racoon  ( 2619): ipsec-tools 0.7.3 (http://ipsec-tools.sf.net)
I/racoon  ( 2619): 172.20.132.170[500] used as isakmp port (fd=10)
I/racoon  ( 2619): 172.20.132.170[500] used for NAT-T
I/racoon  ( 2619): 172.20.132.170[4500] used as isakmp port (fd=11)
I/racoon  ( 2619): 172.20.132.170[4500] used for NAT-T
I/SProxy_racoon( 2570): got data from control socket: 3
I/SProxy_mtpd( 2570): Start VPN daemon: mtpd
D/mtpd( 2884): Waiting for control socket
D/SProxy_mtpd( 2570): mtpd is running after 200 msec
D/mtpd( 2884): Received 19 arguments
I/mtpd( 2884): Using protocol l2tp
I/mtpd( 2884): Connecting to 178.18.17.149 port 1701
I/mtpd( 2884): Connection established (socket = 11)
D/mtpd( 2884): Sending SCCRQ (local_tunnel = 35596)
D/mtpd( 2884): sending package: 0xc6d0 with leng:69
I/racoon  ( 2619): no in-bound policy found: 178.18.17.149/32[1701]172.20.132.1
70/32[0] proto=udp dir=in
I/racoon  ( 2619): IPsec-SA request for 178.18.17.149 queued due to no
phase1 fo
und.
I/racoon  ( 2619): initiate new phase 1 negotiation:
172.20.132.170[500]<=>178.1
8.17.149[500]
I/racoon  ( 2619): begin Identity Protection mode.
I/SProxy_mtpd( 2570): got data from control socket: 19
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
E/racoon  ( 2619): phase2 negotiation failed due to time up waiting for
phase1.
ESP 178.18.17.149[0]->172.20.132.170[0]
I/racoon  ( 2619): delete phase 2 handler.
I/racoon  ( 2619): Bye
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
D/mtpd( 2884): Timeout -> Sending SCCRQ
E/VpnService( 2570): onError()
E/VpnService( 2570): java.io.IOException: Connecting timed out
E/VpnService( 2570):at
com.android.server.vpn.VpnService.waitUntilConnectedO
rTimedout(VpnService.java:206)
E/VpnService( 2570):at
com.android.server.vpn.VpnService.onConnect(VpnServic
e.java:136)
E/VpnService( 2570):at
com.android.server.vpn.VpnServiceBinder$2.run(VpnServ
iceBinder.java:114)
E/VpnService( 2570):at java.lang.Thread.run(Thread.java:1096)
I/VpnService( 2570): disconnecting VPN...
D/VpnSettings( 2579): received connectivity: Psk: connected? DISCONNECTING
err
=0
I/SProxy_mtpd( 2570): Stop VPN daemon: mtpd
D/mtpd( 2884): Timeout -> Sending SCCRQ
I/mtpd( 2884): Received signal 15
D/mtpd( 2884): Sending STOPCCN
D/mtpd( 2884): sending package: 0xc6d0 with leng:36
I/mtpd( 2884): Mtpd is terminated (status = 6)
D/SProxy_mtpd( 2570): mtpd is stopped after 0 msec
D/SProxy_mtpd( 2570): stopping mtpd, success? true
I/SProxy_racoon( 2570): Stop VPN daemon: racoon
D/SProxy_racoon( 2570): racoon is stopped after 0 msec
D/SProxy_racoon( 2570): stopping racoon, success? true
D/VpnService( 2570): onFinalCleanUp()
I/VpnService( 2570): restore original suffices --> null
D/VpnSettings( 2579): received connectivity: Psk: connected? IDLE   err=101
D/VpnSettings( 2579): create reconnect dialog for event 101

Best regards,
Zhang Jiejing


2011/4/30 Jiejing.Zhang 

> Hi All,
>
> Hi Chia-CHi Yeh, I cc you since I found your kernel commit which is enable
> VPN stuff.
>
> I'm doing enable VPN function in an android froyo/gin

[android-developers] VP8 player by RTP on Android

2011-04-30 Thread Yoan
Hello evebody.
First of all, excuse me for my English, but I'm not English-speaker.

I'm working on a project, and I need to find or develop a VP8 player
by RTP running on Android. That's means an Android application abble
to read VP8 videos by network (RTP protocol).

I found ffplay that can open VP8 videos, and can use RTP protocol. But
now, I have to adapt ffplay (in C language) for Android. Do someone
could help me to do that ? Maybe I have to use NDK ...

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 get the text height

2011-04-30 Thread a a
paint.measureText("text")  return the width, how can i get the height
of the "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] Send an email in Android selecting only email apps AND specifying attachment mime type

2011-04-30 Thread andrew
In my Android App I send email messages with images attached.

Using the Intent system to send it, I can do one of the following two
things:

1) Specify type as "message/rfc822" so that ONLY email applications
are shown in the Chooser.

Inconvenience: I cannot specify the mime type of the image I attach
using EXTRA_STREAM and a Uri. Many receiving email apps (Gmail,
Android, etc) show this as an unknown binary "blob" attached to the
message, don't know how to preview it and don't know how to open it as
an attachment.

2) Specify the type as (say) "image/png". The image is attached and
email clients such as Gmail can preview it, and open the attachment in
the appropriate application.

Inconvenience: For the sending user, I cannot reduce the list of apps
the user has to select from in the Chooser to email apps, and MANY
apps are shown in my Android device, most of which are not email apps
and not what I want.

Is there anyway to specify its a "message/rfc822" email Intent AND to
specify the MIME type of the data attached via Uri in the
Intent.EXTRA_STREAM?

BTW: I am providing the file from my own ContentProvider and the
getType() method (used to determine file MIME type) is NOT being
called. The query() method is but doesn't request the file type, only
display name and file size.

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

2011-04-30 Thread Knutsford Software
What books do you recommend for learning how to develop android apps - I don't 
want to relearn Java but I gather you can write them in PHP


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

Re: [android-developers] VP8 player by RTP on Android

2011-04-30 Thread Marcin Orlowski
On 30 April 2011 12:40, Yoan  wrote:


> I found ffplay that can open VP8 videos, and can use RTP protocol. But
> now, I have to adapt ffplay (in C language) for Android. Do someone
> could help me to do that ? Maybe I have to use NDK ...
>

Yes, NDK is your way to go. For further questions on using NDK please use
this group http://groups.google.com/group/android-ndk though

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

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

Re: [android-developers] Books

2011-04-30 Thread Marcin Orlowski
On 30 April 2011 13:34, Knutsford Software wrote:

>  What books do you recommend for learning how to develop android apps -
> I don't want to relearn Java but I gather you can write them in PHP
>

I'd strongly suggest you learn Java.

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

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

[android-developers] problem after generate a .apk file

2011-04-30 Thread Igor Nesralla Ribeiro
Hi,

I make a app on eclipse , win 7 after this I go on menu export and run
iti export apk file and its seems to be ok for mei published it on
the market...and finish(
https://market.android.com/details?id=com.riosistemas.butecos&feature=search
_result )But the problem goes after this process when I open my
project again in eclipse to make some changesall my manifest file was
change(my application information was disappear)...and  I can debug on my
phone too

What I'm do wrong ? I have to create another project and rewrite all
manifest file ? anybody help me !?


Thanks in advance
Igor Nesralla Ribeiro

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


Re: [android-developers] Books

2011-04-30 Thread Mark Murphy
On Sat, Apr 30, 2011 at 7:34 AM, Knutsford Software
 wrote:
> What books do you recommend for learning how to develop android apps -
> I don't want to relearn Java but I gather you can write them in PHP

You will find approximately zero books on writing Android apps in PHP.
I say "approximately" because it might get brief mention somewhere
that discusses SL4A. PHP on Android is a niche of a niche.

In terms of Android development in general, here's the top
StackOverflow question on the topic:

http://stackoverflow.com/questions/1114287/good-book-for-beginning-android-development

In the interests of full disclosure, I'm mentioned in the answers.

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

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

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


Re: [android-developers] Send an email in Android selecting only email apps AND specifying attachment mime type

2011-04-30 Thread Mark Murphy
If you are willing to roll your own dialog, you could:

Step #1: Create the message/rfc822 Intent, as if you were going to
send that way, and use it with PackageManager and
queryIntentActivities() to find out who handles it.

Step #2: Create the image/png Intent, as if you were going to send
that way, and use it with PackageManager and queryIntentActivities()
to find out who handles it.

Step #3: Compute the intersection of those two sets of activities.

Step #4: Use those to populate an AlertDialog for the user to choose from.

Step #4a: If the intersection has one match, skip this step.

Step #4b: If the intersection has zero matches, let the user know
you can't send the message.

Step #5: Modify the image/png Intent to add the component selected
from the dialog, and call startActivity() on it.

By specifying the component in the Intent, it will go to that
particular activity. This is effectively what the regular chooser
does.

On Sat, Apr 30, 2011 at 7:26 AM, andrew  wrote:
> In my Android App I send email messages with images attached.
>
> Using the Intent system to send it, I can do one of the following two
> things:
>
> 1) Specify type as "message/rfc822" so that ONLY email applications
> are shown in the Chooser.
>
> Inconvenience: I cannot specify the mime type of the image I attach
> using EXTRA_STREAM and a Uri. Many receiving email apps (Gmail,
> Android, etc) show this as an unknown binary "blob" attached to the
> message, don't know how to preview it and don't know how to open it as
> an attachment.
>
> 2) Specify the type as (say) "image/png". The image is attached and
> email clients such as Gmail can preview it, and open the attachment in
> the appropriate application.
>
> Inconvenience: For the sending user, I cannot reduce the list of apps
> the user has to select from in the Chooser to email apps, and MANY
> apps are shown in my Android device, most of which are not email apps
> and not what I want.
>
> Is there anyway to specify its a "message/rfc822" email Intent AND to
> specify the MIME type of the data attached via Uri in the
> Intent.EXTRA_STREAM?
>
> BTW: I am providing the file from my own ContentProvider and the
> getType() method (used to determine file MIME type) is NOT being
> called. The query() method is but doesn't request the file type, only
> display name and file size.

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

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

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


[android-developers] problem in my project after export .apk file

2011-04-30 Thread Igor Nesralla Ribeiro

Hi,

I make a app on eclipse , win 7 after this I go on menu export and run
iti export apk file and its seems to be ok for mei published it on
the market...and finish(
https://market.android.com/details?id=com.riosistemas.butecos&feature=search
_result )But the problem goes after this process when I open my
project again in eclipse to make some changesall my manifest file was
change(my application information was disappear)...and  I can debug on my
phone too

What I'm do wrong ? I have to create another project and rewrite all
manifest file ? anybody help me !?


Thanks in advance
Igor Nesralla Ribeiro

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


Re: [android-developers] problem after generate a .apk file

2011-04-30 Thread Marcin Orlowski
On 30 April 2011 13:47, Igor Nesralla Ribeiro  wrote:

> Hi,
>
> I make a app on eclipse , win 7 after this I go on menu export and run
> iti export apk file and its seems to be ok for mei published it on
> the market...and finish(
>
> https://market.android.com/details?id=com.riosistemas.butecos&feature=search
> _result )But the problem goes after this process when I open my
> project again in eclipse to make some changesall my manifest file was
> change(my application information was disappear)...


Exporting APK does not change Manifest file.


> and  I can debug on my phone too
>

To debug on the phone you simply set debuggable to true and upload?


> What I'm do wrong ? I have to create another project and rewrite all
> manifest file ? anybody help me !?
>

Unless others get better reading your post, you may rephrase your post.
I am not fully understand what's really is really not working right.

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

Re: [android-developers] How to get the text height

2011-04-30 Thread Marcin Orlowski
On 30 April 2011 12:49, a a  wrote:

> paint.measureText("text")  return the width, how can i get the height
> of the "text"?
>

value you used in setTextSize() * screendensity factor shall mostly give
what you want.

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 exclude test resources from generated APK?

2011-04-30 Thread Greg Brown
Hi all,

I'm using Eclipse to develop an Android application. I have a number
of resource files in my project that are used for unit testing. When I
generate an APK file for my app using "Android Tools > Export Unsigned
Application Package", the generated file includes these data files. I
have not been able to find a way to filter them out.

Is there a configuration file somewhere that I can modify to exclude
these files?

Thanks for your help,
Greg

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


Re: [android-developers] Re: Security exception with launchMode="singleTask"

2011-04-30 Thread Dianne Hackborn
Sorry, this is probably a bug in 2.3 with trying to grant a URI permission
to an activity instance that is already running.  I'll look in to this.  In
the mean-time, the only solution may be to not use singleTask for the
activity being launched to a preview an attachment.  This is actually the
preferred thing to do, since your preview activity should be running as its
own instance as part of the gmail task.
On Apr 30, 2011 5:20 AM, "Akshay Goel"  wrote:
> To add, the exception occurs on this line-
>
> mContext.getContentResolver().openInputStream(intent.getData());
>
> where mContext is the activity context.
>
> -Akshay
>
> On Apr 30, 2:14 pm, Akshay Goel  wrote:
>> Hello,
>>
>> I have declared the launch mode of my activity to be singleTask. If I
>> launch my application, press the home button, go to an email client
>> (gmail in this case) & preview an attachment using my application, I
>> am experiencing asecurityexceptionon Android versions 2.3 & later,
>> which says that I do not have the permissions to access gmail
>> attachments. Theexceptiondoes not occur on prior versions & if I do
>> not use singleTask as the launchMode.
>>
>> Is this a known issue?
>>
>> Any help will be really appreciated.
>>
>> Thanks,
>> Akshay
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] How to get the text height

2011-04-30 Thread a a
wrong answer, sorry...

2011/4/30 Marcin Orlowski :
> On 30 April 2011 12:49, a a  wrote:
>>
>> paint.measureText("text")  return the width, how can i get the height
>> of the "text"?
>
> value you used in setTextSize() * screendensity factor shall mostly give
> what you want.
>
> Regards,
> Marcin Orlowski
>
> Tray Agenda - keep you daily schedule handy...
> Date In Tray - current date at glance...
> WebnetMobile on Facebook and Twitter
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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


Re: [android-developers] How to get the text height

2011-04-30 Thread a a
get the text rect, then return the rect height, this is text height.

2011/4/30 a a :
> wrong answer, sorry...
>
> 2011/4/30 Marcin Orlowski :
>> On 30 April 2011 12:49, a a  wrote:
>>>
>>> paint.measureText("text")  return the width, how can i get the height
>>> of the "text"?
>>
>> value you used in setTextSize() * screendensity factor shall mostly give
>> what you want.
>>
>> Regards,
>> Marcin Orlowski
>>
>> Tray Agenda - keep you daily schedule handy...
>> Date In Tray - current date at glance...
>> WebnetMobile on Facebook and Twitter
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>

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


Re: [android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Dianne Hackborn
Re battery levels -- the batteries on these devices don't simply charge to
100%, they will charge up 100%, then drain down some amount (toward 90%),
then charge up again.

The Droid's hardware only reports battery level in 10% increments, so you
wouldn't see the behavior there.  Also some manufacturers hide this charging
behavior when they report the battery level so it doesn't confuse users.
 On Apr 30, 2011 3:44 AM, "Doug"  wrote:
> On Apr 29, 1:20 pm, lbendlin  wrote:
>> If the touchscreen on the Nexus One acts up there's a simple short term
>> remedy. Put the device into standby and wake it up again. That seems to
>> recalibrate the screen.
>
> My N1 has regular touch screen problems that are resolved by turning
> the device off and on again. There is a certain "state" that the
> device gets into that regularly misinterprets presses as other
> things. I'll get random menus, vibration, and other strange behavior
> until I perform to on/off sequence.
>
> I got my N1 directly from Google last year from the developer support
> program that rewarded either a ranking entry in ADC2 or a successful
> Android Market app. I can't tell which because I also got a Droid
> from one of those programs. But I do have regular touch screen
> problems. It seems to have a greater chance of flaring up after being
> idle for a long time or after Maps navigation (it is a my primary
> personal device these days).
>
> While I'm griping about my N1, I'll point out that plugging it in
> doesn't charge the battery until it gets lower than 90%, then will go
> up to 100%. That's just weird.
>
> Doug
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Re: Query regarding getFlags() of Intent

2011-04-30 Thread Dianne Hackborn
Sorry, this information is not available if your task has has multiple
activities in it.
On Apr 30, 2011 3:18 AM, "Manohar Mahapatra"  wrote:
> Hi Dianne,
>
> I was aware of all these flags. My app has a requirement to know when my
> root / secondary activities are brought to focus by long clicking Home
> (Recent Apps). So I started using
> FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY<
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
>
> in
> my code but saw that it was never set in getFlags(). Then I did more
> investigation and I found all these observation below.
>
> Can you let me know how to know for any activity(other than root activity)
*on
> top of App task* to know that it has been launched by long clicking Home
> (Recent Apps) . As per my observation, getFlags() returns 0 for any
> secondary activity
> (i.e other than the root activity) that is launched by root activity.
>
> thanks for your inputs and time
> AndUzer
>
> On Sat, Apr 30, 2011 at 12:32 PM, Dianne Hackborn wrote:
>
>> Why do you care? You are looking at log statements. The log from the
>> activity manager happens to be the Intent printed at some point in its
>> processing. There is nothing defined in the API that some log print in
the
>> system is going to have the same Intent flags values as what is handed to
>> the application.
>>
>> The activity manager is printing the intent that is handed to it when the
>> request to start the activity happens. It will add in flags that should
be
>> set for the launch at that point as defined by the API.
>>
>> Did you even look at what these flags are?
>>
>> 0x1000:
>>
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
>>
>> 0x0010:
>>
>>
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
>>
>> 0x0020:
>>
>>
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
>>
>> And for the one where you say there are no flags, yes, there are no flag
>> bits set so to save space nothing is printed about the flag.
>>
>> This all seems to be working perfectly fine to me,
>>
>> On Sat, Apr 30, 2011 at 12:10 AM, Manohar Mahapatra <
androidu...@gmail.com
>> > wrote:
>>
>>> Hi,
>>>
>>>
>>>
>>> I am seeing some issues in the way the following API( *getFlags()*) of
>>> the Intent class works . I see that the Activity Manager starts a
Activity
>>> with some value of flag set in the Intent but when I print the Intent
object
>>> in the root Activity ,
>>>
>>> the flag value in the Intent object is not same as what Activity Manager
>>> launched the intent with for some scenarios. Second issue Any other
Activity
>>> launched by the root activity has no info of the flag in the intent
>>>
>>>
>>>
>>> "int getFlags<
http://developer.android.com/reference/android/content/Intent.html#getFlags%28%29
>()
>>>
>>>
>>> Retrieve any special flags associated with this intent."
>>>
>>>
>>>
>>>
>>>
>>> In my use case , I have an Application which has two activities, the
>>> Android Manifest file looks something like this
>>>
>>>
>>>
>>> 
>>>
>>> http://schemas.android.com/apk/res/android"*
>>>
>>> package=*"com.example.flag"*
>>>
>>> android:versionCode=*"1"*
>>>
>>> android:versionName=*"1.0"*>
>>>
>>> >> "@string/app_name"*>
>>>
>>> >>
>>> android:label=*"@string/app_name"*>
>>>
>>> 
>>>
>>> 
>>>
>>> >> "android.intent.category.LAUNCHER"* />
>>>
>>> 
>>>
>>> 
>>>
>>>
>>>
>>> >>
>>> android:label=*"@string/app_name1"*>
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>>
>>>
>>> The code for the “MainActivity” is as follows
>>>
>>>
>>>
>>> *package* com.example.flag;
>>>
>>> *import* android.app.Activity;
>>>
>>> *import* android.content.Intent;
>>>
>>> *import* android.os.Bundle;
>>>
>>> *import* android.util.Log;
>>>
>>> *import* android.view.View;
>>>
>>> *import* android.view.View.OnClickListener;
>>>
>>> *import* android.widget.Button;
>>>
>>>
>>>
>>> *public* *class* MainActivity *extends* Activity {
>>>
>>> /** Called when the activity is first created. */
>>>
>>> @Override
>>>
>>> *public* *void* onCreate(Bundle savedInstanceState) {
>>>
>>> *super*.onCreate(savedInstanceState);
>>>
>>> setContentView(R.layout.*main*);
>>>
>>>
>>>
>>> Button b = (Button) findViewById(R.id.*button1*);
>>>
>>> b.setOnClickListener(*new* OnClickListener() {
>>>
>>> *public* *void* onClick(View v) {
>>>
>>> startActivity(*new* Intent(MainActivity.*this*
>>> ,SecondActivity.*class*));
>>>
>>> }
>>>
>>> });
>>>
>>> }
>>>
>>>
>>>
>>> /* (non-*Javadoc*)
>>>
>>> * @see android.app.Activity#onResume()
>>>
>>> */
>>>
>>> @Override
>>>
>>> *protected* *void* onResume() {
>>>
>>> *super*.onResume();
>>>
>>> Log.*d*("MainActivity", "MainActivity
>>> getIntent().toString()::" +getIntent().toString());
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> The code for the “SecondActivity” is as follows
>>>
>>>
>>>
>>> *package* com.example.flag;
>>>
>>>
>>>
>>> *import* android.app.Activity;
>>>
>>> 

[android-developers] Re: VP8 player by RTP on Android

2011-04-30 Thread Yoan
I didn't see this group, sorry
Thanks for the link

On 30 avr, 13:36, Marcin Orlowski  wrote:
> On 30 April 2011 12:40, Yoan  wrote:
>
> > I found ffplay that can open VP8 videos, and can use RTP protocol. But
> > now, I have to adapt ffplay (in C language) for Android. Do someone
> > could help me to do that ? Maybe I have to use NDK ...
>
> Yes, NDK is your way to go. For further questions on using NDK please use
> this grouphttp://groups.google.com/group/android-ndkthough
>
> Regards,
> Marcin Orlowski
>
> *Tray Agenda * - keep you daily schedule handy...
> *Date In Tray*  - current date at glance...
> WebnetMobile on *Facebook * and
> *Twitter
> *

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


Re: [android-developers] How to get the text height

2011-04-30 Thread Kostya Vasilyev


http://developer.android.com/reference/android/graphics/Paint.html

Take a pick:

- getTextSize()
- getTextBounds()
- ascent() / descent()
- getFontMetrics()

-- Kostya

30.04.2011 17:55, a a пишет:

get the text rect, then return the rect height, this is text height.

2011/4/30 a a:

wrong answer, sorry...

2011/4/30 Marcin Orlowski:

On 30 April 2011 12:49, a a  wrote:

paint.measureText("text")  return the width, how can i get the height
of the "text"?

value you used in setTextSize() * screendensity factor shall mostly give
what you want.

Regards,
Marcin Orlowski

Tray Agenda - keep you daily schedule handy...
Date In Tray - current date at glance...
WebnetMobile on Facebook and Twitter

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



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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


Re: [android-developers] Re: Query regarding getFlags() of Intent

2011-04-30 Thread Manohar Mahapatra
Hi Dianne,

Thanks for the reply. I want to let you know the exact dilemma I am in.

My application is a client based financial app and compulsorily it needs to
validate the user token from the server every time it comes to foreground.
This is a security mandate.

Are you aware of any call back( ( Activity) or (Context ) level)/or
any workaround  that we can use when the App is brought to foreground from
the Recent Apps. Usually the user of my app would be in some secondary
activity launched by the root activity.

I works fine in all the App launch scenarios except the Recent App workflow
where any of my Secondary activity has *no way* to know that it has been
brought to the foreground from the Recent Apps.

If you are aware of some good practice for this kind of situation,
any suggestion or advice would be greatly appreciated.

Thanks
AndUzer

On Sat, Apr 30, 2011 at 7:28 PM, Dianne Hackborn wrote:

> Sorry, this information is not available if your task has has multiple
> activities in it.
> On Apr 30, 2011 3:18 AM, "Manohar Mahapatra" 
> wrote:
> > Hi Dianne,
> >
> > I was aware of all these flags. My app has a requirement to know when my
> > root / secondary activities are brought to focus by long clicking Home
> > (Recent Apps). So I started using
> > FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY<
> http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
> >
>
> > in
> > my code but saw that it was never set in getFlags(). Then I did more
> > investigation and I found all these observation below.
> >
> > Can you let me know how to know for any activity(other than root
> activity) *on
> > top of App task* to know that it has been launched by long clicking Home
> > (Recent Apps) . As per my observation, getFlags() returns 0 for any
> > secondary activity
> > (i.e other than the root activity) that is launched by root activity.
> >
> > thanks for your inputs and time
> > AndUzer
> >
> > On Sat, Apr 30, 2011 at 12:32 PM, Dianne Hackborn  >wrote:
> >
> >> Why do you care? You are looking at log statements. The log from the
> >> activity manager happens to be the Intent printed at some point in its
> >> processing. There is nothing defined in the API that some log print in
> the
> >> system is going to have the same Intent flags values as what is handed
> to
> >> the application.
> >>
> >> The activity manager is printing the intent that is handed to it when
> the
> >> request to start the activity happens. It will add in flags that should
> be
> >> set for the launch at that point as defined by the API.
> >>
> >> Did you even look at what these flags are?
> >>
> >> 0x1000:
> >>
> http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
> >>
> >> 0x0010:
> >>
> >>
> http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
> >>
> >> 0x0020:
> >>
> >>
> http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
> >>
> >> And for the one where you say there are no flags, yes, there are no flag
> >> bits set so to save space nothing is printed about the flag.
> >>
> >> This all seems to be working perfectly fine to me,
> >>
> >> On Sat, Apr 30, 2011 at 12:10 AM, Manohar Mahapatra <
> androidu...@gmail.com
> >> > wrote:
> >>
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I am seeing some issues in the way the following API( *getFlags()*) of
> >>> the Intent class works . I see that the Activity Manager starts a
> Activity
> >>> with some value of flag set in the Intent but when I print the Intent
> object
> >>> in the root Activity ,
> >>>
> >>> the flag value in the Intent object is not same as what Activity
> Manager
> >>> launched the intent with for some scenarios. Second issue Any other
> Activity
> >>> launched by the root activity has no info of the flag in the intent
> >>>
> >>>
> >>>
> >>> "int getFlags<
> http://developer.android.com/reference/android/content/Intent.html#getFlags%28%29
> >()
>
> >>>
> >>>
> >>> Retrieve any special flags associated with this intent."
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> In my use case , I have an Application which has two activities, the
> >>> Android Manifest file looks something like this
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>> http://schemas.android.com/apk/res/android"*
> >>>
> >>> package=*"com.example.flag"*
> >>>
> >>> android:versionCode=*"1"*
> >>>
> >>> android:versionName=*"1.0"*>
> >>>
> >>>  >>> "@string/app_name"*>
> >>>
> >>>  >>>
> >>> android:label=*"@string/app_name"*>
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>>  >>> "android.intent.category.LAUNCHER"* />
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>>
> >>>
> >>>  >>>
> >>> android:label=*"@string/app_name1"*>
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>>
> >>>
> >>> The code for the “MainActivity” is as follows
> >>>
> >>>
> >>>
> >>> *package* com.example.flag;
> >>>
> >>> *import* android.app.Activity;
> >>>
> >>> *import* android.content.Intent;
> >>>
> >>

Re: [android-developers] Re: Query regarding getFlags() of Intent

2011-04-30 Thread Mark Murphy
On Sat, Apr 30, 2011 at 10:15 AM, Manohar Mahapatra
 wrote:
> My application is a client based financial app and compulsorily it needs to
> validate the user token from the server every time it comes to foreground.
> This is a security mandate.

Then validate the user token in every activity in onResume(). I fail
to see how anything else can satisfy this "security mandate".

Android applications don't "come to foreground" any more than Web
applications do.

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

_The Busy Coder's Guide to Android Development_ Version 3.6 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: Insights for using query() and MediaStore.Audio.Albums

2011-04-30 Thread Gabriel Simões
No ideas? Please, some help here would be really nice!

tnx

On Apr 28, 10:06 pm, Gabriel Simões  wrote:
> Hello,
> I´ve been trying to figure a way out to search MediaStore.Audio.Albums
> and MediaStore.Audio.Media to retrieve onlly albums from mp3 files.
> I can list all albums and retrieve their songs but can´t filter which
> albums have mp3s and which don't have.
> Listing albums (all registered albums with audio files of any
> extension):
>          String[] cols = new String[] {
>                  MediaStore.Audio.Albums._ID,
>                  MediaStore.Audio.Albums.ARTIST,
>                  MediaStore.Audio.Albums.ALBUM,
>                  MediaStore.Audio.Albums.NUMBER_OF_SONGS
>          };
>          Uri uriExternal =
> MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
>          Uri uriInternal =
> MediaStore.Audio.Albums.INTERNAL_CONTENT_URI;
>          Cursor externalCursor =
> getContentResolver().query(uriExternal, cols, null, null,
> MediaStore.Audio.Albums.ARTIST + ", " +
> MediaStore.Audio.Albums.ALBUM);
>          Cursor internalCursor =
> getContentResolver().query(uriInternal, cols, null, null,
> MediaStore.Audio.Albums.ARTIST + ", " +
> MediaStore.Audio.Albums.ALBUM);
>
> Can I archive the results I want using getContentResolver().query() or
> do I need to run a SQL rougth command?
> Using getContentResolver().query() I couldn´t figure out a way to
> apply WHERE
> clause or also search DISTINCT MediaStore.Audio.Media.ALBUMfiltering
> MediaStore.Audio.Media.DATA
> Thanks for your help,
> Gabriel Simões

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


[android-developers] Re: Developing on Inspire 4G

2011-04-30 Thread Kevin TeslaCoil Software
Actually on AT&T you can't use http or dropbox to install APKs because
AT&T block sideloading.

But enabling the phone's System Settings > Applications > Development
> USB debugging and using eclipse or adb is easier anyway.
(And like Mark said you may need the usb driver)

-Kevin

On Apr 30, 12:47 am, Russell DuRoss  wrote:
> Another option is to use Dropbox.

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


RE: [android-developers] problem after generate a .apk file

2011-04-30 Thread Igor Nesralla Ribeiro
Hi Marcin,

 

Sorry...my English…

Well….my real problem is : only my application tag in manifest disappeared
and i don’t know if when I change the app description in design view or when
I export to apk file…

 

That’s it…

 

Thanks 

Igor

 

 

From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of Marcin Orlowski
Sent: sábado, 30 de abril de 2011 10:05
To: android-developers@googlegroups.com
Subject: Re: [android-developers] problem after generate a .apk file

 

On 30 April 2011 13:47, Igor Nesralla Ribeiro  wrote:

Hi,

I make a app on eclipse , win 7 after this I go on menu export and run
iti export apk file and its seems to be ok for mei published it on
the market...and finish(
https://market.android.com/details?id=com.riosistemas.butecos
 &feature=search
_result )But the problem goes after this process when I open my
project again in eclipse to make some changesall my manifest file was
change(my application information was disappear)...


Exporting APK does not change Manifest file. 
  

and  I can debug on my phone too


To debug on the phone you simply set debuggable to true and upload? 

 

What I'm do wrong ? I have to create another project and rewrite all
manifest file ? anybody help me !?


Unless others get better reading your post, you may rephrase your post.
I am not fully understand what's really is really not working right.

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

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

[android-developers] Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
Hello,
I want to change the UI(if possible just add an image to the UI) when
i'm well connected to the server(i'm developping a SIP application) by
adding an imaged "Connected" .
In fact, i've made this but i have a FC:
public void onRegistrationDone(String localProfileUri, long
expiryTime) {
updateStatus("Registered to server.");
Log.d("SUCCEED","Registration DONE");
setContentView(R.layout.connected);
}

connected is an XMl file that has a textview(with same id as the
main.xml) and the image that i want to add.
How can i do this?

Thank you very much.

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


Re: [android-developers] How to exclude test resources from generated APK?

2011-04-30 Thread Dianne Hackborn
Do they actually need to be in your main .apk?  Generally we like to keep
all test related code (and resources) in a separate .apk that has the
Instrumentation components.
On Apr 30, 2011 9:48 AM, "Greg Brown"  wrote:
> Hi all,
>
> I'm using Eclipse to develop an Android application. I have a number
> of resource files in my project that are used for unit testing. When I
> generate an APK file for my app using "Android Tools > Export Unsigned
> Application Package", the generated file includes these data files. I
> have not been able to find a way to filter them out.
>
> Is there a configuration file somewhere that I can modify to exclude
> these files?
>
> Thanks for your help,
> Greg
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Re: Query regarding getFlags() of Intent

2011-04-30 Thread Manohar Mahapatra
Hi Mark,

Thanks for the reply. You are right , I could have used onResume in
my secondary(not root activity) activities, but onResume will be called
 even when I navigate between the activities in my app once it is launched.
. I dont want to check the user token during this scenario as it would be a
overkill.

My requirement is if my application( hint app task level) as a whole is
brought to foreground ( see the two cases below)

a) From the Home page - works fine in this scenario
b) From the Recent Apps - has the issue , here i cant know the onResume for
any secondary activity  is called due to an internal navigation or due to
the *app task* coming to the foreground again. So i thought of using the
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
 from any of the secondary activity but I get 0 when I query for getFlags()
in any of the secondary activity

thanks
And Uzer

On Sat, Apr 30, 2011 at 7:54 PM, Mark Murphy wrote:

> On Sat, Apr 30, 2011 at 10:15 AM, Manohar Mahapatra
>  wrote:
> > My application is a client based financial app and compulsorily it needs
> to
> > validate the user token from the server every time it comes to
> foreground.
> > This is a security mandate.
>
> Then validate the user token in every activity in onResume(). I fail
> to see how anything else can satisfy this "security mandate".
>
> Android applications don't "come to foreground" any more than Web
> applications do.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.6 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
>

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

Re: [android-developers] Re: Query regarding getFlags() of Intent

2011-04-30 Thread Mark Murphy
On Sat, Apr 30, 2011 at 10:51 AM, Manohar Mahapatra
 wrote:
> Thanks for the reply. You are right , I could have used onResume in
> my secondary(not root activity) activities, but onResume will be called
>  even when I navigate between the activities in my app once it is launched.
> . I dont want to check the user token during this scenario as it would be a
> overkill.
> My requirement is if my application( hint app task level) as a whole is
> brought to foreground ( see the two cases below)
> a) From the Home page - works fine in this scenario
> b) From the Recent Apps - has the issue , here i cant know the onResume for
> any secondary activity  is called due to an internal navigation or due to
> the app task coming to the foreground again. So i thought of using
> the FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY from any of the secondary activity
> but I get 0 when I query for getFlags() in any of the secondary activity
> thanks

IMHO, your requirement is flawed. It's almost as flawed as those who
think they need to find out when their "application goes in the
background" to log people out.

Any sensible Web application would use a time-based mechanism based
upon session cookies. After N minutes (either since login or since
inactivity) -- or if there is no session cookie -- force a
re-authentication. IMHO, sensible Android applications will take the
same approach.

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

_The Busy Coder's Guide to Android Development_ Version 3.6 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


Re: [android-developers] problem after generate a .apk file

2011-04-30 Thread Marcin Orlowski
On 30 April 2011 16:42, Igor Nesralla Ribeiro  wrote:

> Hi Marcin,
>
>
>
> Sorry...my English…
>
> Well….my real problem is : only my application tag in manifest disappeared
> and i don’t know if when I change the app description in design view or when
> I export to apk file…
>

Unless you manage to trigger any sort of rarely exposed bug, it's mostly not
related to exporting your app. I assume you changed this that way or
another. If not, then describe step-by-step what you do to make this happen.
Please check if it really happens all the time.

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

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

Re: [android-developers] Change UI when executing an instruction

2011-04-30 Thread Marcin Orlowski
What about just having you all UI elements in one view but simply hide/show
some you want to be visible conditionaly by using setVisibility() on them?
Looks like you do not need anything more complicated anyway.

Regards,
Marcin Orlowski

*Tray Agenda * - keep you daily schedule handy...
*Date In Tray*  - current date at glance...
WebnetMobile on *Facebook * and
*Twitter
*

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

Re: [android-developers] Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
Very good idea. So i add the image in the XMl file and i set its visiblity
to 0, then when i'm connected to the server i set its visibilty(in java
code) to 1 . But, how can i set it in Java ?

Thank you for you help.

2011/4/30 Marcin Orlowski 

> What about just having you all UI elements in one view but simply hide/show
> some you want to be visible conditionaly by using setVisibility() on them?
> Looks like you do not need anything more complicated anyway.
>
> Regards,
> Marcin Orlowski
>
> *Tray Agenda * - keep you daily schedule
> handy...
> *Date In Tray*  - current date at glance...
> WebnetMobile on *Facebook * and 
> *Twitter
> *
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Change UI when executing an instruction

2011-04-30 Thread Dianne Hackborn
setContentView() completely replaces your current UI with a new one.  If you
just want to make an image shown, you need to modify the current UI -- for
example have an ImageView containing the image which you change between
View.INVISIBLE and View.VISIBLE.
 On Apr 30, 2011 10:48 AM, "Alaeddine Ghribi" 
wrote:
> Hello,
> I want to change the UI(if possible just add an image to the UI) when
> i'm well connected to the server(i'm developping a SIP application) by
> adding an imaged "Connected" .
> In fact, i've made this but i have a FC:
> public void onRegistrationDone(String localProfileUri, long
> expiryTime) {
> updateStatus("Registered to server.");
> Log.d("SUCCEED","Registration DONE");
> setContentView(R.layout.connected);
> }
>
> connected is an XMl file that has a textview(with same id as the
> main.xml) and the image that i want to add.
> How can i do this?
>
> Thank you very much.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
I've made this:
public void onRegistrationDone(String localProfileUri, long
expiryTime) {
updateStatus("Registered to server.");
Log.d("SUCCEED","Registration DONE");

ImageView iconView = (ImageView)
findViewById(R.id.connected);
iconView.setVisibility(1);

}
But the image diesn't shows!
Here is also my XML file:
http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

http://schemas.android.com/apk/res/android";
  android:id="@+id/sipLabel"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  />
  


What could be the problem?
Thank you very much.


On 30 avr, 16:14, Dianne Hackborn  wrote:
> setContentView() completely replaces your current UI with a new one.  If you
> just want to make an image shown, you need to modify the current UI -- for
> example have an ImageView containing the image which you change between
> View.INVISIBLE and View.VISIBLE.
>  On Apr 30, 2011 10:48 AM, "Alaeddine Ghribi" 
> wrote:
>
>
>
>
>
>
>
> > Hello,
> > I want to change the UI(if possible just add an image to the UI) when
> > i'm well connected to the server(i'm developping a SIP application) by
> > adding an imaged "Connected" .
> > In fact, i've made this but i have a FC:
> > public void onRegistrationDone(String localProfileUri, long
> > expiryTime) {
> > updateStatus("Registered to server.");
> > Log.d("SUCCEED","Registration DONE");
> > setContentView(R.layout.connected);
> > }
>
> > connected is an XMl file that has a textview(with same id as the
> > main.xml) and the image that i want to add.
> > How can i do this?
>
> > Thank you very much.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: How to get the text height

2011-04-30 Thread Paul Turchenko
decent()-acent()

On Apr 30, 5:49 am, a a  wrote:
> paint.measureText("text")  return the width, how can i get the height
> of the "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


Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Dianne Hackborn
First thing is to actually use one of the correct constants in
View.setVisibility() -- such as View.VISIBLE.

On Sat, Apr 30, 2011 at 11:35 AM, Alaeddine Ghribi <
alaeddineghr...@gmail.com> wrote:

> I've made this:
> public void onRegistrationDone(String localProfileUri, long
> expiryTime) {
>updateStatus("Registered to server.");
>Log.d("SUCCEED","Registration DONE");
>
> ImageView iconView = (ImageView)
> findViewById(R.id.connected);
>iconView.setVisibility(1);
>
>}
> But the image diesn't shows!
> Here is also my XML file:
> http://schemas.android.com/apk/res/
> android"
> android:orientation="vertical" android:layout_width="fill_parent"
>android:layout_height="fill_parent">
>
> http://schemas.android.com/apk/res/android";
>  android:id="@+id/sipLabel"
>  android:layout_width="fill_parent"
>  android:layout_height="fill_parent"
>  />
>android:layout_width="wrap_content"
>android:layout_height="wrap_content"
> android:layout_weight="0.35"
> android:gravity="center"
>android:visibility="invisible" />
>
>
> What could be the problem?
> Thank you very much.
>
>
> On 30 avr, 16:14, Dianne Hackborn  wrote:
> > setContentView() completely replaces your current UI with a new one.  If
> you
> > just want to make an image shown, you need to modify the current UI --
> for
> > example have an ImageView containing the image which you change between
> > View.INVISIBLE and View.VISIBLE.
> >  On Apr 30, 2011 10:48 AM, "Alaeddine Ghribi"  >
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hello,
> > > I want to change the UI(if possible just add an image to the UI) when
> > > i'm well connected to the server(i'm developping a SIP application) by
> > > adding an imaged "Connected" .
> > > In fact, i've made this but i have a FC:
> > > public void onRegistrationDone(String localProfileUri, long
> > > expiryTime) {
> > > updateStatus("Registered to server.");
> > > Log.d("SUCCEED","Registration DONE");
> > > setContentView(R.layout.connected);
> > > }
> >
> > > connected is an XMl file that has a textview(with same id as the
> > > main.xml) and the image that i want to add.
> > > How can i do this?
> >
> > > Thank you very much.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
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] Using Preferences From xml resource in BroadCast receiver

2011-04-30 Thread Boozel
Hi can any one give me some code to use Preferences from my 
settings.xml Preference file in a BroadcastRecevier?
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

Re: [android-developers] How to exclude test resources from generated APK?

2011-04-30 Thread Greg Brown
I actually don't want them in my .apk file at all. I have been trying to figure 
out how to filter them out but I haven't found a way to do so.

Greg

On Apr 30, 2011, at 10:50 AM, Dianne Hackborn wrote:
> Do they actually need to be in your main .apk?  Generally we like to keep all 
> test related code (and resources) in a separate .apk that has the 
> Instrumentation components.
> 
> On Apr 30, 2011 9:48 AM, "Greg Brown"  wrote:
> > Hi all,
> > 
> > I'm using Eclipse to develop an Android application. I have a number
> > of resource files in my project that are used for unit testing. When I
> > generate an APK file for my app using "Android Tools > Export Unsigned
> > Application Package", the generated file includes these data files. I
> > have not been able to find a way to filter them out.
> > 
> > Is there a configuration file somewhere that I can modify to exclude
> > these files?
> > 
> > Thanks for your help,
> > Greg
> > 
> > -- 
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Re: Security exception with launchMode="singleTask"

2011-04-30 Thread Akshay Goel
Thanks Dianne. I will have to remove singleTask then.

On Apr 30, 6:49 pm, Dianne Hackborn  wrote:
> Sorry, this is probably a bug in 2.3 with trying to grant a URI permission
> to an activity instance that is already running.  I'll look in to this.  In
> the mean-time, the only solution may be to not use singleTask for the
> activity being launched to a preview an attachment.  This is actually the
> preferred thing to do, since your preview activity should be running as its
> own instance as part of the gmail task.
> On Apr 30, 2011 5:20 AM, "Akshay Goel"  wrote:
>
> > To add, the exception occurs on this line-
>
> > mContext.getContentResolver().openInputStream(intent.getData());
>
> > where mContext is the activity context.
>
> > -Akshay
>
> > On Apr 30, 2:14 pm, Akshay Goel  wrote:
> >> Hello,
>
> >> I have declared the launch mode of my activity to be singleTask. If I
> >> launch my application, press the home button, go to an email client
> >> (gmail in this case) & preview an attachment using my application, I
> >> am experiencing asecurityexceptionon Android versions 2.3 & later,
> >> which says that I do not have the permissions to access gmail
> >> attachments. Theexceptiondoes not occur on prior versions & if I do
> >> not use singleTask as the launchMode.
>
> >> Is this a known issue?
>
> >> Any help will be really appreciated.
>
> >> Thanks,
> >> Akshay
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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


[android-developers] How Do You Get Tabhost to Work With Views Instead of Activities !?

2011-04-30 Thread plutonianandroid
I get this error from LogCat and can't understand why, driving me
crazy: 04-30 13:21:26.388: ERROR/AndroidRuntime(12408): Caused by:
java.lang.RuntimeException: Your content must have a TabHost whose id
attribute is 'android.R.id.tabhost'

import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class GreenhouseAppTabWidget extends TabActivity {


public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost=(TabHost)findViewById(R.id.tabhost);
tabHost.setup();
TabHost.TabSpec spec;  // Reusable TabSpec for each tab

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("tag").setIndicator("Tag",
  res.getDrawable(R.drawable.ic_menu_wizard))
  .setContent(R.id.tagView);

tabHost.addTab(spec);

spec = tabHost.newTabSpec("scan").setIndicator("Scan",
  res.getDrawable(R.drawable.ic_menu_barcode))
  .setContent(R.id.scanView);
tabHost.addTab(spec);

spec = tabHost.newTabSpec("data").setIndicator("Data",
  res.getDrawable(R.drawable.ic_menu_piechart))
  .setContent(R.id.dataformView);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}
main.xml looks like this:






http://schemas.android.com/apk/res/android";
android:layout_height="fill_parent" 
android:orientation="vertical"
android:layout_width="fill_parent">










http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scanView" 
android:orientation="vertical">




http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/dataformView" 
android:orientation="vertical">









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


[android-developers] Re: testing NotificationManager and other system services

2011-04-30 Thread Bob Kerns
Better solution: All services should be defined via interface, with nary an 
implementation class to be seen. Specifying an implementation class, as the 
current spec does, does not add value -- it removes it.

Workaround: Define your own interface class, and your own method that calls 
getSystemService, and wraps the return value in an instance if your 
interface, which delegates to the system one. Then, to generate a mock one, 
generate a mock of your interface. Don't use the system's implementation 
class in your code, but rather your interface, and you're fine.

This is easy. What's hard is doing this N times for all the places this 
simple design rule is not followed in the system, where N is extremely 
large. But you can at least automate your wrapper object implementations 
using the java Proxy mechanism and reflection, for everything but 
performance-critical objects.

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

Re: [android-developers] How Do You Get Tabhost to Work With Views Instead of Activities !?

2011-04-30 Thread Kostya Vasilyev

I believe the message means this:

In other words, referencing the id value defined by Android, rather than 
assigning a new id value in your application.


Same with


I get this error from LogCat and can't understand why, driving me
crazy: 04-30 13:21:26.388: ERROR/AndroidRuntime(12408): Caused by:
java.lang.RuntimeException: Your content must have a TabHost whose id
attribute is 'android.R.id.tabhost'

import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class GreenhouseAppTabWidget extends TabActivity {


public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost=(TabHost)findViewById(R.id.tabhost);
tabHost.setup();
TabHost.TabSpec spec;  // Reusable TabSpec for each tab

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("tag").setIndicator("Tag",
  res.getDrawable(R.drawable.ic_menu_wizard))
  .setContent(R.id.tagView);

tabHost.addTab(spec);

spec = tabHost.newTabSpec("scan").setIndicator("Scan",
  res.getDrawable(R.drawable.ic_menu_barcode))
  .setContent(R.id.scanView);
tabHost.addTab(spec);

spec = tabHost.newTabSpec("data").setIndicator("Data",
  res.getDrawable(R.drawable.ic_menu_piechart))
  .setContent(R.id.dataformView);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}
main.xml looks like this:






http://schemas.android.com/apk/res/android";
android:layout_height="fill_parent" 
android:orientation="vertical"
android:layout_width="fill_parent">










http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scanView" 
android:orientation="vertical">




http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/dataformView" 
android:orientation="vertical">












--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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

[android-developers] Handling ACTION_SCREEN in a widget

2011-04-30 Thread Pedro Duque
Hi,

I'm doing a widget that needs to be update on screen_on or on
user_present. As I'm not hable to register a BroadcastReceiver inside
the widget I'm doing it in a Service that is triggered by the widget
like this:

Widget.java:
    @Override
    public void onEnabled(Context context) {
        super.onEnabled(context);
    context.startService(new Intent(context,
WidgetService.class).setAction(WidgetService.ACTION_WIDGET_START));
    }

WidgetService.java:
    @Override
    public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);

        String action = intent.getAction();
        Log.d(LOG_APP,"WidgetService onStart: "+action);


        if (ACTION_WIDGET_STOP.equals(action)) {
    this.unregisterReceiver(mReceiver);
            stopSelf();
            return;
        } else if (ACTION_WIDGET_START.equals(action)) {
    // register receiver that handles screen on and screen off logic
    IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
    this.registerReceiver(mReceiver, filter);
    return;
        }

The problem is that when I try to register the receiver I get the
error that the service has leaked IntentReceiver because it was
already registered. Ive checked and no duplicate registration was done
in my code.

Do you have any idea what I'm overlooking?

Thanks,
PMD

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

2011-04-30 Thread groob
Hello, Nikolay!

Thanks for your answer.

I think it is not the code I should blame here.
When I'm launching on my device Admob's examples (BannerEssentials,
Banner-Details) I get exactly the same result.
Also bannrers in other applications I downloaded from the market look
equal.
This makes me more think of my device and applications installed on it
being guilty of the problem.
Unfortunately I have no other Android phone available at the moment
and emulators are displaying correctly red Admob test banner.

It looks to me like AdSense's HTML code is, after being received,
somehow wrapped (interpretted?) by some app installed on my device and
thus not fitting the default 320x50px space.

Your advice on changing Admob console settings doesn't help either -
once AdSense disabled, no ads are received. I think Google want to
teach me a lesson that fill rate will decrease indeed without
AdSense. ;)

Best,
groob.

On 30 Kwi, 05:23, Nikolay Elenkov  wrote:
> On Sat, Apr 30, 2011 at 10:37 AM, groob  wrote:
>
> > The questions I have:
> > - Have I made a mistake in implementation and 'Ads by Google' can be
> > excluded from being displayed?
>
> We can't know without seeing your code. BTW I think you can turn off
> the features to display AdSends ads in theAdmobconsole if that
> doesn't work for you. You can fix the ad view's height to 50dp, that
> would at least make sure it doesn't change size.
>
> > - Maybe my rooted device acts different and it is causing regular
> >Admobbanners to not display?
>
> Unlikely. I use rooted NexusOne and have never seen this.AdSense
>  ads are served only if there are noAdmobads available. Again,
>
> check yourAdmobconsole.
>
> > - Has anyone experienced the same? What are your thoughts? IMO
> > presenting something like this is nonsense and will only make users
> > upset - no marketing value, almost impossible to interract with,
> > providing no information. It is more like a nightmare to both
> > publisher and advertisers.
>
> I agree it's not nice, but I haven't seen anything like it. Might be some
> temporary glitch? Is it consistent?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
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 Do You Get Tabhost to Work With Views Instead of Activities !?

2011-04-30 Thread plutonianandroid
Wow so simple, thanks a lot Kostya, struggled with that for so long.

On Apr 30, 2:01 pm, Kostya Vasilyev  wrote:
> I believe the message means this:
>
>         
> should be changed to:
>
>         
> In other words, referencing the id value defined by Android, rather than
> assigning a new id value in your application.
>
> Same with
>
> 
> -- Kostya
>
> 30.04.2011 21:50, plutonianandroid ?:
>
>
>
>
>
> > I get this error from LogCat and can't understand why, driving me
> > crazy: 04-30 13:21:26.388: ERROR/AndroidRuntime(12408): Caused by:
> > java.lang.RuntimeException: Your content must have a TabHost whose id
> > attribute is 'android.R.id.tabhost'
>
> > import android.app.TabActivity;
> > import android.content.res.Resources;
> > import android.os.Bundle;
> > import android.widget.TabHost;
>
> > public class GreenhouseAppTabWidget extends TabActivity {
>
> >    public void onCreate(Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.main);
> >        Resources res = getResources();
> >        TabHost tabHost=(TabHost)findViewById(R.id.tabhost);
> >        tabHost.setup();
> >        TabHost.TabSpec spec;  // Reusable TabSpec for each tab
>
> >        // Initialize a TabSpec for each tab and add it to the TabHost
> >        spec = tabHost.newTabSpec("tag").setIndicator("Tag",
> >                          res.getDrawable(R.drawable.ic_menu_wizard))
> >                      .setContent(R.id.tagView);
>
> >        tabHost.addTab(spec);
>
> >        spec = tabHost.newTabSpec("scan").setIndicator("Scan",
> >                          res.getDrawable(R.drawable.ic_menu_barcode))
> >                      .setContent(R.id.scanView);
> >        tabHost.addTab(spec);
>
> >        spec = tabHost.newTabSpec("data").setIndicator("Data",
> >                          res.getDrawable(R.drawable.ic_menu_piechart))
> >                      .setContent(R.id.dataformView);
> >        tabHost.addTab(spec);
>
> >        tabHost.setCurrentTab(0);
> >    }
> > }
> > main.xml looks like this:
>
> > 
> >  >     android:layout_width="fill_parent"
> > android:layout_height="fill_parent">
> >             >                    android:layout_width="fill_parent"
> > android:layout_height="wrap_content"/>
> >             >                    android:padding="5dp" android:layout_height="fill_parent"
> > android:layout_width="fill_parent">
>
> >                     >                            
> > xmlns:android="http://schemas.android.com/apk/res/android";
> >                            android:layout_height="fill_parent" 
> > android:orientation="vertical"
> > android:layout_width="fill_parent">
> >                                     > android:id="@+id/tagIDTextView" android:text="@string/
> > tagid_lbl" android:layout_height="wrap_content"
> > android:layout_width="wrap_content">
> >                                     > android:layout_height="wrap_content" android:id="@+id/upcEditText"
> > android:layout_width="wrap_content" android:editable="false"> > EditText>
> >                                     > android:layout_height="wrap_content" android:text="@string/
> > tagid_btn_lbl" android:id="@+id/tagIDButton"
> > android:layout_width="wrap_content">
> >                                     > android:text="@string/
> > gps_txt" android:layout_height="wrap_content"
> > android:layout_width="wrap_content">
> >                                     > android:layout_height="wrap_content" android:id="@+id/gpsEditText"
> > android:layout_width="fill_parent" android:editable="false"> > EditText>
> >                                     > android:layout_height="wrap_content"
> > android:text="@string/gps_btn_lbl" android:id="@+id/gpsButton"
> > android:layout_width="wrap_content">
> >                                     > android:layout_width="wrap_content" android:id="@+id/
> > imageView1" android:layout_height="wrap_content"
> > android:src="@drawable/icon">
> >                                     > android:layout_height="wrap_content" android:text="@string/
> > collect_btn_lbl" android:id="@+id/button1"
> > android:layout_width="wrap_content">
> >                    
>
> >                     > xmlns:android="http://schemas.android.com/apk/res/
> > android"
> >                            android:layout_width="fill_parent"
> > android:layout_height="fill_parent"
> >                            android:id="@+id/scanView" 
> > android:orientation="vertical">
> >                                     > android:layout_height="wrap_content"
> >                                            
> > android:layout_width="wrap_content" android:text="@string/
> > scan_btn_txt"
> >                                            
> > android:id="@+id/scanTextView">
> >                                     > android:layout_height="wrap_content"
> >                                            
> > android:layout_width="wrap_content" android:text="@string/
> > scan_btn_lbl"
> >                                

[android-developers] Re: System.exit

2011-04-30 Thread Bob Kerns
Perhaps you yourself are getting in the way when you offer offense in this 
way? I for one am glad that Dianne does not work at the sort of company you 
describe, and there's really no way to take your remarks addressing her job 
security but as a personal attack. I'm not sure why you're doing this; it 
seems out of character for you.

I am probably one of the few people on the list who'd find your SylloGizmo 
references interesting, and I did not find it relevant. Hence, in effect, 
commercial SPAM. (I know that was not your intent).

If you found Dianne's answer inadequate, just answer it yourself.

Like this:

No, it's not OK to call System.exit().

I further argue that any discussion of hypothetical exceptions are not what 
the OP needs. If you're asking the question, you don't have nearly enough 
understanding of the issues to even evaluate them. For example, whether 
System.exit() cleans up the activity stack (it doesn't, as has been pointed 
out) is not something someone who is asking this question understands at 
this point.

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

[android-developers] Re: System.exit

2011-04-30 Thread Bob Kerns
Perhaps you yourself are getting in the way when you offer offense in this 
way? I for one am glad that Dianne does not work at the sort of company you 
describe, and there's really no way to take your remarks addressing her job 
security but as a personal attack. I'm not sure why you're doing this; it 
seems out of character for you.

I am probably one of the few people on the list who'd find your SylloGizmo 
references interesting, and I did not find it relevant. Hence, in effect, 
commercial SPAM. (I know that was not your intent).

If you found Dianne's answer inadequate, just answer it yourself.

Like this:

No, it's not OK to call System.exit().

I further argue that any discussion of hypothetical exceptions are not what 
the OP needs. If you're asking the question, you don't have nearly enough 
understanding of the issues to even evaluate them. For example, whether 
System.exit() cleans up the activity stack (it doesn't, as has been pointed 
out) is not something someone who is asking this question understands at 
this point.

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

[android-developers] Re: System.exit

2011-04-30 Thread Bob Kerns
Perhaps you yourself are getting in the way when you offer offense in this 
way? I for one am glad that Dianne does not work at the sort of company you 
describe, and there's really no way to take your remarks addressing her job 
security but as a personal attack. I'm not sure why you're doing this; it 
seems out of character for you.

I am probably one of the few people on the list who'd find your SylloGizmo 
references interesting, and I did not find it relevant. Hence, in effect, 
commercial SPAM. (I know that was not your intent).

If you found Dianne's answer inadequate, just answer it yourself.

Like this:

No, it's not OK to call System.exit().

I further argue that any discussion of hypothetical exceptions are not what 
the OP needs. If you're asking the question, you don't have nearly enough 
understanding of the issues to even evaluate them. For example, whether 
System.exit() cleans up the activity stack (it doesn't, as has been pointed 
out) is not something someone who is asking this question understands at 
this point.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 does the ActivityStack behave when it contains thousands of Activities?

2011-04-30 Thread Scythe
In my app I have a about a dozen of different Activities. These
Activities are connected (can call each other with startActivity()) in
such a way, that the user can theoretically keep running in circles -
always jumping to the next Activity, never going back. Also, I really
need to maintain a proper Activity history: if the user presses the
back button, the app returns to the previous Activity, with the
previous content.

Question: Suppose the user's using the app for an extended amount of
time, going in circles between Activites as mentioned above, resulting
an ever-growing ActivityStack. Every Activity saves some state on
onSaveInstanceState() too.

- Is this a problem? (I'm afraid it is, I guess it's a memory leak to
have tens of thousands of Activity records on the stack, especially if
these save their state).
- Is there a way to limit the size of the default Android
ActivityStack's size? (size limit is X, we delete the oldest record if
it gets filled up)

Any suggestions / alternative solutions are welcome.

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


Re: [android-developers] How does the ActivityStack behave when it contains thousands of Activities?

2011-04-30 Thread Kumar Bibek
You will perhaps run into stack overflows or oom.  Android will try to kill
some of your activities though when it finds necessary
On May 1, 2011 12:01 AM, "Scythe"  wrote:
> In my app I have a about a dozen of different Activities. These
> Activities are connected (can call each other with startActivity()) in
> such a way, that the user can theoretically keep running in circles -
> always jumping to the next Activity, never going back. Also, I really
> need to maintain a proper Activity history: if the user presses the
> back button, the app returns to the previous Activity, with the
> previous content.
>
> Question: Suppose the user's using the app for an extended amount of
> time, going in circles between Activites as mentioned above, resulting
> an ever-growing ActivityStack. Every Activity saves some state on
> onSaveInstanceState() too.
>
> - Is this a problem? (I'm afraid it is, I guess it's a memory leak to
> have tens of thousands of Activity records on the stack, especially if
> these save their state).
> - Is there a way to limit the size of the default Android
> ActivityStack's size? (size limit is X, we delete the oldest record if
> it gets filled up)
>
> Any suggestions / alternative solutions are welcome.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
I have a problem, the image is not showing even when deleting
"visibility" ?
Have i a problem with the XML file ?
Thank you.

On 30 avr, 17:06, Dianne Hackborn  wrote:
> First thing is to actually use one of the correct constants in
> View.setVisibility() -- such as View.VISIBLE.
>
> On Sat, Apr 30, 2011 at 11:35 AM, Alaeddine Ghribi <
>
>
>
>
>
>
>
>
>
> alaeddineghr...@gmail.com> wrote:
> > I've made this:
> > public void onRegistrationDone(String localProfileUri, long
> > expiryTime) {
> >                        updateStatus("Registered to server.");
> >                        Log.d("SUCCEED","Registration DONE");
>
> >                         ImageView iconView = (ImageView)
> > findViewById(R.id.connected);
> >                        iconView.setVisibility(1);
>
> >                    }
> > But the image diesn't shows!
> > Here is also my XML file:
> > http://schemas.android.com/apk/res/
> > android"
> > android:orientation="vertical" android:layout_width="fill_parent"
> >        android:layout_height="fill_parent">
>
> > http://schemas.android.com/apk/res/android";
> >  android:id="@+id/sipLabel"
> >  android:layout_width="fill_parent"
> >  android:layout_height="fill_parent"
> >  />
> >   >  android:layout_width="wrap_content"
> >                android:layout_height="wrap_content"
> > android:layout_weight="0.35"
> > android:gravity="center"
> >                android:visibility="invisible" />
> >                
>
> > What could be the problem?
> > Thank you very much.
>
> > On 30 avr, 16:14, Dianne Hackborn  wrote:
> > > setContentView() completely replaces your current UI with a new one.  If
> > you
> > > just want to make an image shown, you need to modify the current UI --
> > for
> > > example have an ImageView containing the image which you change between
> > > View.INVISIBLE and View.VISIBLE.
> > >  On Apr 30, 2011 10:48 AM, "Alaeddine Ghribi" 
> > > wrote:
>
> > > > Hello,
> > > > I want to change the UI(if possible just add an image to the UI) when
> > > > i'm well connected to the server(i'm developping a SIP application) by
> > > > adding an imaged "Connected" .
> > > > In fact, i've made this but i have a FC:
> > > > public void onRegistrationDone(String localProfileUri, long
> > > > expiryTime) {
> > > > updateStatus("Registered to server.");
> > > > Log.d("SUCCEED","Registration DONE");
> > > > setContentView(R.layout.connected);
> > > > }
>
> > > > connected is an XMl file that has a textview(with same id as the
> > > > main.xml) and the image that i want to add.
> > > > How can i do this?
>
> > > > Thank you very much.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 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


Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Kostya Vasilyev

30.04.2011 23:04, Alaeddine Ghribi пишет:

I have a problem, the image is not showing even when deleting
"visibility" ?
Have i a problem with the XML file ?


Yes.

The view that's above the ImageView is set to fill_parent height, so it 
takes the entire height of the screen, leaving no room for the image view.



Thank you.



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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

2011-04-30 Thread groob
I know where's the problem - my network operator in Poland (Era, from
T-Mobile) adds a service called 'Compressor mini' (which is in fact
Opera Mini feature), that is to limit data transfer.
Unfortunately it adds as well this toolbars.

Don't even ask - I'm pissed as hell on them, especially they disagree
to turn it off.


On 30 Kwi, 20:09, groob  wrote:
> Hello, Nikolay!
>
> Thanks for your answer.
>
> I think it is not the code I should blame here.
> When I'm launching on my device Admob's examples (BannerEssentials,
> Banner-Details) I get exactly the same result.
> Also bannrers in other applications I downloaded from the market look
> equal.
> This makes me more think of my device and applications installed on it
> being guilty of the problem.
> Unfortunately I have no other Android phone available at the moment
> and emulators are displaying correctly red Admob test banner.
>
> It looks to me like AdSense's HTML code is, after being received,
> somehow wrapped (interpretted?) by some app installed on my device and
> thus not fitting the default 320x50px space.
>
> Your advice on changing Admob console settings doesn't help either -
> once AdSense disabled, no ads are received. I think Google want to
> teach me a lesson that fill rate will decrease indeed without
> AdSense. ;)
>
> Best,
> groob.
>
> On 30 Kwi, 05:23, Nikolay Elenkov  wrote:
>
>
>
>
>
>
>
> > On Sat, Apr 30, 2011 at 10:37 AM, groob  
> > wrote:
>
> > > The questions I have:
> > > - Have I made a mistake in implementation and 'Ads by Google' can be
> > > excluded from being displayed?
>
> > We can't know without seeing your code. BTW I think you can turn off
> > the features to display AdSends ads in theAdmobconsole if that
> > doesn't work for you. You can fix the ad view's height to 50dp, that
> > would at least make sure it doesn't change size.
>
> > > - Maybe my rooted device acts different and it is causing regular
> > >Admobbanners to not display?
>
> > Unlikely. I use rooted NexusOne and have never seen this.AdSense
> >  ads are served only if there are noAdmobads available. Again,
>
> > check yourAdmobconsole.
>
> > > - Has anyone experienced the same? What are your thoughts? IMO
> > > presenting something like this is nonsense and will only make users
> > > upset - no marketing value, almost impossible to interract with,
> > > providing no information. It is more like a nightmare to both
> > > publisher and advertisers.
>
> > I agree it's not nice, but I haven't seen anything like it. Might be some
> > temporary glitch? Is it consistent?

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


[android-developers] Tab Content is Displayed Over Tab of Tabs Instead of Below

2011-04-30 Thread plutonianandroid
I am having a layout problem. My tab content is displayed directly
over the tabs instead of underneath the tabs.






http://schemas.android.com/apk/res/android";
android:layout_height="fill_parent" 
android:orientation="vertical"
android:layout_width="fill_parent">










http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scanView" 
android:orientation="vertical">




http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/dataformView" 
android:orientation="vertical">









package com.alkemajwoods.greenhouseapp;

import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;


public class GreenhouseAppTabWidget extends TabActivity {


public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;  // Reusable TabSpec for each tab

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("tag").setIndicator("Tag",
  res.getDrawable(R.drawable.ic_menu_wizard))
  .setContent(R.id.tagView);

tabHost.addTab(spec);

spec = tabHost.newTabSpec("scan").setIndicator("Scan",
  res.getDrawable(R.drawable.ic_menu_barcode))
  .setContent(R.id.scanView);
tabHost.addTab(spec);

spec = tabHost.newTabSpec("data").setIndicator("Data",
  res.getDrawable(R.drawable.ic_menu_piechart))
  .setContent(R.id.dataformView);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}

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


Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
Excatly that's the problem, i didn't notice it, i just copied it from my
previous project :P !
However, i want to set the image to show after a period, i've maked this:

public void onRegistrationDone(String localProfileUri, long expiryTime) {
updateStatus("Registered to server.");
Log.d("SUCCEED","Registration DONE");
final ImageView iconView = (ImageView)
findViewById(R.id.connected);
iconView.setVisibility(1);
iconView.postDelayed(new Runnable() {
public void run() {
iconView.setVisibility(0);
}
}, 5000);

But it's always showen.
Any idea how to fix that problem ?

Thank you.
2011/4/30 Kostya Vasilyev 

> 30.04.2011 23:04, Alaeddine Ghribi пишет:
>
>> I have a problem, the image is not showing even when deleting
>> "visibility" ?
>> Have i a problem with the XML file ?
>>
>
> Yes.
>
> The view that's above the ImageView is set to fill_parent height, so it
> takes the entire height of the screen, leaving no room for the image view.
>
>  Thank you.
>>
>
>
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Kostya Vasilyev
As was already pointed out by Dianne, View.setVisibility() uses 
constants, like View.GONE and View.VISIBLE - not arbitrary values like 0 
or 1.


-- Kostya

30.04.2011 23:56, Alaeddine Ghribi пишет:

iconView.setVisibility(1);



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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


[android-developers] When exactly do you need to handle DeadObjectException with services?

2011-04-30 Thread MarcoAndroid
Hi there,

In the Additional Notes section here:
http://www.devdiv.com/android/docs/guide/topics/fundamentals/bound-services.html#Binding
it says: "You should always trap DeadObjectException exceptions, which
are thrown when the connection has broken. This is the only exception
thrown by remote methods."

1) Does that mean that for all calls of the client to the service's
methods you need to try/catch the DeadObjectException? Even
getService() in onServiceConnected() can throw it?

2) If my service only uses a local binder (LocalBinder in the example
from the above link), so it is private to my own application and runs
in the same process as the client, can I then still get
DeadObjectException? I wonder because I see with this type of binding
that the service does *not* appear in the services overview of a
device or emulator, which makes sense to me because it is "tightly"
connected to the activity that bound to it. That to me means you (nor
the Android runtime) can end the service on its own, so never a chance
on DeadObjectException... True?

Thanks!
Marco


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


Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Alaeddine Ghribi
Sorry but i'm not understanding your point. If i make iconView.VISIBLE i
have an error(sorry for my mis-understood).In the XML file i have to do like
android:visibility="visible" and in the JAVA code i normally make
iconView.setVisibility(1);
? As pointed in the doc:
http://developer.android.com/reference/android/R.attr.html#visibility
 Sorry
another time :\ .

2011/4/30 Kostya Vasilyev 

> As was already pointed out by Dianne, View.setVisibility() uses constants,
> like View.GONE and View.VISIBLE - not arbitrary values like 0 or 1.
>
> -- Kostya
>
> 30.04.2011 23:56, Alaeddine Ghribi пишет:
>
>>iconView.setVisibility(1);
>>
>
>
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

Re: [android-developers] When exactly do you need to handle DeadObjectException with services?

2011-04-30 Thread Dianne Hackborn
On Sat, Apr 30, 2011 at 4:05 PM, MarcoAndroid  wrote:

> 1) Does that mean that for all calls of the client to the service's
> methods you need to try/catch the DeadObjectException? Even
> getService() in onServiceConnected() can throw it?
>

You need to catch them wherever they can be thrown.  You actually don't need
to worry about this, because this is a checked exception so if you forget to
check it somewhere you will get a compile time error.


> 2) If my service only uses a local binder (LocalBinder in the example
> from the above link), so it is private to my own application and runs
> in the same process as the client, can I then still get
> DeadObjectException? I wonder because I see with this type of binding
> that the service does *not* appear in the services overview of a
> device or emulator, which makes sense to me because it is "tightly"
> connected to the activity that bound to it. That to me means you (nor
> the Android runtime) can end the service on its own, so never a chance
> on DeadObjectException... True?
>

No you can't get it, because it is in the same process, so if the service's
process goes away then your client code's process has gone away as well and
never could have gotten a result.

However because the interface generated by aidl can be used with a remote
object, at compile time there is no way to know whether or not this will be
the case, so the interface methods must declare they throw RemoteException
and you thus must handle if if calling those methods.

One way to get around this is when implementing those methods in the service
do not declare them as throwing RemoteException and on the client side cast
the interface to this implementation class.  Now the compiler knows that a
call to the method will never throw that exception.

Or just catch the exception and do nothing, or print a quick log, or
whatever.

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

Re: [android-developers] Re: Change UI when executing an instruction

2011-04-30 Thread Dianne Hackborn
No do iconView.setVisibility(View.VISIBLE).  Don't just make up numbers.

On Sat, Apr 30, 2011 at 4:11 PM, Alaeddine Ghribi  wrote:

> Sorry but i'm not understanding your point. If i make iconView.VISIBLE i
> have an error(sorry for my mis-understood).In the XML file i have to do like
> android:visibility="visible" and in the JAVA code i normally make  
> iconView.setVisibility(1);
> ? As pointed in the doc:
> http://developer.android.com/reference/android/R.attr.html#visibility
>  Sorry
> another time :\ .
>
> 2011/4/30 Kostya Vasilyev 
>
>> As was already pointed out by Dianne, View.setVisibility() uses constants,
>> like View.GONE and View.VISIBLE - not arbitrary values like 0 or 1.
>>
>> -- Kostya
>>
>> 30.04.2011 23:56, Alaeddine Ghribi пишет:
>>
>>>iconView.setVisibility(1);
>>>
>>
>>
>> --
>> Kostya Vasilyev -- http://kmansoft.wordpress.com
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
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] Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
I have been developing an app I want to share with friends and family for 
beta testing before I publish it to the android market. Problem is, since 
I've already had them install a previous version of the app, that when I 
send them the new .apk to install the installer wants the already installed 
app to be uninstalled first before the new version can be installed or 
updated.

Is this something I'm doing wrong in my program? I want the SQLite DB to 
always be intact and never loose data which is what happens when someone has 
to reinstall/update the app.

Please help! Thanks so much.

Derek

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

Re: [android-developers] How does the ActivityStack behave when it contains thousands of Activities?

2011-04-30 Thread Dianne Hackborn
It doesn't.  Don't do that.  Allowing the user to keep cycling through
activities is fundamentally flawed.  Having an application that has more
than a handful of activities on the stack is not correct, both for the way
the system works and the user experience it causes.

On Sat, Apr 30, 2011 at 2:31 PM, Scythe  wrote:

> In my app I have a about a dozen of different Activities. These
> Activities are connected (can call each other with startActivity()) in
> such a way, that the user can theoretically keep running in circles -
> always jumping to the next Activity, never going back. Also, I really
> need to maintain a proper Activity history: if the user presses the
> back button, the app returns to the previous Activity, with the
> previous content.
>
> Question: Suppose the user's using the app for an extended amount of
> time, going in circles between Activites as mentioned above, resulting
> an ever-growing ActivityStack. Every Activity saves some state on
> onSaveInstanceState() too.
>
> - Is this a problem? (I'm afraid it is, I guess it's a memory leak to
> have tens of thousands of Activity records on the stack, especially if
> these save their state).
> - Is there a way to limit the size of the default Android
> ActivityStack's size? (size limit is X, we delete the oldest record if
> it gets filled up)
>
> Any suggestions / alternative solutions are welcome.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

Re: [android-developers] Updated .apk wants uninstall first

2011-04-30 Thread Dianne Hackborn
I assume you have changed the cert.  If this is the cause, no there is
nothing you can do about it.  The cert is the identity of the author; two
apps with different certs are fundamentally different apps and can't be
installed on top of each other.

On Sat, Apr 30, 2011 at 4:16 PM, Derek Winstead wrote:

> I have been developing an app I want to share with friends and family for
> beta testing before I publish it to the android market. Problem is, since
> I've already had them install a previous version of the app, that when I
> send them the new .apk to install the installer wants the already installed
> app to be uninstalled first before the new version can be installed or
> updated.
>
> Is this something I'm doing wrong in my program? I want the SQLite DB to
> always be intact and never loose data which is what happens when someone has
> to reinstall/update the app.
>
> Please help! Thanks so much.
>
> Derek
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




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

Re: [android-developers] Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
Where do I change the cert? That doesn't sound like something I've done 
(knowingly).

When doing my development on the ADV with eclipse I make my changes and 
rerun the program. It reinstalls everything but I don't loose data. Only 
when I try to push it to a real phone does it want an uninstall.

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

[android-developers] Re: Updated .apk wants uninstall first

2011-04-30 Thread JP
The development and release .apk files are signed with different
certificates.
In other words, when you hand out an .apk that was created when you
ran an Eclipse build, you are distributing an .apk that's signed with
a cert different than the .apk which you generate for release (which
you run through zipalign and signing with the release key).


On Apr 30, 1:28 pm, Derek Winstead  wrote:
> Where do I change the cert? That doesn't sound like something I've done
> (knowingly).
>
> When doing my development on the ADV with eclipse I make my changes and
> rerun the program. It reinstalls everything but I don't loose data. Only
> when I try to push it to a real phone does it want an uninstall.

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


[android-developers] Re: Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
Ok, so when I right click my project and Run As -> Android Application it 
installs on the VM but also creates the .apk file in the bin folder and that 
is what I'm coping and sending to friends. Is this incorrect to do?

I'm still a novice with Android.

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

[android-developers] Re: Updated .apk wants uninstall first

2011-04-30 Thread #13point7
It is fine to do that, but the Release version has a different signature. So 
if they have the Development apk installed, then they have no choice but to 
uninstall that to install the Market apk. This is only the case when going 
from Development -> Market...any subsequent updates will be fine and data 
will be retained.

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

[android-developers] Re: What I found using big images on an activity

2011-04-30 Thread Streets Of Boston
I figure that multiple smaller images work better than the '1 large image' 
example you have, since DalvikVM won't need to allocate one large contiguous 
chunk of memory.
I won't worry about it too much. Don't start solving a problem that may not 
exists in your actual app :-)

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

[android-developers] Re: Updated .apk wants uninstall first

2011-04-30 Thread Derek Winstead
I checked out this: 
http://developer.android.com/guide/publishing/app-signing.html#releasemode

I created a keytool as the example shows. I have now Right Click Project -> 
Export and put in the new keystore and alias on the export. I need to first 
write down everything on my phones version. Then uninstall and reinstall the 
new .apk created. Then I will make random changes to the app and do another 
export and install and see what happens.

Thanks everyone for the help so far in getting me in the right direction.

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

Re: [android-developers] Using Preferences From xml resource in BroadCast receiver

2011-04-30 Thread TreKing
On Sat, Apr 30, 2011 at 11:11 AM, Boozel  wrote:

> Hi can any one give me some code to use Preferences from my
> settings.xml Preference file in a BroadcastRecevier?


You can get preference settings from a Context, just like anywhere else in
your code.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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

[android-developers] Documentation for older Android SDK versions?

2011-04-30 Thread Stefan at WPF
Hello,
when browsing the Android SDK documentation, e.g.
http://developer.android.com/reference/android/preference/PreferenceActivity.html,
then this documentation is for the latest Android version (Android 3.0 r1 at
the time of writing this).

As I am developing for Android 2.2 it is very confusing for me to read the
Android 3.0 documentation, e.g. it claims for addPreferencesFromResource(int
preferencesResId):

This method is deprecated. This function is not relevant for a modern
fragment-based PreferenceActivity.

Well, for Android 3.0 it might be, but seen from Android 2.2 it is probably
not. So where can I find a documentation written from an Android 2.2
perspective / the documentation written at the time of Android 2.2? On e.g.
MSDN you can easily switch between the different documentation versions for
e.g. .NET 3.5 and .NET 4.0, how about the Android documentation?

Please note, that using the API Level Filter is not enough, even with API
Level 1 (the lowest API Level where nothing can be deprecated) it claims
that addPreferencesFromResource(int preferencesResId) is deprecated - the
filter acts in a too simple way, just filtering out APIs with newer API
Levels than the one specified for filtering.

Thank you very much :-)

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

Re: [android-developers] Documentation for older Android SDK versions?

2011-04-30 Thread B Lyon
I think there's a little option on the page to filter by api level in
the kind of upper right

On Sat, Apr 30, 2011 at 6:38 PM, Stefan at WPF
 wrote:
> Hello,
> when browsing the Android SDK documentation, e.g.
> http://developer.android.com/reference/android/preference/PreferenceActivity.html,
> then this documentation is for the latest Android version (Android 3.0 r1 at
> the time of writing this).
>
> As I am developing for Android 2.2 it is very confusing for me to read the
> Android 3.0 documentation, e.g. it claims for addPreferencesFromResource(int
> preferencesResId):
>
> This method is deprecated. This function is not relevant for a modern
> fragment-based PreferenceActivity.
>
> Well, for Android 3.0 it might be, but seen from Android 2.2 it is probably
> not. So where can I find a documentation written from an Android 2.2
> perspective / the documentation written at the time of Android 2.2? On e.g.
> MSDN you can easily switch between the different documentation versions for
> e.g. .NET 3.5 and .NET 4.0, how about the Android documentation?
>
> Please note, that using the API Level Filter is not enough, even with API
> Level 1 (the lowest API Level where nothing can be deprecated) it claims
> that addPreferencesFromResource(int preferencesResId) is deprecated - the
> filter acts in a too simple way, just filtering out APIs with newer API
> Levels than the one specified for filtering.
>
> Thank you very much :-)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Documentation for older Android SDK versions?

2011-04-30 Thread Nicholas Johnson
AFAIK, you can't, unless you saved the Android 2.2 SDK when you downloaded 
it (you might also find someone on the net who has it). 

However, of all my apps that I have, 3 are developed for Android 1.6 and one 
is developed for Android 1.5. I don't have too much of a problem reading the 
SDK. I wouldn't let the "deprecated" get you down too much. Because, in 
fact, the method is deprecated but is still good and works fine.

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

[android-developers] Re: Fragments for Google Maps add on?

2011-04-30 Thread Streets Of Boston
The new contents of FragmentActivity.java are in my earlier post.
 
The AFragmentActivity.java is a copy of the original FragmentActivity.java 
with these additional changes:

   - public class AFragmentActivity extends Activity *implements 
   FragmentActivity* 
   - Then fix the compiler errors from the change above (i.e. implement 
   missing methods that are defined by the FragmentActivity). This is pretty 
   trivial.

The AFragmentMapActivity is a copy of the AFragmentActivity with these 
additional changes:

   - public abstract class AFragmentMapActivity extends *Map*Activity 
   implements FragmentActivity

Then you'll find that other source files in the compatibility have some 
compiler errors. These are trivial to fix. Mostly adding (Context) or 
(Activity) casts and calling '.getFragments()' instead of '.mFragments' and 
such.
 
Here is a usage example:
*public class Main extends AFragmentMapActivity {
 
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}*
* @Override
 protected boolean isRouteDisplayed() {
  return false;
 }
}*
 
*public class MapFragment extends Fragment {
 private ViewfragmentView;
 private MapView mapView;*
* 
 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle savedInstanceState) {
fragmentView = inflater.inflate(R.layout.map, container, false);
mapView = (MapView)fragmentView.findViewById(R.id.mapview);

return fragmentView;
 }*
*}*

And the layout main.xml has a  in there that refers to *
MapFragment*.
* 

* 
 



   -  
   - 

   

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

Re: [android-developers] How to get the text height

2011-04-30 Thread a a
thank you, i have solve it

2011/4/30 Kostya Vasilyev :
>
> http://developer.android.com/reference/android/graphics/Paint.html
>
> Take a pick:
>
> - getTextSize()
> - getTextBounds()
> - ascent() / descent()
> - getFontMetrics()
>
> -- Kostya
>
> 30.04.2011 17:55, a a пишет:
>>
>> get the text rect, then return the rect height, this is text height.
>>
>> 2011/4/30 a a:
>>>
>>> wrong answer, sorry...
>>>
>>> 2011/4/30 Marcin Orlowski:

 On 30 April 2011 12:49, a a  wrote:
>
> paint.measureText("text")  return the width, how can i get the height
> of the "text"?

 value you used in setTextSize() * screendensity factor shall mostly give
 what you want.

 Regards,
 Marcin Orlowski

 Tray Agenda - keep you daily schedule handy...
 Date In Tray - current date at glance...
 WebnetMobile on Facebook and Twitter

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

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


[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On Apr 29, 10:33 pm, Dianne Hackborn  wrote:
> On Fri, Apr 29, 2011 at 8:43 PM, Eric  wrote:
> > Sorry, I meant to say I'm calling ArrayAdapter.notifyDataSetChanged(),
> > not "ListAdapter.notifyDataSetChanged()".
>
> This API tells the list view that the entire data set has changed, so it
> needs to reload it and rebuild the items from the new data.  This includes
> the possibility that some items in the set may have been removed, added, or
> moved around, so it needs to build a new set of list item views and try to
> keep them positioned as well as possible to match the previous data set.

But that's exactly the situation I have.  My entire data set changes
from second to second.  My app displays a list of financial trading
markets in real time, showing bids and offers that change.  I never
know from one second to the next how many items the list will have,
because the market orders come (new order), go (traded or cancelled
order), and change (modified order price, etc).  The data set I'm
viewing is not a static size.  I don't think there's any other way for
me to display this data other than to tell the ListView its data set
has changed.  I would have to write my own 'list view' replacement if
I needed to optimize this.  However, contrary to what you may think,
the performance is more than acceptable.  This paradigm has been in
use on the iPhone for 2 years, and it performs extremely well.  The
Android 'port' of the app, thus far, performs almost as well as the
iPhone.

The reason I posted the original question was to ask why my touch
events would be 'swallowed' or 'lost'.  Do you see my relatively
frequent calls to ArrayAdapter.notifyDatasetChanged() causing the
Touch Events to get 'lost'?  If so, I would be highly confused if that
were the case.  All of my drawing, and all of the touch events, are
happening on a single main/UI thread, so I don't understand how, or
why, the Touch Events would get lost.   Even though the data is
streaming in on an background thread, i coalesce the changes in the
background thread until the UI can 'pop' the data off and redraw.
There is no thread starvation going on because the data thread
notifies the UI thread only one time, and then the UI thread schedules
a handoff to grab the data from the background thread when it is next
available.  And the update mechanism then continues from there for the
next cycle.  I would hope that the Touch Events would not get 'lost'
in all of this, but from my testing it appears some of them might be,
and I'd like to understand why.

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


[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric
By the way, this Google I/O video on ListView seems to indicate it is
perfectly acceptable, and in fact required, that you call
notifyDatasetChanged() when anything in your dataset changes (either
individual cell content, or data set size).  Nothing in this video
says you should be iterating through your list view cell Views
manually and updating them yourself (rather than call
notifyDatasetChanged()).  In fact, this video says never manually
access the Views in your ListView!

http://www.youtube.com/watch?v=wDBM6wVEO70&t=17m38s

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


[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Streets Of Boston
Yes, you're right about that. Calling notifyDataSetChanged on the adapter is 
the best way to go and you should use it in 99% of cases. However, in some 
cases rules should be broken. :)
A call to notifyDataSetChanged redraws all the children in the ListView and 
is relatively expensive and you get the side effects you notice in your 
example (touch issues).
In this case, another solution may be necessary, where visible list-items 
(child-views of the ListView) or their children update *themselves*.
You could do this by tagging list-item views (contentView-s) by calling 
setTag an do a getTag on all the ListView's child-views to be able to find 
them back when they need updating.

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

[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread lbendlin
i think this should say "redraws all the *visible* children in the listview" 

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

[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On Apr 30, 11:05 pm, Streets Of Boston 
wrote:
> Yes, you're right about that. Calling notifyDataSetChanged on the adapter is
> the best way to go and you should use it in 99% of cases. However, in some
> cases rules should be broken. :)
> A call to notifyDataSetChanged redraws all the children in the ListView and
> is relatively expensive and you get the side effects you notice in your
> example (touch issues).
> In this case, another solution may be necessary, where visible list-items
> (child-views of the ListView) or their children update *themselves*.
> You could do this by tagging list-item views (contentView-s) by calling
> setTag an do a getTag on all the ListView's child-views to be able to find
> them back when they need updating.

I continue to disagree with this.  First of all, the ListView should
only be redrawing what is visible on the screen.  That is why the
Adaptor has a getView(int position...) method, so that the ListView
can be smart about which views it needs to redraw.  Second of all, the
children VIEWS should not be responsible for updating themselves when
the underlying data changes.  This is precisely why the ListView's
Adaptor has a notifyDatasetChanged!  So that you can give a hint do
the ListView that the data has changed, and so that it can ask for the
Views it needs to update.  the getView() method on Adaptor also has a
"View convertView" arg so that it can pass the getView() method a
recycled view to update.  At the very worst, Adaptor needs to be
updated to have a "notifyDatasetChangedAtIndex(int[] indexes)" method
so that the ListView can be even smarter about which row(s) to
redisplay (instead of redisplaying the visible rows as it currently
does).  In any case, I just don't see why my VIEW code should be smart
about updating itself when the underlying data changes; in other words
isn't that what the Adaptor is supposed to do for 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


Re: [android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Dianne Hackborn
I'm not sure what more to say except that this isn't how
notifyDataSetChanged() is supposed to be used.  It is for relatively
infrequent, significant changes to the underlying data.  The typical case is
when a new query has been done in a database and the adapter is being
switched to show the data of the new cursor.

I understand that there is apparently some API on iOS that sounds similar
and is what you use, but for what you want to do this is not appropriate on
Android.  iOS != Android.

On Sat, Apr 30, 2011 at 9:38 PM, Eric  wrote:

>
>
> On Apr 29, 10:33 pm, Dianne Hackborn  wrote:
> > On Fri, Apr 29, 2011 at 8:43 PM, Eric  wrote:
> > > Sorry, I meant to say I'm calling ArrayAdapter.notifyDataSetChanged(),
> > > not "ListAdapter.notifyDataSetChanged()".
> >
> > This API tells the list view that the entire data set has changed, so it
> > needs to reload it and rebuild the items from the new data.  This
> includes
> > the possibility that some items in the set may have been removed, added,
> or
> > moved around, so it needs to build a new set of list item views and try
> to
> > keep them positioned as well as possible to match the previous data set.
>
> But that's exactly the situation I have.  My entire data set changes
> from second to second.  My app displays a list of financial trading
> markets in real time, showing bids and offers that change.  I never
> know from one second to the next how many items the list will have,
> because the market orders come (new order), go (traded or cancelled
> order), and change (modified order price, etc).  The data set I'm
> viewing is not a static size.  I don't think there's any other way for
> me to display this data other than to tell the ListView its data set
> has changed.  I would have to write my own 'list view' replacement if
> I needed to optimize this.  However, contrary to what you may think,
> the performance is more than acceptable.  This paradigm has been in
> use on the iPhone for 2 years, and it performs extremely well.  The
> Android 'port' of the app, thus far, performs almost as well as the
> iPhone.
>
> The reason I posted the original question was to ask why my touch
> events would be 'swallowed' or 'lost'.  Do you see my relatively
> frequent calls to ArrayAdapter.notifyDatasetChanged() causing the
> Touch Events to get 'lost'?  If so, I would be highly confused if that
> were the case.  All of my drawing, and all of the touch events, are
> happening on a single main/UI thread, so I don't understand how, or
> why, the Touch Events would get lost.   Even though the data is
> streaming in on an background thread, i coalesce the changes in the
> background thread until the UI can 'pop' the data off and redraw.
> There is no thread starvation going on because the data thread
> notifies the UI thread only one time, and then the UI thread schedules
> a handoff to grab the data from the background thread when it is next
> available.  And the update mechanism then continues from there for the
> next cycle.  I would hope that the Touch Events would not get 'lost'
> in all of this, but from my testing it appears some of them might be,
> and I'd like to understand why.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
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: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On Apr 30, 11:05 pm, Streets Of Boston 
wrote:
> A call to notifyDataSetChanged redraws all the children in the ListView and
> is relatively expensive and you get the side effects you notice in your
> example (touch issues).

Nobody has yet explained to me how calling notifyDatasetChanged()
relatively frequently would cause "touch issues".  I am calling
notifyDatasetChanged() from the main/UI thread.  The touches are
coming in and being processed from the main/UI thread.  No touches
should be lost.  Period.  When the main/UI thread is busy handling a
touch, it should do just that; handle the touch.  Nothing else in my
code could possibly be interfering with this because my code is also
running on the main thread.  My data processing code is running in a
background thread, but that does nothing worse than notify the main
thread in a variable that it may elect to pop data off the data thread
if it wants to on a later event loop.

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


[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On Apr 30, 11:29 pm, Dianne Hackborn  wrote:
> I'm not sure what more to say except that this isn't how
> notifyDataSetChanged() is supposed to be used.  It is for relatively
> infrequent, significant changes to the underlying data.  The typical case is
> when a new query has been done in a database and the adapter is being
> switched to show the data of the new cursor.

Let me simplify this.  Do you know of a Google example code you could
point me to that shows a ListView with many items updating itself,
without calling notifyDatasetChanged()?  Where the items in the list
are updating in real time?

How is my View code supposed to know which list items are visible?
Why should I be responsible for updating the cells if they aren't even
on the screen?  I'd need a pointer to all of the ListView subviews.
Why isn't there simply a method on Adapter named,
notifyDatasetChangedAtIndexes(int[] indexes), so that the ListView can
be smart about merging the changes that I tell it about, with only the
cells that are currently visible?

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


Re: [android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Romain Guy
Figuring out which items are visible is pretty easy, you can use
ListView.getFirstVisiblePosition() to know what section of your adapter is
visible (getFirstVisiblePosition() + getChildCount() - 1 gives you the last
visible position.)

On Sat, Apr 30, 2011 at 8:35 PM, Eric  wrote:

>
>
> On Apr 30, 11:29 pm, Dianne Hackborn  wrote:
> > I'm not sure what more to say except that this isn't how
> > notifyDataSetChanged() is supposed to be used.  It is for relatively
> > infrequent, significant changes to the underlying data.  The typical case
> is
> > when a new query has been done in a database and the adapter is being
> > switched to show the data of the new cursor.
>
> Let me simplify this.  Do you know of a Google example code you could
> point me to that shows a ListView with many items updating itself,
> without calling notifyDatasetChanged()?  Where the items in the list
> are updating in real time?
>
> How is my View code supposed to know which list items are visible?
> Why should I be responsible for updating the cells if they aren't even
> on the screen?  I'd need a pointer to all of the ListView subviews.
> Why isn't there simply a method on Adapter named,
> notifyDatasetChangedAtIndexes(int[] indexes), so that the ListView can
> be smart about merging the changes that I tell it about, with only the
> cells that are currently visible?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

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

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

[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On Apr 30, 11:39 pm, Romain Guy  wrote:
> Figuring out which items are visible is pretty easy, you can use
> ListView.getFirstVisiblePosition() to know what section of your adapter is
> visible (getFirstVisiblePosition() + getChildCount() - 1 gives you the last
> visible position.)

Ok.  So are you also agreeing that I should NOT be calling
Adapter.notifyDatasetChanged() to have the ListView automatically
refresh itself?  And I should be updating the data in the cells myself
behind the scenes when individual data changes (but the overall
dataset count remains the same as before)?  If so, this is complete
news to me.  This completely defeats the purpose of having an Adaptor,
and breaks the MVC paradigm.  The only thing I should have to do in my
code is tell the Adaptor that my dataset has changed, and the view
should redraw accordingly.  Adaptor should have a
notifyDatasetChangedAtIndexes(int[] indexes) at the very least, rather
than force the developer to update the cells manually.  I guess I'm
surprised Google is indicating the need for manual updates of data in
the cells.

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


Re: [android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Romain Guy
notifyDatasetChanged() is used to force ListView to invoke Adapter.getView()
again, which may be expensive, depending on what you do in it. ListView does
have many optimizations to make notifyDatasetChanged() calls as efficient as
possible though.

If you are doing *very* frequent updates (several times per second for
instance, with let's say a progress bar or some sort of animation) you
should indeed modify the Views directly.

Adaptor should have a
> notifyDatasetChangedAtIndexes(int[] indexes) at the very least, rather
> than force the developer to update the cells manually.


It doesn't really matter, it wouldn't be more efficient to update cells that
are already on screen. It would only matter when you update cells that are
not displayed. That said you can easily just not invoke
notifyDatasetChanged() if you are updating cells that are not between
getFirstVisiblePosition() and getFirstVisiblePositon() + getChildCount().

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

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

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

[android-developers] Re: Flaky Touch Screen on Nexus One

2011-04-30 Thread Eric


On May 1, 12:01 am, Romain Guy  wrote:
> If you are doing *very* frequent updates (several times per second for
> instance, with let's say a progress bar or some sort of animation) you
> should indeed modify the Views directly.

OK.


> Adaptor should have a
>
> > notifyDatasetChangedAtIndexes(int[] indexes) at the very least, rather
> > than force the developer to update the cells manually.
>
> It doesn't really matter, it wouldn't be more efficient to update cells that
> are already on screen. It would only matter when you update cells that are
> not displayed. That said you can easily just not invoke
> notifyDatasetChanged() if you are updating cells that are not between
> getFirstVisiblePosition() and getFirstVisiblePositon() + getChildCount().


My main point is that there is already a model-view-controller style
Adaptor in place to handle the mediation between the data and the
view, and so I would rather not have to update the View(s) directly
myself.  I would rather just write my Adaptor accordingly, and have
the data-side tell it when there are fresh changes to display, and
then have the ListView decide if/when it should act on those changes
(hence the notifyDatasetChangedAtIndexes()).

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


[android-developers] ViewHolder paradigm vs. using View.setTag()

2011-04-30 Thread Eric
In the Google I/O 2010 - The world of ListView talk shown here:

http://www.youtube.com/watch?v=wDBM6wVEO70&t=17m38s

a 'ViewHolder' paradigm is suggested to cache views and avoid the
findViewById lookup.  Could the same thing be achieved by using the
setTag(id, Object) method on View, and simply use the View's tag map
to store the reference by resource ID?  I think this would work, but
would it introduce any memory leak (or other) problems?


public static final View getCachedViewByTagId(View parentView, int
viewToFindId) {
Object object = parentView.getTag(viewToFindId);

if(object == null) {
object = parentView.findViewById(viewToFindId);

if(object != null) {
parentView.setTag(viewToFindId, object);
}
}

return (View)object;
}

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


Re: [android-developers] ViewHolder paradigm vs. using View.setTag()

2011-04-30 Thread Romain Guy
You could, but setTag(int, Object) forces you to use unique ids throughout
your app.

On Sat, Apr 30, 2011 at 9:27 PM, Eric  wrote:

> In the Google I/O 2010 - The world of ListView talk shown here:
>
> http://www.youtube.com/watch?v=wDBM6wVEO70&t=17m38s
>
> a 'ViewHolder' paradigm is suggested to cache views and avoid the
> findViewById lookup.  Could the same thing be achieved by using the
> setTag(id, Object) method on View, and simply use the View's tag map
> to store the reference by resource ID?  I think this would work, but
> would it introduce any memory leak (or other) problems?
>
>
>public static final View getCachedViewByTagId(View parentView, int
> viewToFindId) {
>Object object = parentView.getTag(viewToFindId);
>
>if(object == null) {
>object = parentView.findViewById(viewToFindId);
>
>if(object != null) {
>parentView.setTag(viewToFindId, object);
>}
>}
>
>return (View)object;
>}
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

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

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

[android-developers] Re: Enable imported account contacts programmatically

2011-04-30 Thread droidin.net
Anybody? Hints? Thoughts?

On Apr 29, 9:46 am, "droidin.net"  wrote:
> I'm successfully importing external contacts into the newly created
> account using this tutorialhttp://goo.gl/sLJeN. The account is setup
> to re-sync programmatically and yet to be able to see the synced
> contact, unless the contact dupe is found, I need to do 
> Contacts->Menu->Display options->Find account->Check "All Contacts". I'm 
> already
>
> dreading angry users enabling contact sync and not being able to see
> anything so the question is: is it possible to set display option for
> includingimportedaccount contacts programmatically? So when user opt
> for account creation he doesn't need to do anything else to 
> seeimportedcontacts?

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


  1   2   >