[android-developers] Re: All Android in app subscriptions were mysteriously automatically canceled

2012-08-09 Thread fibercode
Trevor,

Thank you for your prompt response and the explanation. At least now we 
know that we are not living in some alternate reality and stopped pinching 
ourselves in disbelief.

But, we still have all of our customers subscriptions canceled. None of 
those were restored back to active. Now when we query the Google API server 
to see if the subscriptions are still active we get "false".

For example:
We queried Google order number: 574480490664998 and got the following JSON 
response:

{
 "kind": "androidpublisher#subscriptionPurchase",
 "initiationTimestampMsec": "1342064134000",
 "validUntilTimestampMsec": "1344749703290",
 "autoRenewing": false
}

That order should have been restored to autoRenewing: true!

Please let me know if we are missing something?

Our customers have not had any termination of service, since our servers 
are correctly keeping track of the expiration date of their subscriptions.
But that is not the point. The main thing is that they would have to now 
manually go and purchase the same subscription they did subscribe to before 
(the one they did not unsubscribe from).
I think that is a horrible way to treat them.

I do not want to sound harsh, but we are trying to run a business not 
play high school games.

Any help is greatly appreciated!

Thank you.


On Thursday, 9 August 2012 21:29:30 UTC-4, Trevor Johns wrote:
>
> fibercode,
> A number of in-app billing subscriptions were erroneously marked as 
> canceled this morning due to an issue on our servers. Most of the affected 
> subscriptions have already been restored by our engineers, and users did 
> not loose access to content during this time. We will be sending a followup 
> email soon to those affected explaining what happened.
>
> There were a small minority of users who's subscription auto-renewal dates 
> occurred before we we were able to restore the subscription, and 
> accordingly were not renewed. These users can choose to re-subscribe using 
> the standard in-app billing mechanism within your app (they will appear as 
> a standard expired subscription to your app).
>
> The HTTP Android Developer API would have still returned the correct 
> expiration time for all subscriptions, so users continued to receive all 
> content they had paid for.
>
> We sincerely apologize the inconvenience this has caused, and our team 
> will be taking steps to ensure similar incidents do not occur in the future.
>
> -- 
> Trevor Johns
> Google Developer Programs, Android
> http://developer.android.com
>
> On Thursday, August 9, 2012 12:03:23 PM UTC-7, fibercode wrote:
>>
>> One of our Android applications has supported in app billing for a while 
>> now.
>>
>> A little over two weeks ago we published an update that supports the 
>> newly released by Google in app subscriptions.
>>
>> Everything was fine until this morning when mysteriously all the 
>> subscriptions purchased by our customers were canceled automatically! 
>> We got up this morning, checked our emails and our test accounts had the 
>> subscriptions canceled even though we had not done that. This obviously 
>> raised a lot of red flags so we started checking our customers' 
>> subscriptions and it seems that they were all canceled !!! We were even 
>> contacted by several of our customers who thought that we canceled their 
>> subscriptions.
>>
>> The new subscription purchases done today (August 9th) are not being 
>> canceled but we can no longer trust how long that will last.
>>
>> The only conclusion we could come to is that Google canceled the 
>> subscriptions (either on purpose or accidentally).
>> Most likely this looks like a bug on the Google side, but we need some 
>> help to narrow this down.
>>
>> 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] Can a folder be created using instrumentation context instead of target context?

2012-08-09 Thread Dianne Hackborn
Not generally, when the instrumentation is running in the target process,
it is running under that uid.  You could do something like put a service or
content provider (or receiver) in your instrumentation apk that you can
interact with from the instrumentation code running in the app being tested.

On Thu, Aug 9, 2012 at 11:15 AM, dnkoutso  wrote:

> I am writing instrumentation tests for my app and want to create a
> temporary folder to store some files. However, I dont want to do that in
> the targetContext but rather in the test context.
>
> In other words:
> File dir = getInstrumentation().*getTargetContext()*.getDir("directory",
> MODE_WORLD_READABLE);  // Works, but this creates the folder in the target
> app.
>
> File dir = getInstrumentation().*getContext()*.getDir("directory",
> MODE_WORLD_READABLE);  // Does not work, the exists() returns false.
>
> Thoughts?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] Alert Dialog Box -Wifi

2012-08-09 Thread TreKing
On Fri, Aug 10, 2012 at 12:53 AM, Meena Rengarajan
wrote:

> When i click Yes button , it automatically should enable WiFi by
> progeammatically and if i click No then aopplication must be closed. What
> should i do here . Please can anyone help me?


http://lmgtfy.com/?q=android+turn+on+wifi+programatically

http://lmgtfy.com/?q=android+close+application

-
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] Android efficiency for huge amount of SQLlite DB records?

2012-08-09 Thread chainz roid
Hello

I'm working with android ICS, and i planned to use  SQLlite as my app back 
end. my SQLlite DB have more than 1lakhs  record in table.
Android will support this much huge amount of records.?, its efficient to 
process or it will lag .?

Thanks in advance. 

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

[android-developers] Alert Dialog Box -Wifi

2012-08-09 Thread Meena Rengarajan
This is my Code, Alert box appears here like Yes /No. But what i need is, 
When i click Yes button , it automatically should enable WiFi by 
progeammatically and if i click No then aopplication must be closed. What 
should i do here . Please can anyone help me?


   public void onClick(DialogInterface dialog, int which) {
 Toast.makeText(getApplicationContext(), "'Yes',WiFi Enabled 
Now",Toast.LENGTH_SHORT).show();
// TODO Auto-generated method stub
 }
});
 alertbox.setNegativeButton("No", new DialogInterface.OnClickListener() {
 @Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "'No',WiFi Disabled so application 
is closed", Toast.LENGTH_SHORT).show(); 
 // TODO Auto-generated method stub
 }
});
alertbox.show();

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

[android-developers] Alert Dialog Box

2012-08-09 Thread Meena Rengarajan
How to Enable Wifi automatically in Android 2.2 in an alert box ? If i 
click Yes button then it should be enable and if i click no then 
application must be closed. Can anyone tell me this how should i do ?

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

[android-developers] Re: How to use apache commons in my android application

2012-08-09 Thread sumit dhaniya


On Thursday, August 20, 2009 5:21:00 AM UTC+5:30, hap 497 wrote:
>
> HI,
>
> Can you please tell me how to use apache.commons in my android application.
>
> I put the right import, but when I compile it I get the following error:
>
> : package org.apache.commons.io does not exist
> import org.apache.commons.io.IOUtils;
>
> Thank you for any help.
>

Hi,

Only apache commons related to logging is included in android.
I did imported the common jar file for IOUtils in my project and it 
compiles just fine but at run time it's throwing NoClassDefFoundError. I 
dn't know wat's wrong with it? Can use some help.

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

Re: [android-developers] Add padding in Menu Bar

2012-08-09 Thread Justin Anderson
What have you tried so far?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Thu, Aug 9, 2012 at 3:10 AM, akash  wrote:

> Hi,
>
> Can anybody help me in figuring how to add padding in menu bar. I am
> having 4 buttons in my menu bar, and i don't want to give space between
> them.
>
> 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

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

2012-08-09 Thread Justin Anderson
What?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Thu, Aug 9, 2012 at 3:55 AM, 王志鹏  wrote:

> Dear everyone,
>
>
> In our application, we have a listview, and the height of each item can
> change.
>
> My question is, is it possible to make the last visible item on screen
> completely visible?
>
> Best wishes,
>
> Zhipeng Wang
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] position the different image views

2012-08-09 Thread Justin Anderson
So use a RelativeLayout...  The image you want in the center needs to have
android:centerInParent="true"  All the other images need to be set relative
to the one in the center.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware



On Thu, Aug 9, 2012 at 6:46 AM, Vijay Krishnan wrote:

> in my case i have 5 imageviews.I have to position one at the centre and
> the remaining 4 imageview in circular order relative to the centre
>
>
> On Tue, Aug 7, 2012 at 11:58 PM, Justin Anderson wrote:
>
>> I have different image views and i want to position the other imageviews
>>> relatively  with centre image view.And i have done it with using
>>> FrameLayout.ImageViews look fine in Samsung S3,but in samsung galaxy Y the
>>> last imageview added to the layout only appears on the screen.
>>
>>
>> So, you are wanting to position ImageViews *relative* to each other, and
>> your first thought was NOT to use a *Relative*Layout? I'm not sure I
>> follow the logic train on that one...
>>
>> Thanks,
>> Justin Anderson
>> MagouyaWare Developer
>> http://sites.google.com/site/magouyaware
>>
>>
>> On Tue, Aug 7, 2012 at 5:14 AM, Vijay Krishnan 
>> wrote:
>>
>>> Hi all,
>>> I have different image views and i want to position the other
>>> imageviews relatively  with centre image view.And i have done it with using
>>> FrameLayout.ImageViews look fine in Samsung S3,but in samsung galaxy Y the
>>> last imageview added to the layout only appears on the screen.
>>>
>>> Thanks,
>>> vijay.k
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, 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
>

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

[android-developers] Wifi State

2012-08-09 Thread Meena Rengarajan
When i click button, Wifi should be in "ON" state by programmatically , if 
it is not connected (ON state) then Alert Dialog box must appear by saying 
, "Are you wanted to enable Wifi/ Disable" like "OK" or "Cancel". If i 
click "Ok" then Wifi should be connected (ON ) state , if i click cancel 
then application should be closed.

Can anyone help me here please ? I am very new to this technology .. 

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

[android-developers] [ASK] drawbitmap not draw entire bitmap

2012-08-09 Thread hendra uswandy
Hi,

i create customImageView Class that using for gridview

in ondraw(Canvas canvas) method
drawbitmap not draw entire bitmap ( just 5pixel from top image )

this is my customimageview class

public class CustomView extends ImageView {

private Bitmap thumbs;
private String name;

public CustomView(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();

canvas.drawBitmap(thumbs, 0, 0, paint);
canvas.drawText("x", 0, 0, paint);
super.onDraw(canvas);
}

public void setImg(Bitmap bm) {
this.thumbs = bm;
}

}

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] MAX Repeat count of windowEnterAnimation

2012-08-09 Thread Dianne Hackborn
The window manager limits the duration of animations, I believe to 10
seconds or so.

Don't do this.  It is not right to have a window animation that runs
indefinitely.

On Thu, Aug 9, 2012 at 3:03 PM, danaimset  wrote:

> Hi Guys!
>
> I've face with problems with windowEnterAnimation.
> I'm trying to animate popup window over the view for infinite. But it
> seems that windowEnterAnimation has limitation of repeat count.
>
>
> 
>
>
> I'm using the following animation:
>
> 
> http://schemas.android.com/apk/res/android"; >
>
>  android:duration="500"
> android:fromYDelta="0"
> android:interpolator="@android:anim/bounce_interpolator"
> android:repeatCount="infinite"
> android:repeatMode="reverse"
> android:toYDelta="-20" />
>
> 
>
> And the following animation style for the popup window:
>
> 
> @anim/jump_up
> @anim/alpha
> 
>
> The animation is repeated only 10 times but not infinitely :(
>
> Maybe somebody could give some advice how this problem could be solved ?
>
> Thanks.
>
> Best Wishes,
> Dan.
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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: ADB and Mountain Lion Issues

2012-08-09 Thread Dave Smith
Galaxy Tab 10.1, Nexus 7, Droid 2, Droid Intercept;  I'm fairly confident it's 
not device/manufacturer specific.  Wondering if there's a USB cache I can 
clear...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: All Android in app subscriptions were mysteriously automatically canceled

2012-08-09 Thread Trevor Johns
fibercode,
A number of in-app billing subscriptions were erroneously marked as 
canceled this morning due to an issue on our servers. Most of the affected 
subscriptions have already been restored by our engineers, and users did 
not loose access to content during this time. We will be sending a followup 
email soon to those affected explaining what happened.

There were a small minority of users who's subscription auto-renewal dates 
occurred before we we were able to restore the subscription, and 
accordingly were not renewed. These users can choose to re-subscribe using 
the standard in-app billing mechanism within your app (they will appear as 
a standard expired subscription to your app).

The HTTP Android Developer API would have still returned the correct 
expiration time for all subscriptions, so users continued to receive all 
content they had paid for.

We sincerely apologize the inconvenience this has caused, and our team will 
be taking steps to ensure similar incidents do not occur in the future.

-- 
Trevor Johns
Google Developer Programs, Android
http://developer.android.com

On Thursday, August 9, 2012 12:03:23 PM UTC-7, fibercode wrote:
>
> One of our Android applications has supported in app billing for a while 
> now.
>
> A little over two weeks ago we published an update that supports the newly 
> released by Google in app subscriptions.
>
> Everything was fine until this morning when mysteriously all the 
> subscriptions purchased by our customers were canceled automatically! 
> We got up this morning, checked our emails and our test accounts had the 
> subscriptions canceled even though we had not done that. This obviously 
> raised a lot of red flags so we started checking our customers' 
> subscriptions and it seems that they were all canceled !!! We were even 
> contacted by several of our customers who thought that we canceled their 
> subscriptions.
>
> The new subscription purchases done today (August 9th) are not being 
> canceled but we can no longer trust how long that will last.
>
> The only conclusion we could come to is that Google canceled the 
> subscriptions (either on purpose or accidentally).
> Most likely this looks like a bug on the Google side, but we need some 
> help to narrow this down.
>
> Thank you.
>

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

[android-developers] MAX Repeat count of windowEnterAnimation

2012-08-09 Thread danaimset
Hi Guys!

I've face with problems with windowEnterAnimation.
I'm trying to animate popup window over the view for infinite. But it seems 
that windowEnterAnimation has limitation of repeat count.




I'm using the following animation:


http://schemas.android.com/apk/res/android"; >





And the following animation style for the popup window:


@anim/jump_up
@anim/alpha


The animation is repeated only 10 times but not infinitely :(

Maybe somebody could give some advice how this problem could be solved ?

Thanks.

Best Wishes,
Dan.


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

[android-developers] Re: view elements unintenionally blinking

2012-08-09 Thread bbbill
Found the reason for blinking views: the top RelativeLayout collided with 
the ActionBar, which is automatically added to the layout since Honeycomb 
and has effect even if it is not visible. Although I do not understand 
what's really going on, I found a way to get rid of the ActionBar, as not 
needed (by googeling of course).
Here is the solution, that makes it disappear and also works for older 
versions of Android that do not support ActionBars.
In the Activity hosting my SurfaceView I modified:

   @Override
   public void onStart(){
   super.onStart();
   if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
   ActionBar actionbar;
   actionbar = getActionBar();
   actionbar.hide();
   }
   ...
}


Am Mittwoch, 8. August 2012 19:19:40 UTC+2 schrieb bbbill:
>
> Hi All,
> on my Android Tab (TF 101g with keyboard dock, Android 4.03) 
> I observe some strange blinking I cannot explane.
> The whole screen is being controlled by a Relative Layout containing 
> another Realive Layout with some view elements on top position, followed by 
> a SurfaceView with a grafic canvas and below that some other views, one of 
> them an EditView for number entry.
> When I run my application on that device being undocked, i.e. without the 
> hard keyboard, and hold it in landscape orientation, first the soft 
> keyboard appears and all view elements get shifted topwards. Then, after I 
> closed down the keyboard,  all view elements return to their original 
> position, *while those within the RelativeLayout above the SurfaceView 
> start blinking continuously*.
> Even Part of the application title and Icon get overwritten in black an 
> reappear on a half second rate.
> When I replugg the device into the keyboard dock, blinking stopps 
> immediately.
> Neither does this occur, when I hold the undocked device in portrait 
> orientation.
> There seems to be a certain dependency on the EditView below the 
> SurfaceView. At least the blinking rate goes down, when this is disabled.
> I have the same application running on a smart phone (Alcatel OT918D, 
> Android 2.3.6) and there is no such issue at all.
> (On the smart phone the EditView is not visible in landscape orientation, 
> because it does not fit within the display. Is this of any importance at 
> all?)
>
> The containing views xml-file is attached.
>
> Any helpful hints gratefully apreciated
>
>

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

2012-08-09 Thread Mark Murphy
You need to either sort the data before you hand it to the adapter, or
teach the adapter how to do the sorting.

On Thu, Aug 9, 2012 at 2:48 PM, Wolfgang  wrote:

> Hey guys,
>
> I'm using a ListView that displays a list of ChartInfo. ChartInfo is a
> class I wrote that contains two strings: name, type; and a boolean:
> notification. The ListView is sorting the charts based on name. I would
> prefer that it sorts first based on the boolean, notification, and then
> sorts by the string, name. Can someone point me to a good resource to
> accomplish this or give me some guidance. Here is an example of what I
> would like to accomplish:
> 
>
>
> 
> Thanks,
> -W
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




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

Android Training in NYC: http://marakana.com/training/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: Rotation Event Firing Omniture Tags

2012-08-09 Thread bob
 

Why not just pick portrait or landscape and not allow rotation?

On Wednesday, August 8, 2012 3:19:57 PM UTC-5, Chris Keune wrote:
>
> Hello Gurus, 
>
> Currently, I am experiencing my Omniture tracking to fire multiple times 
> on each screen rotation(ie additional PageViews). Is there anyway to 
> exclude the Omniture tags from firing on each rotation?
>
>
> 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] All Android in app subscriptions were mysteriously automatically canceled

2012-08-09 Thread fibercode
One of our Android applications has supported in app billing for a while 
now.

A little over two weeks ago we published an update that supports the newly 
released by Google in app subscriptions.

Everything was fine until this morning when mysteriously all the 
subscriptions purchased by our customers were canceled automatically! 
We got up this morning, checked our emails and our test accounts had the 
subscriptions canceled even though we had not done that. This obviously 
raised a lot of red flags so we started checking our customers' 
subscriptions and it seems that they were all canceled !!! We were even 
contacted by several of our customers who thought that we canceled their 
subscriptions.

The new subscription purchases done today (August 9th) are not being 
canceled but we can no longer trust how long that will last.

The only conclusion we could come to is that Google canceled the 
subscriptions (either on purpose or accidentally).
Most likely this looks like a bug on the Google side, but we need some help 
to narrow this down.

Thank you.

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

[android-developers] Re: Irregular Polygon Area Calculation in Android MapView

2012-08-09 Thread bob
 

A GeoPoint is a point.  The area of a point is zero.

On Thursday, August 9, 2012 11:45:07 AM UTC-5, ajmer singh wrote:
>
> Hi All
>
> I am working on an Map based android application where i want to calculate 
> the area of Polygon created by the Goepoint on the MapView, Please if any 
> body can provide any lead on how can i achieve the area calculation using 
> GPS coordinates.
>
> Please help thanks in advance.
>
> -- 
> Thanks and Regards
> Ajmer Singh
>  

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

[android-developers] ListView sorting

2012-08-09 Thread Wolfgang
Hey guys,
 
I'm using a ListView that displays a list of ChartInfo. ChartInfo is a 
class I wrote that contains two strings: name, type; and a boolean: 
notification. The ListView is sorting the charts based on name. I would 
prefer that it sorts first based on the boolean, notification, and then 
sorts by the string, name. Can someone point me to a good resource to 
accomplish this or give me some guidance. Here is an example of what I 
would like to accomplish:

 

Thanks,
-W

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

2012-08-09 Thread bob
What other devices do you use besides Galaxy Nexus, Nexus S, and HTC EVO 4G?

I don't have any of those.

I use mostly a Galaxy Tab and haven't seen any adb issues with Mtn Lion.


On Thursday, August 9, 2012 11:36:03 AM UTC-5, Dave Smith wrote:
>
> This definitely does help, but only for 1-2 times; then I have to move the 
> port again.  This is definitely faster than rebooting the devices, though, 
> so this will be my new go-to workaround.
>
> It just feels like there's a bug somewhere in how it picks up connected 
> devices, or how it reads the enumeration info in the new Mac OS.  Does ADB 
> have a cache of devices it's seen that might not be clearing properly?
>
> On Wednesday, August 8, 2012 11:24:55 AM UTC-6, Kenneth wrote:
>>
>> Try using a different usb port. Fixed it for me. I'm using the new 
>> MacBook Pro.
>>
>

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

[android-developers] Can a folder be created using instrumentation context instead of target context?

2012-08-09 Thread dnkoutso
I am writing instrumentation tests for my app and want to create a 
temporary folder to store some files. However, I dont want to do that in 
the targetContext but rather in the test context.

In other words:
File dir = getInstrumentation().*getTargetContext()*.getDir("directory", 
MODE_WORLD_READABLE);  // Works, but this creates the folder in the target 
app.

File dir = getInstrumentation().*getContext()*.getDir("directory", 
MODE_WORLD_READABLE);  // Does not work, the exists() returns false.

Thoughts?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: HttpsURLConnection when APN has proxy set

2012-08-09 Thread Robert Greenwalt
I suspect circumventing the proxy on most carriers would be fine - they
seem to prefer its use but AFAIK not require it.  On wifi connections
though you'll probably run into alot of situations behind corporate
firewalls where proxy use is required to reach the internet.



On Wed, Aug 8, 2012 at 8:59 PM, Zoran Smilevski
wrote:

> No problem :)
>
> I had a problem with posting data on non-80 port. You can read more 
> here
> .
>
> I didn't notice any problem since then.
>
>
> On Thursday, August 9, 2012 5:48:28 AM UTC+2, Steve Baldwin wrote:
>>
>> Thanks Zoran.
>>
>> I just re-ran my test app and it worked with the NO_PROXY setting !!
>>
>> Another probably dumb question.  Is this guaranteed to not adversely
>> affect internet connectivity?  In other words, just because it worked in my
>> test case, does that mean that other mobile carriers that specify a proxy
>> in their APN settings will also be fine?
>>
>> Cheers,
>>
>> Steve
>>
>> On Thursday, August 9, 2012 1:15:22 PM UTC+10, Zoran Smilevski wrote:
>>>
>>> Did you try to open a connection with NO_PROXY parameter?
>>>
>>> HttpURLConnection conn = (HttpURLConnection)mUrl.**
>>> openConnection(Proxy.NO_PROXY)**;
>>>
>>>
>>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] Non sticky service gets recreated (indefinetly?)

2012-08-09 Thread Dianne Hackborn
Binding to a service can only make that service's process as important as
the process of the client binding to it.  If the client process is in the
background, it can't bring the service up beyond the background, so it
doesn't count as a running process but a cached process.

On Thu, Aug 9, 2012 at 3:09 AM, Johan Appelgren
wrote:

> Ok, thanks. But shouldn't it (non-sticky service with no active
> connections, nothing is bound to it) show up in the Running Services view
> when it has been restarted? Or is that only for sticky services?
>
>
> On Thursday, August 9, 2012 8:35:50 AM UTC+2, Dianne Hackborn wrote:
>
>> Binding and starting are completely orthogonal things.  You bind to a
>> service to establish a persistent connection to it.  You start a service to
>> have it run for some undefined amount of time separately from the caller.
>>  A service needs to remain created as long as it is being asked to do
>> either of these things.
>>
>> If you don't want it to stay created, either don't bind to it when you
>> don't want it around, or don't use BIND_AUTO_CREATE so you aren't forcing
>> it to remain created while bound to it.
>>
>> On Wed, Aug 8, 2012 at 10:46 PM, Johan Appelgren wrote:
>>
>>> So START_NOT_STICKY has no effect once I've bound to it even if I
>>> unbind? I must explicitly use stopService if the service has ever been
>>> bound to even if there are no more connection?
>>>
>>>
>>> On Thursday, August 9, 2012 2:54:41 AM UTC+2, Dianne Hackborn wrote:
>>>
 If you bind to it with BIND_AUTO_CREATE, you are saying you want the
 service to be created as long as you are bound to it.

 From the documentation:

 A service can be both started and have connections bound to it. In such
 a case, the system will keep the service running as long as either it is
 started or there are one or more connections to it with the
 Context.BIND_AUTO_CREATE flag.

 http://developer.android.com/**r**eference/android/app/Service.**h**tml

 On Wed, Aug 8, 2012 at 1:52 PM, Johan Appelgren 
 wrote:

> If I have a simple service that returns START_NOT_STICKY in
> onStartCommand and I both start it explicitly (startService) and bind to 
> it
> (bindService) in onCreate of my activity the service gets recreated after
> it has been killed over and over again. I unbind the service in onPause of
> my activity.
>
> Logcat shows that the service is scheduled for restart and is
> restarted over and over again. The service is not shown as running after
> it's been recreated in Settings -> Apps -> Running.
>
> 08-08 21:57:25.081 D/ExampleActivity(23715): onPause
> 08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of
> crashed service com.example.service/.**MainServi**ce in 5000 ms
>  08-08 22:11:49.519 I/ActivityManager(  306): Start proc
> com.example.strangeservice for service com.example.service/.**
> MainServi**ce
> 08-08 22:11:49.597 D/ExampleService(24079): onCreate
>  08-08 22:27:38.551 I/ActivityManager(  306): No longer want
> com.example.service (pid 24079): hidden #16
> 08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of
> crashed service com.example.service/.**MainServi**ce in 5000ms
> 08-08 22:27:43.629 I/ActivityManager(  306): Start proc
> com.example.strangeservice for service com.example.service/.**
> MainServi**ce: pid=24401 uid=10101 gids={1028}
> 08-08 22:27:43.785 D/ExampleService(24401): onCreate
> 08-08 22:49:59.871 I/ActivityManager(  306): Process
> com.example.service (pid 24401) has died.
> 08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of
> crashed service com.example.service/.**MainServi**ce in 5000ms
> 08-08 22:50:04.934 I/ActivityManager(  306): Start proc
> com.example.strangeservice for service com.example.service/.**
> MainServi**ce: pid=24857 uid=10101 gids={1028}
> 08-08 22:50:05.051 D/ExampleService(24857): onCreate
>
> I thought START_NOT_STICKY meant that once it gets killed by Android
> it wont be restarted unless I explicitly start it again. Or does binding 
> to
> a service override that and make the service sticky?
>
> I've been testing this on a Galaxy Nexus with stock Android 4.1.1.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@**googlegroups.com
>
> To unsubscribe from this group, send email to
> android-developers+**unsubscribe**@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/**group**/android-developers?hl=en
>



 --
 Dianne Hackborn
 Android framework engineer
 hac...@android.

[android-developers] Re: Irregular Polygon Area Calculation in Android MapView

2012-08-09 Thread goodG
http://math.stackexchange.com/

In your case this is probably one of the best options that you have on the 
internet

Il giorno giovedì 9 agosto 2012 18:45:07 UTC+2, ajmer singh ha scritto:
>
> Hi All
>
> I am working on an Map based android application where i want to calculate 
> the area of Polygon created by the Goepoint on the MapView, Please if any 
> body can provide any lead on how can i achieve the area calculation using 
> GPS coordinates.
>
> Please help thanks in advance.
>
> -- 
> Thanks and Regards
> Ajmer Singh
>  

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

2012-08-09 Thread RichardC
This is complex problem even if your points are close enough together for 
you to assume that the earth is flat.  You will need to check that the 
polygon is closed and non-self-intersecting.  If you do this the formula is 
Wikipedia page here:  http://en.wikipedia.org/wiki/Polygon 
Note that the formula assumes that the earth is flat.

Also try Stackoverflow:  
http://stackoverflow.com/questions/1340223/calculating-area-enclosed-by-arbitrary-polygon-on-earths-surface
 

On Thursday, August 9, 2012 5:45:07 PM UTC+1, ajmer singh wrote:
>
> Hi All
>
> I am working on an Map based android application where i want to calculate 
> the area of Polygon created by the Goepoint on the MapView, Please if any 
> body can provide any lead on how can i achieve the area calculation using 
> GPS coordinates.
>
> Please help thanks in advance.
>
> -- 
> Thanks and Regards
> Ajmer Singh
>  

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

[android-developers] Irregular Polygon Area Calculation in Android MapView

2012-08-09 Thread Ajmer Singh
Hi All

I am working on an Map based android application where i want to calculate
the area of Polygon created by the Goepoint on the MapView, Please if any
body can provide any lead on how can i achieve the area calculation using
GPS coordinates.

Please help thanks in advance.

-- 
Thanks and Regards
Ajmer Singh

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

2012-08-09 Thread Dave Smith
This definitely does help, but only for 1-2 times; then I have to move the 
port again.  This is definitely faster than rebooting the devices, though, 
so this will be my new go-to workaround.

It just feels like there's a bug somewhere in how it picks up connected 
devices, or how it reads the enumeration info in the new Mac OS.  Does ADB 
have a cache of devices it's seen that might not be clearing properly?

On Wednesday, August 8, 2012 11:24:55 AM UTC-6, Kenneth wrote:
>
> Try using a different usb port. Fixed it for me. I'm using the new MacBook 
> Pro.
>

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

2012-08-09 Thread bob
 

Well, what does the string json look like?


If it is base64, it must contain only lowercase letters (26), uppercase 
letters (26), digits (10), a plus sign (1), a slash (1), and possibly end 
with some equals characters.



On Thursday, August 9, 2012 10:13:23 AM UTC-5, Иван Дунский wrote:
>
> Yeah, I tried both Base64.NO_PADDING and used string instead of 
> bytes[]...I get the same result...
>
>
>
> четверг, 9 августа 2012 г., 16:13:13 UTC+3 пользователь Harri Smått 
> написал:
>>
>> On Aug 9, 2012, at 3:24 PM, Иван Дунский  wrote: 
>> > What's is reason of it? 
>>
>> "java.lang.IllegalArgumentException:  bad base-64". Documentation states 
>> though; 
>>
>> 1. 
>> > The padding '=' characters at the end are considered optional, but if 
>> any are present, there must be the correct number of them. 
>>
>> 2. 
>> > Throws IllegalArgumentException if the input contains incorrect padding 
>>
>> Have you tried using NO_PADDING flag for Base64.decode(…)? Alternatively 
>> you could try using Base64.decode(json, flags), not json.getBytes(). 
>>
>> -- 
>> H
>
>

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

2012-08-09 Thread bob
You need to use the variable "location" passed into onLocationChanged. 
 Right now, you're ignoring it.


On Thursday, August 9, 2012 7:13:16 AM UTC-5, Ece Osmanağaoğlu wrote:
>
> I added LocationListener, unfortunately still doesn't work.
>
> locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
> gpsProv = locMan.GPS_PROVIDER;
> locMan.requestLocationUpdates(gpsProv, 0, 0, locList);
> 
> okullar.setOnItemClickListener(new OnItemClickListener() 
> {
> public void onItemClick(AdapterView arg0, View arg1, int arg2, 
> long arg3) 
> {
> AlertDialog.Builder alert = new 
> AlertDialog.Builder(Kampusler.this);
> switch (arg2) 
> {
> case 0:
> alert.setTitle("- Konumunuz 
> -").setMessage(Lokasyonum()).setPositiveButton("Tamam", null).show();
> break;
> 
> case 1:
> alert.setTitle("- Konumunuz 
> -").setMessage(Lokasyonum()).setPositiveButton("Tamam", null).show()
> break;
> default:
> break;
> }
> }
> });
> }
> private String Lokasyonum() 
> {
> loc = locMan.getLastKnownLocation(gpsProv);
> if(loc != null)
> MyLocation();
> else
> Toast.makeText(getApplicationContext(), "Can't Find...", 
> Toast.LENGTH_SHORT).show();
> 
> return sonuc;
> }
>
> private String MyLocation() 
> {
> Geocoder myGeo = new Geocoder(Kampusler.this);
> try
> {
> List adres = myGeo.getFromLocation(loc.getLatitude(), 
> loc.getLongitude(), 1);
> if(adres != null)
> {
> for(int i=0; i {
> sonuc = adres.get(0).getAddressLine(i) + "\n";
> 
> }
> }
> else
> Toast.makeText(getApplicationContext(), "Can't Find 
> Address...", Toast.LENGTH_SHORT).show();
> }
> catch (Exception e) 
> {
> e.printStackTrace();
> Toast.makeText(getApplicationContext(), e.getMessage(), 
> Toast.LENGTH_SHORT).show();
> }
> 
> return sonuc;
> }
>
> public class MyLocList implements LocationListener
> {
> public void onLocationChanged(Location location) 
> {
> MyLocation();
> }
> public void onProviderDisabled(String provider) 
> {}
> public void onProviderEnabled(String provider) 
> {}
> public void onStatusChanged(String provider, int status, 
> Bundle extras) 
> {}
> }
> }
> On Wednesday, August 8, 2012 3:13:26 PM UTC+3, Ece Osmanağaoğlu wrote:
>>
>> I wanna get current location.
>> There is null pointer exception in List
>>
>> locMan = (LocationManager) 
>> this.getSystemService(Context.LOCATION_SERVICE);
>> gpsProv = LocationManager.GPS_PROVIDER;
>> locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 
>> 250, Kampusler.this);
>> myGeo = new Geocoder(Kampusler.this, Locale.getDefault());
>> 
>> loc = locMan.getLastKnownLocation(gpsProv);
>> try
>> {
>> List adres = 
>> myGeo.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1);
>> if(adres != null) 
>> {
>> for(int i=0; i < 
>> adres.get(0).getMaxAddressLineIndex(); i++)
>> {  
>> result += adres.get(0).getAddressLine(i) + "\n";
>> }   
>> }
>> else
>> {
>> Toast.makeText(Kampusler.this, "Don't get 
>> address...", Toast.LENGTH_LONG).show();
>> }
>> }
>> catch (Exception e) 
>> {
>> e.printStackTrace();
>> Toast.makeText(getApplicationContext(), e.getMessage(), 
>> Toast.LENGTH_SHORT).show();
>> }
>>
>

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

2012-08-09 Thread Иван Дунский
Yeah, I tried both Base64.NO_PADDING and used string instead of bytes[]...I 
get the same result...



четверг, 9 августа 2012 г., 16:13:13 UTC+3 пользователь Harri Smått написал:
>
> On Aug 9, 2012, at 3:24 PM, Иван Дунский > 
> wrote: 
> > What's is reason of it? 
>
> "java.lang.IllegalArgumentException:  bad base-64". Documentation states 
> though; 
>
> 1. 
> > The padding '=' characters at the end are considered optional, but if 
> any are present, there must be the correct number of them. 
>
> 2. 
> > Throws IllegalArgumentException if the input contains incorrect padding 
>
> Have you tried using NO_PADDING flag for Base64.decode(…)? Alternatively 
> you could try using Base64.decode(json, flags), not json.getBytes(). 
>
> -- 
> H

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

2012-08-09 Thread Harri Smått
On Aug 9, 2012, at 3:24 PM, Иван Дунский  wrote:
> What's is reason of it?

"java.lang.IllegalArgumentException:  bad base-64". Documentation states though;

1.
> The padding '=' characters at the end are considered optional, but if any are 
> present, there must be the correct number of them.

2.
> Throws IllegalArgumentException if the input contains incorrect padding

Have you tried using NO_PADDING flag for Base64.decode(…)? Alternatively you 
could try using Base64.decode(json, flags), not json.getBytes().

--
H

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


[android-developers] Re: How to use apache thrift with android????

2012-08-09 Thread riderj
It looks like the log4j library is causing the issue.  There is an Android 
version of the SLF4J library that you could try. (
http://www.slf4j.org/android/)  If the problem still occurs, you'll need to 
compile the Thrift jar from source.  I've found that Java 1.6 works the 
best for this when I've had to do this with other jars. 

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

2012-08-09 Thread Dominik
If you want to write your own custom tags, you have to buy them. But for 
playing memory, you can use any contact-less card or tag; I am sure you 
find some in your purse; this may be the access card from your company, a 
skiing ticket or something else. Simply touch all your cards with an NFC 
enabled device which has an NFC application on it, e.g. the NFC TagInfo 
App, and I am sure you will find some. 
Dominik

Am Mittwoch, 8. August 2012 16:27:27 UTC+2 schrieb bob:
>
> Do you have to order those tags online or can you get them somewhere like 
> Best Buy?
>
>
>
> On Wednesday, August 8, 2012 1:34:42 AM UTC-5, Dominik wrote:
>>
>> you cannot beam from device to device, but you can implement any 
>> application which uses the tag-reading mode of NFC. These apps are 
>> comparable with QR-Code based apps, but the application starts as soon as 
>> the tag is touched. You find examples in the play store. With the NFC Task 
>> Launcher you can store tasks on a tag (e.g. to set a WiFi connection, to 
>> set a timer, to mute the device etc) which are executed upon touching the 
>> tag. An application we have written is NFC Memory. Play memory with NFC 
>> tags and cards which you find in your purse.
>> Dominik
>>
>> Am Dienstag, 7. August 2012 20:33:28 UTC+2 schrieb bob:
>>>
>>> Have any of you all done anything with NFC?  Or is it pretty much too 
>>> new?
>>>
>>> I have a lot of devices, and only one of them seems to support NFC.
>>>
>>> (NfcAdapter.getDefaultAdapter(this) returns non-null)
>>>
>>> I guess there's not much I can do with just one NFC device?
>>>
>>

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

2012-08-09 Thread Vijay Krishnan
in my case i have 5 imageviews.I have to position one at the centre and the
remaining 4 imageview in circular order relative to the centre

On Tue, Aug 7, 2012 at 11:58 PM, Justin Anderson wrote:

> I have different image views and i want to position the other imageviews
>> relatively  with centre image view.And i have done it with using
>> FrameLayout.ImageViews look fine in Samsung S3,but in samsung galaxy Y the
>> last imageview added to the layout only appears on the screen.
>
>
> So, you are wanting to position ImageViews *relative* to each other, and
> your first thought was NOT to use a *Relative*Layout? I'm not sure I
> follow the logic train on that one...
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Tue, Aug 7, 2012 at 5:14 AM, Vijay Krishnan 
> wrote:
>
>> Hi all,
>> I have different image views and i want to position the other
>> imageviews relatively  with centre image view.And i have done it with using
>> FrameLayout.ImageViews look fine in Samsung S3,but in samsung galaxy Y the
>> last imageview added to the layout only appears on the screen.
>>
>> Thanks,
>> vijay.k
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, 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: Rotation Event Firing Omniture Tags

2012-08-09 Thread lbendlin
Handle the rotation events yourself - which obviously is quite tricky with 
a webview unless you don't care about reflowing.
 

On Wednesday, August 8, 2012 4:19:57 PM UTC-4, Chris Keune wrote:

> Hello Gurus, 
>
> Currently, I am experiencing my Omniture tracking to fire multiple times 
> on each screen rotation(ie additional PageViews). Is there anyway to 
> exclude the Omniture tags from firing on each rotation?
>
>
> 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] IllegalArgumentException Base64 to image decoding android

2012-08-09 Thread Иван Дунский


I want to decode an image from webservice which is in base64 to the bitmap 
and use it in my android app. This is my method:

public Bitmap getCaptcha() throws IOException
{ 

List params = new ArrayList();
String json = jsonParser.getCaptcha(captchaURL, params);
Log.i("", json);

 byte [] encodeByte=Base64.decode(json.getBytes(),Base64.DEFAULT);
 Bitmap bitmap=BitmapFactory.decodeByteArray(encodeByte, 0, 
encodeByte.length);
 return bitmap;

}

If I decode the string which I get from getCaptcha method with my php 
script - it displays correctly. But when I do this in my application, I get 
an

 FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity 
ComponentInfo{com.assignmentexpert/com.assignmentexpert.RegisterActivity}: 
java.lang.IllegalArgumentException: bad base-64
at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3687)
   at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.IllegalArgumentException: bad base-64
at android.util.Base64.decode(Base64.java:161)
at android.util.Base64.decode(Base64.java:136)
at com.library.UserFunctions.getCaptcha(UserFunctions.java:97)
at com.assignmentexpert.RegisterActivity.onCreate(RegisterActivity.java:66)
   at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
... 11 more

What's is reason of it?

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

[android-developers] Re: ReverseGeocoding NullPointerException

2012-08-09 Thread Ece Osmanağaoğlu
I added LocationListener, unfortunately still doesn't work.

locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
gpsProv = locMan.GPS_PROVIDER;
locMan.requestLocationUpdates(gpsProv, 0, 0, locList);

okullar.setOnItemClickListener(new OnItemClickListener() 
{
public void onItemClick(AdapterView arg0, View arg1, int arg2, 
long arg3) 
{
AlertDialog.Builder alert = new 
AlertDialog.Builder(Kampusler.this);
switch (arg2) 
{
case 0:
alert.setTitle("- Konumunuz 
-").setMessage(Lokasyonum()).setPositiveButton("Tamam", null).show();
break;

case 1:
alert.setTitle("- Konumunuz 
-").setMessage(Lokasyonum()).setPositiveButton("Tamam", null).show()
break;
default:
break;
}
}
});
}
private String Lokasyonum() 
{
loc = locMan.getLastKnownLocation(gpsProv);
if(loc != null)
MyLocation();
else
Toast.makeText(getApplicationContext(), "Can't Find...", 
Toast.LENGTH_SHORT).show();

return sonuc;
}

private String MyLocation() 
{
Geocoder myGeo = new Geocoder(Kampusler.this);
try
{
List adres = myGeo.getFromLocation(loc.getLatitude(), 
loc.getLongitude(), 1);
if(adres != null)
{
for(int i=0; i
> I wanna get current location.
> There is null pointer exception in List
>
> locMan = (LocationManager) 
> this.getSystemService(Context.LOCATION_SERVICE);
> gpsProv = LocationManager.GPS_PROVIDER;
> locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 
> 250, Kampusler.this);
> myGeo = new Geocoder(Kampusler.this, Locale.getDefault());
> 
> loc = locMan.getLastKnownLocation(gpsProv);
> try
> {
> List adres = myGeo.getFromLocation(loc.getLatitude(), 
> loc.getLongitude(), 1);
> if(adres != null) 
> {
> for(int i=0; i < 
> adres.get(0).getMaxAddressLineIndex(); i++)
> {  
> result += adres.get(0).getAddressLine(i) + "\n";
> }   
> }
> else
> {
> Toast.makeText(Kampusler.this, "Don't get address...", 
> Toast.LENGTH_LONG).show();
> }
> }
> catch (Exception e) 
> {
> e.printStackTrace();
> Toast.makeText(getApplicationContext(), e.getMessage(), 
> Toast.LENGTH_SHORT).show();
> }
>

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

[android-developers] Server/client using Wifi

2012-08-09 Thread Meena Rengarajan
How to send datas from one device to another in Wifi ? I mean, one device 
to another device communicating each other so i am using Socket programming 
. Can anyone help me in a code please ?

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

Re: [android-developers]

2012-08-09 Thread Mulsaniya Bhadresh
type cast it.

On Thu, Aug 9, 2012 at 4:34 PM, Sadhna Upadhyay
wrote:

> Hi everybody,
>  I am facing NumberFormate exception actully i have to work on calculation
> getting from EditText box how to resolve
>   help me
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers]

2012-08-09 Thread Sadhna Upadhyay
Hi everybody,
 I am facing NumberFormate exception actully i have to work on calculation
getting from EditText box how to resolve
  help me

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

[android-developers] Re: In app purchase issue

2012-08-09 Thread Bäcker
I've changed the app id bundle and now it seems to be working again. Can it 
be that it has some conflict in the market with another app.

On Tuesday, August 7, 2012 5:38:26 PM UTC+2, Bäcker wrote:
>
> Tried it all from 
> http://stackoverflow.com/questions/6524551/android-in-app-billing-item-unavailable/11845536#11845536
>
>
>- 
>
>in sign with public key
>- 
>
>the version of the Market application in the Device should be 2.3.4 or 
>higher
>- 
>
>the device you use for testing must run a standard version of the Android 
>1.6 or later
>- 
>
>the application being tested must be uploaded as draft, in the Android 
>market, and must be signed
>- 
>
>the application installed in the device must be the same as the one 
>that was uploaded as draft to the market
>- 
>
>the device must have a someth...@gmail.com account as its primary 
>account and this account should be defined as a test account in the 
> Android 
>market
>- 
>
>the products for in-app billing in the Android market must have the 
>same IDs as the ones displayed in the application
>- the in-app products in the Android market must be published
>
>
>
>- Wait for a couple of hours to make sure settings are migrated to 
>server.
>
>
> The problem is that in app purchases for test accounts has worked before. 
> Now they stopped working for new test users. If I'm using an old test 
> account that I've used before to buy they work.
>
> in the log I get strange message that I can't find any information about:
> E/Finsky  ( 1559): [1] CheckoutPurchase.setError: 
> type=IAB_PERMISSION_ERROR, code=4, message=null
>
> tags: in app purchase, test account, android, RESULT_ITEM_UNAVAILABLE
>
> full log:
>
> I/Unity   ( 1889): #Store: Unlock Freemium: True
>
> I/Unity   ( 1889): #Store: InitializeStore
>
> D/dalvikvm( 1889): GC_EXTERNAL_ALLOC freed 444K, 58% free 2833K/6727K, 
> external 2125K/2133K, paused 28ms
>
> I/Prime31 ( 1889): service onServiceConnected
>
> D/Finsky  ( 1559): [27] MarketBillingService.getPreferredAccount: 
> se.itatake.pebbles: Account from first account.
>
> I/Prime31-BS( 1889): CheckBillingSupported response code: RESULT_OK
>
> I/Prime31 ( 1889): billing service active? true
>
> I/Prime31 ( 1889): billing supported: true
>
> I/Unity   ( 1889): #Store: unlock billing support : True
>
> I/Unity   ( 1889): #Store: restore transactions
>
> D/Finsky  ( 1559): [7] MarketBillingService.getPreferredAccount: 
> se.itatake.pebbles: Account from first account.
>
> D/Finsky  ( 1559): [7] MarketBillingService.getPreferredAccount: 
> se.itatake.pebbles: Account from first account.
>
> I/ElegantRequestDirector( 1559): I/O exception 
> (org.apache.http.NoHttpResponseException) caught when processing request: 
> The target server failed to respond
>
> I/ElegantRequestDirector( 1559): Retrying request
>
> D/dalvikvm( 1559): GC_CONCURRENT freed 1244K, 54% free 3733K/8071K, 
> external K/2686K, paused 7ms+11ms
>
> I/Prime31-BS( 1889): handleCommand() action: 
> com.android.vending.billing.PURCHASE_STATE_CHANGED
>
> D/Finsky  ( 1559): [1] MarketBillingService.sendResponseCode: Sending 
> response RESULT_OK for request 6436554531222434304 to se.itatake.pebbles.
>
> I/Prime31 ( 1889): billing service active? true
>
> I/Prime31-BS( 1889): total verified purchases: 0
>
> I/Prime31-BS( 1889): handleCommand() action: 
> com.android.vending.billing.RESPONSE_CODE
>
> D/Prime31-BS( 1889): RestoreTransactions: RESULT_OK
>
> I/Prime31 ( 1889): billing service active? true
>
> D/Prime31 ( 1889): completed RestoreTransactions request
>
> D/DigitalClockWidget Receiver(  961): onReceive: 
> android.intent.action.TIME_TICK
>
> D/dalvikvm(  961): GC_EXTERNAL_ALLOC freed 11K, 52% free 2590K/5379K, 
> external 2425K/2428K, paused 49ms
>
> W/CursorWrapperInner(  961): Cursor finalized without prior close()
>
> I/Unity   ( 1889): #Store: restored billing completed
>
> I/Unity   ( 1889):Want to unlock id: unlock_game_android
>
> I/Unity   ( 1889):Has already unlocked in restore so skip?: False
>
> I/Unity   ( 1889):   unlock now: unlock_game_android
>
> D/Finsky  ( 1559): [27] MarketBillingService.getPreferredAccount: 
> se.itatake.pebbles: Account from first account.
>
> D/Finsky  ( 1559): [27] MarketBillingService.getPreferredAccount: 
> se.itatake.pebbles: Account from first account.
>
> I/ActivityManager(  202): Starting: Intent { 
> act=android.intent.action.VIEW 
> cmp=com.android.vending/com.google.android.finsky.activities.IabActivity 
> (has extras) } from pid -1
>
> W/ActivityManager(  202): Activity pause timeout for 
> HistoryRecord{2b435080 
> se.itatake.pebbles/com.unity3d.player.UnityPlayerNativeActivity}
>
> D/Finsky  ( 1559): [1] SelfUpdateScheduler.checkForSelfUpdate: Skipping 
> self-update. Local Version [8013015] >= Server Version [0]
>
> I/CustomizationProvider(  529): No configuration file: 
> /system/etc/

Re: [android-developers] How to make enableForegroundDispatch enabled to whole application, not only to an activity?

2012-08-09 Thread Winnie Zhang
Hi Nick,

What about on Android 4.0.3 onward? Do we still need set 
up NfcAdapter, PendingIntent and enableForegroundDispatch in every Activity?



在 2011年6月10日星期五UTC+8上午1时15分41秒,Nick Pelly写道:
>
> Hi Xiaoliang,
>
> We know this is a little annoying, we are thinking about some improvements 
> for future Android releases, so that you only need to enable foreground 
> dispatch for all activities in an application, and not for every activity.
>
> For now you have to enable it in every activity.
>
> Cheers,
> Nick
>
> On Mon, Jun 6, 2011 at 6:43 PM, Xiaoliang Ding 
> > wrote:
>
>> Hi, Dianne Hackborn
>>
>> Thanks a lot.
>>
>> Ding
>>
>> 2011/6/5 Dianne Hackborn >
>>
>>> Yes do it in every activity.
>>>
>>>
>>> On Fri, Jun 3, 2011 at 2:02 AM, Xiaoliang Ding 
>>> 
>>> > wrote:
>>>
 Hi, Dianne Hackborn

 You mean I need call NfcAdapter.enableForegroundDispatch in every 
 activity of my app, right?

 Thanks
 Ding

 2011/6/3 Dianne Hackborn >

> You very intentionally can't.  This is for you to handle the events 
> when your UI is actually in the foreground with the user, not to steal 
> them 
> all the time you happen to be running.  If you want to do this in 
> multiple 
> activities, you can organize your code to share that common 
> implementation 
> between them but each must enable dispatching while it is in the 
> foreground.
>
> On Fri, Jun 3, 2011 at 12:22 AM, Xiaoliang Ding 
> 
> > wrote:
>
>> hi, I am writing a NFC application. I use the 
>> NfcAdapter.enableForegroundDispatch in an activity to make sure a NFC 
>> tag 
>> detected event routing to this activity direct, not show other 
>> applications 
>> which has capability to resolve this event. My question is when my 
>> application is running, how to make sure the tag detected event routing 
>> this activity direct even though this activity is inactive, because the 
>> application has three activities.
>>
>>
>> Thanks
>> Ding
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> android-d...@googlegroups.com
>> To unsubscribe from this group, 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
> hac...@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-d...@googlegroups.com
> To unsubscribe from this group, 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-d...@googlegroups.com
 To unsubscribe from this group, 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
>>> hac...@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-d...@googlegroups.com
>>> To unsubscribe from this group, 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-d...@googlegroups.com
>> To unsubscribe from this group, 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.

Re: [android-developers] Non sticky service gets recreated (indefinetly?)

2012-08-09 Thread Johan Appelgren
Ok, thanks. But shouldn't it (non-sticky service with no active 
connections, nothing is bound to it) show up in the Running Services view 
when it has been restarted? Or is that only for sticky services?

On Thursday, August 9, 2012 8:35:50 AM UTC+2, Dianne Hackborn wrote:
>
> Binding and starting are completely orthogonal things.  You bind to a 
> service to establish a persistent connection to it.  You start a service to 
> have it run for some undefined amount of time separately from the caller. 
>  A service needs to remain created as long as it is being asked to do 
> either of these things.
>
> If you don't want it to stay created, either don't bind to it when you 
> don't want it around, or don't use BIND_AUTO_CREATE so you aren't forcing 
> it to remain created while bound to it.
>
> On Wed, Aug 8, 2012 at 10:46 PM, Johan Appelgren 
> 
> > wrote:
>
>> So START_NOT_STICKY has no effect once I've bound to it even if I unbind? 
>> I must explicitly use stopService if the service has ever been bound to 
>> even if there are no more connection? 
>>
>>
>> On Thursday, August 9, 2012 2:54:41 AM UTC+2, Dianne Hackborn wrote:
>>
>>> If you bind to it with BIND_AUTO_CREATE, you are saying you want the 
>>> service to be created as long as you are bound to it.
>>>
>>> From the documentation:
>>>
>>> A service can be both started and have connections bound to it. In such 
>>> a case, the system will keep the service running as long as either it is 
>>> started or there are one or more connections to it with the 
>>> Context.BIND_AUTO_CREATE flag.
>>>
>>> http://developer.android.com/**reference/android/app/Service.**html
>>>
>>> On Wed, Aug 8, 2012 at 1:52 PM, Johan Appelgren wrote:
>>>
 If I have a simple service that returns START_NOT_STICKY in 
 onStartCommand and I both start it explicitly (startService) and bind to 
 it 
 (bindService) in onCreate of my activity the service gets recreated after 
 it has been killed over and over again. I unbind the service in onPause of 
 my activity. 

 Logcat shows that the service is scheduled for restart and is restarted 
 over and over again. The service is not shown as running after it's been 
 recreated in Settings -> Apps -> Running. 

 08-08 21:57:25.081 D/ExampleActivity(23715): onPause
 08-08 22:11:44.480 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000 ms
  08-08 22:11:49.519 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**
 MainService
 08-08 22:11:49.597 D/ExampleService(24079): onCreate
 08-08 22:27:38.551 I/ActivityManager(  306): No longer want 
 com.example.service (pid 24079): hidden #16
 08-08 22:27:38.574 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000ms
 08-08 22:27:43.629 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**MainService: 
 pid=24401 uid=10101 gids={1028}
 08-08 22:27:43.785 D/ExampleService(24401): onCreate
 08-08 22:49:59.871 I/ActivityManager(  306): Process 
 com.example.service (pid 24401) has died.
 08-08 22:49:59.871 W/ActivityManager(  306): Scheduling restart of 
 crashed service com.example.service/.**MainService in 5000ms
 08-08 22:50:04.934 I/ActivityManager(  306): Start proc 
 com.example.strangeservice for service com.example.service/.**MainService: 
 pid=24857 uid=10101 gids={1028}
 08-08 22:50:05.051 D/ExampleService(24857): onCreate

 I thought START_NOT_STICKY meant that once it gets killed by Android it 
 wont be restarted unless I explicitly start it again. Or does binding to a 
 service override that and make the service sticky?

 I've been testing this on a Galaxy Nexus with stock Android 4.1.1.

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

 To unsubscribe from this group, 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
>>> hac...@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] Re: Status Bar Notification sometimes disappears with Android 4?

2012-08-09 Thread Pent
> According to the link you provided, this seems to be an issue with early
> Android 4 versions. Hopefully, it will be fixed in Jelly Beans. Seems we
> have to live with it until then.

Seems OK on a Nexus S / 4.1.1.

Pent

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

2012-08-09 Thread 王志鹏
Dear everyone,


In our application, we have a listview, and the height of each item can
change.

My question is, is it possible to make the last visible item on screen
completely visible?

Best wishes,

Zhipeng Wang

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Browser App Not sending HTTP request

2012-08-09 Thread RichardC
The only way to keep a device from sleeping (going into a low power state) 
is end-user activity or holding a wake-lock.  I don't know if you can hold 
a wake-lock from a browser application you will need to Google it.

On Thursday, August 9, 2012 10:03:08 AM UTC+1, tropicaljava wrote:
>
> No one has experienced some thing like below??
>
> On Wednesday, August 8, 2012 8:39:24 PM UTC+5:30, tropicaljava wrote:
>>
>> We have developed a android browser application (javascript) which keeps 
>> (every 3Sec) on sending a http (GET) request to my REST server (hosted on 
>> TOMCAT).
>>
>> Everything works fine till the time phone is in operation. But as soon as 
>> phone is lying idle, the browser application's javascript stops sending the 
>> HTTP requests.
>>
>> The phone is connected with our test WIFI router, and in the phone 
>> setting we have kept WIFI connected even if phone goes in the idle state.
>>
>> We are capturing HTTP packets with wireshark on the REST server machine. 
>> Till the time phone is in working state, we recieve HTTP request packet but 
>> as soon we leave the phone (and it goes to idle state) idle, HTTP packets 
>> stops appearing on the Wireshark (however some TCP packets are visible).
>>
>> The same behavior is there on IPhone device as well, Is it the default 
>> behavior of SmartPhone browsers?
>>
>> Please help if someone have faced this kind of situation or have similar 
>> experience.
>>
>> PS. on android, the browser we are using is the default browser and 
>> android version is 4.0.3
>>
>>
>>

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

[android-developers] Add padding in Menu Bar

2012-08-09 Thread akash
Hi,

Can anybody help me in figuring how to add padding in menu bar. I am having 
4 buttons in my menu bar, and i don't want to give space between them. 

Thank you


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

[android-developers] Transparent Action and Menu Bar

2012-08-09 Thread akash
Hi,

I am trying to make semi transparent action and menu bar both. Can anybody 
give me helpful info.

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] Error at setting up a larger library project Android

2012-08-09 Thread Xtreme
Have tried it but could not solve it

Share the code if anyone wants to be nice and look at it.

Here are two projects https://dl.dropbox.com/u/36779/library_project.zip

Puzzle is an open source project I tried to get to work as a library and 
can be downloaded here: 
http://code.google.com/p/androidsoft.../trunk/puzzle/

The project "Navigation" has a class with one button. The puzzle project 
will open when you click on it.




Den onsdagen den 8:e augusti 2012 kl. 17:17:14 UTC+2 skrev Kostya Vasilyev:
>
> You've got a crash:
>
> 08-08 12:44:31.607: E/AndroidRuntime(780): Caused by: 
> java.lang.NullPointerException
> 08-08 12:44:31.607: E/AndroidRuntime(780): at org.androidsoft.games.puzzle.
> kids.AbstractMainActivity.onCreate(AbstractMainActivity.java:81)
>
> Set a breakpoint in AbstractMainActivity onCreate, figure out what is 
> null, and fix it.
>
> -- K
>
>
> Want to start a standalone android project with a button in another 
>> project. First made a simple main app with a button that was referring to 
>> another project with Hello World with "is Library in Preferences". All 
>> according 
>> http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProjectand
>>  it worked without problems.
>>
>> Did the same thing with an open soruce project (puzzle) 
>> http://code.google.com/p/androidsoft/source/browse/#svn%2Ftrunk%2Fpuzzlebut 
>> get an error message in LogCat and my appa crashes when I click the 
>> button in my main app.
>>
>> Guess I may have missed something in AndroidManifest.xml According to the 
>> documentation it says
>>
>> Declaring library components in the manifest file: You must declare any 
>> , , , , and so on, as well as 
>> , .
>>
>> I can compile puzzle as their own project without any problems. If the 
>> puzzle is a library will not work.
>>
>>
>> My main app with a button that will start the second project
>>
>> public class AppActivity extends Activity {
>>
>> Button button;
>>
>> @Override
>> public void onCreate(Bundle savedInstanceState) {
>> super.onCreate(savedInstanceState);
>> setContentView(R.layout.main);
>> addListenerOnButton();
>> }
>>
>> public void addListenerOnButton() {
>>
>> final Context context = this;
>>
>> button = (Button) findViewById(R.id.button1);
>>
>> button.setOnClickListener(new OnClickListener() {
>>
>> @Override
>> public void onClick(View arg0) {
>>
>> Intent intent = new Intent(context, 
>> org.androidsoft.games.puzzle.kids.MainActivity.class);
>> startActivity(intent); 
>>
>> }
>>
>> });
>>
>> }
>>
>> }
>>
>> AndroidManifest.xml in my main app with 
>> android:name="org.androidsoft.games.puzzle.kids.MainActivity
>>
>> 
>> http://schemas.android.com/apk/res/android";
>> package="com.mkyong.android"
>> android:versionCode="1"
>> android:versionName="1.0" >
>>
>> 
>>
>> > android:icon="@drawable/ic_launcher"
>> android:label="@string/app_name" >
>> > android:label="@string/app_name"
>> android:name=".AppActivity" >
>> 
>> 
>> 
>> 
>> 
>> > android:name="org.androidsoft.games.puzzle.kids.MainActivity">
>> 
>> 
>>
>> 
>>
>>
>> AndroidManifest.xml in puzzle that I want to use as a library 
>> http://code.google.com/p/androidsoft/source/browse/trunk/puzzle/AndroidManifest.xml
>>
>> LogCat error
>>
>>
>> 08-08 12:44:31.607: E/AndroidRuntime(780): FATAL EXCEPTION: main
>> 08-08 12:44:31.607: E/AndroidRuntime(780): java.lang.RuntimeException: 
>> Unable to start activity 
>> ComponentInfo{com.mkyong.android/org.androidsoft.games.puzzle.kids.MainActivity}:
>>  
>> java.lang.NullPointerException
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.app.ActivityThread.access$600(ActivityThread.java:130)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.os.Handler.dispatchMessage(Handler.java:99)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.os.Looper.loop(Looper.java:137)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> android.app.ActivityThread.main(ActivityThread.java:4745)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> java.lang.reflect.Method.invokeNative(Native Method)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> java.lang.reflect.Method.invoke(Method.java:511)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): at 
>> dalvik.system.NativeStart.main(Native Method)
>> 08-08 12:44:31.607: E/AndroidRuntime(780): Caused by: 
>> java.lang.NullPointerException
>> 08-08

[android-developers] Re: Browser App Not sending HTTP request

2012-08-09 Thread tropicaljava
No one has experienced some thing like below??

On Wednesday, August 8, 2012 8:39:24 PM UTC+5:30, tropicaljava wrote:
>
> We have developed a android browser application (javascript) which keeps 
> (every 3Sec) on sending a http (GET) request to my REST server (hosted on 
> TOMCAT).
>
> Everything works fine till the time phone is in operation. But as soon as 
> phone is lying idle, the browser application's javascript stops sending the 
> HTTP requests.
>
> The phone is connected with our test WIFI router, and in the phone setting 
> we have kept WIFI connected even if phone goes in the idle state.
>
> We are capturing HTTP packets with wireshark on the REST server machine. 
> Till the time phone is in working state, we recieve HTTP request packet but 
> as soon we leave the phone (and it goes to idle state) idle, HTTP packets 
> stops appearing on the Wireshark (however some TCP packets are visible).
>
> The same behavior is there on IPhone device as well, Is it the default 
> behavior of SmartPhone browsers?
>
> Please help if someone have faced this kind of situation or have similar 
> experience.
>
> PS. on android, the browser we are using is the default browser and 
> android version is 4.0.3
>
>
>

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

[android-developers] GCM & RTL Language

2012-08-09 Thread Yuval Shkolar
Hello!

I'm trying to send GCM message from C# to my android phone.
Unfourtenly, the hebrew message is not catched on my broadcast reciver - 
but if I send english message it's catched as expected.

The send code:

private static string SendNotification(string id, string msg, 
string key)
{
try
{
ServicePointManager.ServerCertificateValidationCallback = 
(object sender, X509Certificate certificate, X509Chain chain, 
SslPolicyErrors sslPolicyErrors) => true;
WebRequest request = 
WebRequest.Create("https://android.googleapis.com/gcm/send";);
request.Method = "POST";
// request.ContentType = 
"application/x-www-form-urlencoded;charset=UTF-8";
request.ContentType = "application/x-www-form-urlencoded";

request.Headers.Add(string.Format("Authorization: 
key={0}",  key));
string collaspeKey = Guid.NewGuid().ToString("n");
string postData = 
string.Format("registration_id={0}&data.message={1}&collapse_key={2}", id, 
msg, collaspeKey);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();

return responseFromServer;
}
catch (Exception ex)
{
throw ex;
}
}

Please help me!
Yuval

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

[android-developers] Google Analytics Page Title setup

2012-08-09 Thread Dmitriy F


All that tracker.trackPageView(trackable.getSceneTitle()); does now is 
filling the first "Active page" column but I would better get use of both 
of those. Is it possible to set Page Title with GA framework ?

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: Status Bar Notification sometimes disappears with Android 4?

2012-08-09 Thread Terry
Thank you, Kostya, for a quick and very good answer.
Yes, that is exactly what I am doing.
According to the link you provided, this seems to be an issue with early 
Android 4 versions. Hopefully, it will be fixed in Jelly Beans. Seems we 
have to live with it until then.
 
Terry
 

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

[android-developers] Re: How to make activate from sms ?

2012-08-09 Thread ono
Ok, i could finally understand ' SMS broadcast receiver' as you said.
Thank you.


2012年7月26日木曜日 19時00分42秒 UTC+9 ono:
>
> Hi,
>
> I am searching a sample code what make activate android app by SMS.
> Could anyone show one to me?
> Java native code is good, but HTML5/JS is better. 
> I mean like act 'Prey Anti-Theft(http://preyproject.com/)'.
>
> Any advice thanks.
>
> Ono
>

2012年7月26日木曜日 19時00分42秒 UTC+9 ono:
>
> Hi,
>
> I am searching a sample code what make activate android app by SMS.
> Could anyone show one to me?
> Java native code is good, but HTML5/JS is better. 
> I mean like act 'Prey Anti-Theft(http://preyproject.com/)'.
>
> Any advice thanks.
>
> Ono
>

2012年7月26日木曜日 19時00分42秒 UTC+9 ono:
>
> Hi,
>
> I am searching a sample code what make activate android app by SMS.
> Could anyone show one to me?
> Java native code is good, but HTML5/JS is better. 
> I mean like act 'Prey Anti-Theft(http://preyproject.com/)'.
>
> Any advice thanks.
>
> Ono
>

2012年7月26日木曜日 19時00分42秒 UTC+9 ono:
>
> Hi,
>
> I am searching a sample code what make activate android app by SMS.
> Could anyone show one to me?
> Java native code is good, but HTML5/JS is better. 
> I mean like act 'Prey Anti-Theft(http://preyproject.com/)'.
>
> Any advice thanks.
>
> Ono
>

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

2012-08-09 Thread TreKing
On Thu, Aug 9, 2012 at 3:00 AM, Tarek Khalaf wrote:

> how can i start my app dipending on time or date
>

Look at AlarmManager.

-
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] Customization of native android components in Titanium appcelerotor

2012-08-09 Thread Bhanushali Ashwin N


Hi All,

I am experienced android developer but newbie in Tiatanium appcelerator. I 
want to develop an android app using Titanium Appcelerator. My questions 
are as follows.

   1. Can we customize the native android components(like 
   RelativeLayout,Button,etc..) ? for example I want to develop some custom 
   view like pull-to-refreshlistview by extending ListView class or I want my 
   own custom ImageView by extending the ImageView class is it possible with 
   appcelerator platform?
   2. Can I create a my own mediaplayer/videoplayer using appcelerator 
   platform?

If I can leverage the native android components like views by extending 
them.Then any demo/sample will be highly appreciated.

*NOTE :: I am using Titanium Studio IDE to develop my android apps.*

Thanks..

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

[android-developers] Re: How to use apache thrift with android????

2012-08-09 Thread adroidanky
thanks for help  Guilherme,

Actually m using the libthrift.jar,log4j.jar,slf4j-api.jar in my project..
when I run my java client with these libraries it works fine but not in 
android...
can u please give me some tutorials how to use android with apache thrift 
or sample application i really need it...
plz help me

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

Re: [android-developers] Status Bar Notification sometimes disappears with Android 4?

2012-08-09 Thread Kostya Vasilyev
If you change state of any component in your app with PackageManager (not
necessarily the service itself), you might be running into this:

http://code.google.com/p/android/issues/detail?id=21635

-- K

2012/8/9 Terry 

> I have an app with a foreground Service, which shows a Status Bar
> Notification. It is working working properly with Android 2 and 3, but now
> I see that on some devices with Android 4, the Notification sometimes
> disappears a while after the Service is started. When the Service is
> restarted, the Notification reappears again. Even if the Notification has
> been removed from the Status Bar, the Service itself seems to continue
> working properly. This seems to happen on some new HTC and Galaxy devices,
> but I have not seen it happen on a Sony Ericsson Xperia Arc which has been
> upgraded to Android 4.04. The Status Bar Notification was created with
> FLAG_NO_CLEAR and FLAG_ONGOING_EVENT. Is this a known issue? Are there any
> work-arounds? Anybody?
>
> Terry
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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]

2012-08-09 Thread Tarek Khalaf
 i'm begenner in android coding

if u can help me

how can i start my app dipending on time or date

i mean if the date = some thing

or time = some thing

start my app

thank you

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

[android-developers] How to dynamically change row layout of list view on click event

2012-08-09 Thread Jovish P
We are using list view in our app with one simple row layout.
But on click of list view we want to change the row layout of
tht particular item . is it possible to do ? wht is the best approach ?
Ho to add listeners to view inside the row layout?

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

[android-developers] Status Bar Notification sometimes disappears with Android 4?

2012-08-09 Thread Terry
I have an app with a foreground Service, which shows a Status Bar 
Notification. It is working working properly with Android 2 and 3, but now 
I see that on some devices with Android 4, the Notification sometimes 
disappears a while after the Service is started. When the Service is 
restarted, the Notification reappears again. Even if the Notification has 
been removed from the Status Bar, the Service itself seems to continue 
working properly. This seems to happen on some new HTC and Galaxy devices, 
but I have not seen it happen on a Sony Ericsson Xperia Arc which has been 
upgraded to Android 4.04. The Status Bar Notification was created with 
FLAG_NO_CLEAR and FLAG_ONGOING_EVENT. Is this a known issue? Are there any 
work-arounds? Anybody?
 
Terry
 

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

[android-developers] Re: File printer for multiple sensor data

2012-08-09 Thread Roman

>
> I had test code inside code sample. The cleaning Service is:


public class SensorPrinterService extends Service implements 
SensorEventListener {


private Controller controller = null;

 private final IBinder binder = new SensorPrinterBinder();

 private SensorPrinter [] printers = {

new SensorPrinter(Sensor.TYPE_ACCELEROMETER), 

new SensorPrinter(Sensor.TYPE_GYROSCOPE), 

new SensorPrinter(Sensor.TYPE_MAGNETIC_FIELD), 

new SensorPrinter(Sensor.TYPE_ORIENTATION), 

new SensorPrinter(Sensor.TYPE_LIGHT), 

new SensorPrinter(Sensor.TYPE_PROXIMITY)

};

 private SensorDetection [] sensors = new SensorDetection[ printers.length 
];

 public IBinder onBind(Intent intent) {

return binder;

// return the binder(myService reference) when service

// connected using Service Connection

}


// Instance of the Service is now in SensorPrinterBinder

public class SensorPrinterBinder extends Binder {

SensorPrinterService getService() {

return SensorPrinterService.this;

}

}

 public void onCreate() {

super.onCreate();

controller = Controller.getInstance();

controller.init( this.getApplicationContext() );

 Log.i(this.getClass().getSimpleName(), "Creating"); 

 for(int i = 0; i < printers.length; i++) {

 try {

if ( printers[i].open() ) {

sensors[i] = new SensorDetection(this.getApplicationContext(), 

printers[i].getSensorType(), SensorManager.SENSOR_DELAY_GAME, this);

 sensors[i].start();

}

else { 

if( printers[i].EXTERNAL_STORAGE_AVAILABLE == false ) {

Log.e(this.getClass().getSimpleName(), printers[i].getSensorName() 

+ " - EXTERNAL_STORAGE_AVAILABLE_ERROR");

showNotification( this.getString( R.string.EXTERNAL_STORAGE_AVAILABLE_ERROR 
) );

}

else {

Log.e(this.getClass().getSimpleName(), printers[i].getSensorName() 

+ " - EXTERNAL_STORAGE_WRITEABLE_ERROR");

showNotification( this.getString( R.string.EXTERNAL_STORAGE_WRITEABLE_ERROR 
) );

} 

}

} catch (FileNotFoundException e) {

Log.e(this.getClass().getSimpleName(), e.toString());

showNotification( e.toString() );

}

 }

 }

 public void onDestroy() {

 Log.i(this.getClass().getSimpleName(), "Destroying");

 for(int i = 0; i < printers.length; i++) {

sensors[i].stop();

printers[i].close( true ); 

}

 

super.onDestroy(); 

 }

 private void showNotification(String text) {

 NotificationManager notificationManager = (NotificationManager) 

getSystemService(NOTIFICATION_SERVICE);

Notification notification = new Notification(R.drawable.warning, 

this.getString( R.string.service_error_titleonbar ), 

System.currentTimeMillis());

notification.flags = Notification.FLAG_AUTO_CANCEL;

PendingIntent contentIntent = PendingIntent.

getActivity(this, 0, new Intent(this, Runner.class), 0);


notification.setLatestEventInfo(this.getApplicationContext(), 

this.getString( R.string.service_error_title ), 

text, contentIntent);


int SERVER_DATA_RECEIVED = 1;

notificationManager.notify(SERVER_DATA_RECEIVED, notification);

 }


public void onAccuracyChanged(Sensor sensor, int accuracy) {

// TODO Auto-generated method stub

 }


public void onSensorChanged(SensorEvent event) {

 switch( event.sensor.getType() ) {

case Sensor.TYPE_ACCELEROMETER:

 Log.i(this.getClass().getSimpleName(), "TYPE_ACCELEROMETER: " 

+ event.toString());

 synchronized( this ) {

printers[0].onSensorChanged(event);

}

 break;

case Sensor.TYPE_GYROSCOPE:


Log.i(this.getClass().getSimpleName(), "TYPE_GYROSCOPE: " 

+ event.toString());

 synchronized( this ) {

printers[1].onSensorChanged(event);

}

 break;

case Sensor.TYPE_MAGNETIC_FIELD:


Log.i(this.getClass().getSimpleName(), "TYPE_MAGNETIC_FIELD: " 

+ event.toString());

 synchronized( this ) {

printers[2].onSensorChanged(event);

}

 break;

case Sensor.TYPE_ORIENTATION:


Log.i(this.getClass().getSimpleName(), "TYPE_ORIENTATION: " 

+ event.toString());

 synchronized( this ) {

printers[3].onSensorChanged(event);

}

 break;

case Sensor.TYPE_LIGHT:

 Log.i(this.getClass().getSimpleName(), "TYPE_LIGHT: " 

+ event.toString());

 synchronized( this ) {

printers[4].onSensorChanged(event);

}

 break;

case Sensor.TYPE_PROXIMITY:


Log.i(this.getClass().getSimpleName(), "TYPE_PROXIMITY: " 

+ event.toString());

 synchronized( this ) {

printers[5].onSensorChanged(event);

}

 break;

default:

break; 

}

 }

} 

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