[android-developers] Re: in-app biliing purchase flow with promo code return empty payload, why?

2016-03-02 Thread Henrik Lindqvist
I've tried to get an answer to the same problem:
http://stackoverflow.com/questions/35381104/promo-codes-breaks-remote-server-verification


On Wednesday, February 10, 2016 at 9:39:04 PM UTC+1, Frédéric Ravetier 
wrote:
>
> Hi, 
>
> I code in ap billing in my application. Everything works fine except when 
> I use a promo code in the app. Google returns an empty payload, even if I 
> send an ID. Then when I chick if the ID is equal to payload I reject the 
> transaction.
>
> Why ? 
>
> Thank you for your help!
>
> Regards,
> Fred
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/bcf6336a-9060-4b18-b755-45e88f03875a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Android 4.4 WebView cannot load "content://" urls in html page

2014-02-19 Thread Henrik Lindqvist
This is a app breaking change. Android's content sharing is built around 
content:// uri's, this make that impossible.

Every one please star:

https://code.google.com/p/android/issues/detail?id=63033



On Friday, January 10, 2014 8:30:05 PM UTC+1, ankur wrote:
>
> We found some behavior changes on Kitkat's new Chromium webview 
> implementation.  One issue we encountered was the "content://" urls in a 
> downloaded html page are no longer getting loaded via the content provider. I 
> was able to put together a small Android app to demonstrate this behavior 
> change (https://github.com/lhwa/KitkatWebviewTest). When the page contains an 
> image src url in "content://" scheme, the image cannot be loaded on Kitkat 
> and we get the following errors in logcat: 
>
> INFO/chromium(6759): [INFO:CONSOLE(9)] "Not allowed to load local resource: 
> content://com.testing.image/kitkat.png", source: 
> https://googledrive.com/host/0B6yymhTJtX7ZRVdoRjNuWDA5NGc/example.html (9)
>
> The image can be loaded correctly in webview on Android 4.3 and priori 
> versions. I was not able to find any websettings to work around this on 
> Kitkat.  Can anyone help address this behavior change on Kitkat? Or share 
> some insights on the given error and suggest any workaround? 
>
>
> Thanks and regards,
>
> Ankur.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Developer console (store page) analytics

2013-09-28 Thread Henrik Lindqvist
In the Google I/O 2013 video presenting coming features for the Developer 
Console, Riccardo Govoni talks about Analytics for Google Play Store page 
view etc.:

https://www.youtube.com/watch?feature=player_detailpage&v=SDaf7f9yl6E#t=1259

When will this feature be launched?

Do my app have to include the Google Analytics SDK?


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Google Play Store hidden ratings

2013-03-27 Thread Henrik Lindqvist
My app only got 3 written review and 2 ratings. Why can't i see who gave 
the rating only, i see who made the written review!?

Wasn't the whole point of forcing users to user Google+ to make anonymous 
reviews/ratings impossible!

Does the pre-Google+ ratings score for as much as the post-Google+ ratings 
when calculating the app listing position? 
If it does, it very unfair to new apps since nowdays rating/review seems to 
rarely be made.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Shape drawing - issue with corners

2011-01-25 Thread Henrik Lindqvist
The docs say you should do the following if you only want some corners
rounded:



Never got that it work tho.


On Jan 25, 2:30 pm, Kostya Vasilyev  wrote:
> Lior,
>
> Apparently, something like this works a little better:
>
>  android:topLeftRadius="15dp"
> android:topRightRadius="15dp"
> android:bottomRightRadius="0.1dp"
> android:bottomLeftRadius="0.1dp" />
>
> -- Kostya
>
> 25.01.2011 15:58, Smiley пишет:
>
>
>
> > Hi,
> > I am following the instruction here:
> >http://developer.android.com/guide/topics/resources/drawable-resource...
>
> > and I am trying to draw a rectangle with only 2 rounded corners.
>
> > Here is my xml
>
> > 
> > http://schemas.android.com/apk/res/android";>
>
> >     >             android:bottomLeftRadius="0dp" />
> >     >            android:endColor="#edb18c" android:centerColor="#ea6814" />
> > 
>
> > I tried many variations, with or without the android:radius attribute
> > but no luck.
> > Any suggestions?
> > Thanks,
> > Lior
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

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


[android-developers] startActivity(ForResult) at Activity start (on/Create/Start/Resume) not working

2011-01-18 Thread Henrik Lindqvist
I'am trying to start a child Activity with startActivity(ForResult)
when the main Activity starts. It doesn't work. If the child Activity
used Theme.Dialog it doesn't show up at all. With a normal Theme it's
displayed, but when I close the top child activity, a RuntimeException
is thrown:

ActivityThread.performResumeActivity(IBinder, boolean) line: 2851
ActivityThread.handleResumeActivity(IBinder, boolean, boolean) line:
2866
BinderProxy(ActivityThread$H).handleMessage(Message) line: 1819
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4203
Method.invokeNative(Object, Object[], Class, Class[], Class, int,
boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 791
ZygoteInit.main(String[]) line: 549
NativeStart.main(String[]) line: not available [native method]

There is no problem calling startActivity(ForResult) on a click or
menu selection. Should I use any intent flags?

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

2011-01-17 Thread Henrik Lindqvist
This is how I calculate the AppWidget size:

  protected Point getAppWidgetPixelSize (AppWidgetProviderInfo
appWidgetInfo, Point point) {
int cx = (appWidgetInfo.minWidth  + 2) / 74;
int cy = (appWidgetInfo.minHeight + 2) / 74;
float density = getResources().getDisplayMetrics().density;
switch (getResources().getConfiguration().orientation) {
  case Configuration.ORIENTATION_PORTRAIT:
point.x = (int)( 80 * cx * density + .5f);
point.y = (int)(100 * cy * density + .5f);
return point;
  case Configuration.ORIENTATION_LANDSCAPE:
point.x = (int)(106 * cx * density + .5f);
point.y = (int)( 74 * cy * density +.5f);
return point;
  //case Configuration.ORIENTATION_SQUARE:
  //case Configuration.ORIENTATION_UNDEFINED:
  default:
throw new IllegalStateException("orientation");
}
  }



On Jan 17, 5:54 pm, Cleverson  wrote:
> Hi,
>
> I'm trying to understand how the home screen calculates how many cells
> will be assigned to a given widget. I came across the following
> sentence in the Android Developer Site:
>
> "Because the Home screen's layout orientation (and thus, the cell
> sizes) can change, as a rule of thumb, you should assume the worst-
> case cell size of 74 pixels for the height and width of a cell.
> However, you must subtract 2 from the final dimension to account for
> any integer rounding errors that occur in the pixel count. To find
> your minimum width and height in density-independent pixels (dp), use
> this formula:
> (number of cells * 74) - 2
> Following this formula, you should use 72 dp for a height of one cell,
> 294 dp and for a width of four cells."
>
> What if I have a mdpi (160dpi) device whose resolution is 480x800?
>
> In a mdpi device, each 1 dip stands for 1 pixel. So, if my widget is
> 72dip x 294dip, it would take 72px x 294px in the mdpi device.
> As far as I cound understand, in the example above, the widget would
> not take 4 cells in this device. The device is 480 pixels wide and 294
> pixels would be covered by 3 cells.
>
> Who's wrong here? The formula or my interpretation?
>
> Thanks in advance!

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


[android-developers] Re: When NOT to update AppWidget from a Service

2011-01-17 Thread Henrik Lindqvist

On Jan 17, 4:17 pm, Kostya Vasilyev  wrote:
> Henrik,
>
> SCREEN_OFF is usually followed by the device entering sleep mode, so that
> issue pretty much takes care of itself.

I stop updating on SCREEN_OFF, the start again on SCREEN_ON. This
saves alot, but I was wondering if I can do more.

>
> Checking for the current virtual home screen, and currently active home app
> among several possibly installed doesn't really fit the widget programming
> model - it's more a push rather than pull (as it is with regular views, that
> are drawn on demand). I hope that home screen apps have some smarts for that
> (and maybe they really do).

The AppWidget model is very basic, that's why I'am asking on how to
work around the limitations.

>
> I found it very useful to implement checks for "stale" widget ids in my
> apps, so my code doesn't waste time updating 5-10-88 (yes, I've seen that
> number) widgets when there is only one on the screen.
>
> http://kmansoft.wordpress.com/2010/06/22/per-widget-options-stale-wid...

Thanks for the tip. I'am already doing this.

>
> Some causes of this are fixed in 2.2, but I'm keeping that code just in
> case.
>
> -- Kostya
>
> 2011/1/17 Henrik Lindqvist 
>
> > My AppWidgets are updated by a Service at user-defined intervals or
> > when certain intents occur. To save battery, I only update the
> > AppWidgets when the screen is on (SCREEN_ON).
>
> > Is there any other way to stop updating AppWidgets unnecessarily?
>
> > Only when the home screen is visible?
> > Only when a specific AppWidget is on screen?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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


[android-developers] When NOT to update AppWidget from a Service

2011-01-17 Thread Henrik Lindqvist
My AppWidgets are updated by a Service at user-defined intervals or
when certain intents occur. To save battery, I only update the
AppWidgets when the screen is on (SCREEN_ON).

Is there any other way to stop updating AppWidgets unnecessarily?

Only when the home screen is visible?
Only when a specific AppWidget is on screen?

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
Wow, thanks. Your suggestion with a larger FrameLayout fixed it!

...LinearLayout etc...

  

...LinearLayout etc...

You said a child view couldn't be larger than it's parent/container!?
Now the FrameLayout is forcefully wider than it's parents and the
whole app-widget.

Now, if I only could get the clipped edge faded for a nice "ellipsize"
effect. :)


On Jan 16, 7:38 pm, Mark Murphy  wrote:
> On Sun, Jan 16, 2011 at 11:48 AM, Henrik Lindqvist
>
>  wrote:
> >> Of course. That's a rule for any container/child relationship in Android.
>
> > If a child view can't be larger than it's parent, how does a
> > ScrollView work?
>
> The visible bounds of the child are still not bigger than the visible
> bounds of the parent.
>
> >> > Any trick to make a ImageView larger than it's parent FrameLayout?
>
> >> Move it outside of the FrameLayout into some larger container. Or,
> >> expand the FrameLayout.
>
> > I can't, it's an AppWidget.
>
> Inflate a different layout for the app widget, one where the ImageView
> is moved outside the FrameLayout into a larger container, or expand
> the FrameLayout.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist

On Jan 16, 5:19 pm, Kostya Vasilyev  wrote:
> I think it should work to put it inside a frame layout with exact values for
> width/height (specifying maximum image size before cropping occurs). Then on
> the image view, specify layout_gravity=right, and width/height as
> wrap_content.
>

layout_gravity=right, and width/height as wrap_content is what I do
now. Almost works.

Setting width/height on the FrameLayout is a problem. It's an
AppWidget so I don't really know the size. How does this affect the
offset of the child?

If only ImageView could honor gravity this wouldn't be a problem. Or
setting custom typefaces through xml. Sigh.

> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
> 16.01.2011 19:06 пользователь "Mark Murphy" 
> написал:
>
> > On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist
> >  wrote:
> >> I've already tried that. It works if the bitmap is smaller than the
> >> ImageView, it aligns to the right edge correctly. But, if the bitmap
> >> is larger, its cropped at both left and right side. Seems like an
> >> ImageView can't expand to be larger than it's parent, even inside an
> >> FrameLayout.
>
> > Of course. That's a rule for any container/child relationship in Android.
>
> >> Any trick to make a ImageView larger than it's parent FrameLayout?
>
> > Move it outside of the FrameLayout into some larger container. Or,
> > expand the FrameLayout.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://github.com/commonsguy
> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> > _Android Programming Tutorials_ Version 3.1 Available!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
On Jan 16, 5:04 pm, Mark Murphy  wrote:

> On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist
>
>  wrote:
> > I've already tried that. It works if the bitmap is smaller than the
> > ImageView, it aligns to the right edge correctly. But, if the bitmap
> > is larger, its cropped at both left and right side. Seems like an
> > ImageView can't expand to be larger than it's parent, even inside an
> > FrameLayout.
>
> Of course. That's a rule for any container/child relationship in Android.

If a child view can't be larger than it's parent, how does a
ScrollView work?

>
> > Any trick to make a ImageView larger than it's parent FrameLayout?
>
> Move it outside of the FrameLayout into some larger container. Or,
> expand the FrameLayout.

I can't, it's an AppWidget.

>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 3.1 Available!

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
I've already tried that. It works if the bitmap is smaller than the
ImageView, it aligns to the right edge correctly. But, if the bitmap
is larger, its cropped at both left and right side. Seems like an
ImageView can't expand to be larger than it's parent, even inside an
FrameLayout.

Any trick to make a ImageView larger than it's parent FrameLayout?


On Jan 16, 7:20 am, Zsolt Vasvari  wrote:
> Use a layout that supports the android:layout_gravity attribute, such
> as FrameLayout.  The regular android:gravity is only used the
> TextViews to position the text if the view is larger than the text.
>
> On Jan 16, 11:12 am, Henrik Lindqvist 
> wrote:
>
> > I have a runtime generated Bitmap, for a RemoteView, that I wan't
> > displayed within a ImageView without scaling, so I use
> > scaleType="center". Now, if the bitmap is smaller than the ImageView I
> > wan't it to gravitate to the right. Or, if the bitmap is to large,
> > crop the left side.
>
> > ImageView seems to ignore gravity. I've tried everything. Nesing
> > inside a FrameLayout etc, nothing works! Any other options?

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

2011-01-15 Thread Henrik Lindqvist
The receiver needs to have a diffrent android:name, provider class.
Just create one for each size.

On Jan 16, 4:30 am, John Gaby  wrote:
> Is there a way to allow the user to choose the size of the App Widget
> when he places it on his Home screen?  I tried creating 2
>  ...  sections in the manifest for 2 different
> sizes, but only the first shows up.
>
> 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] ImageView, no scaling and gravity

2011-01-15 Thread Henrik Lindqvist
I have a runtime generated Bitmap, for a RemoteView, that I wan't
displayed within a ImageView without scaling, so I use
scaleType="center". Now, if the bitmap is smaller than the ImageView I
wan't it to gravitate to the right. Or, if the bitmap is to large,
crop the left side.

ImageView seems to ignore gravity. I've tried everything. Nesing
inside a FrameLayout etc, nothing works! Any other options?

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

2011-01-09 Thread Henrik Lindqvist
I set the drawable using xml android:drawableBottom so
setCompoundDrawablesWithIntrinsicBounds should be used. I've it now
also tried setting it programmatically, same result. I'am going back
to using nested LinearLayout's for label and button, this is to much
of a hassle.


On Jan 9, 4:04 am, Romain Guy  wrote:
> You should use setCompoundDrawablesWithIntrinsicBounds()
>
> On Sat, Jan 8, 2011 at 6:40 PM, Henrik Lindqvist 
>
>
> > wrote:
> > I'am trying to use TextView's setCompoundDrawables feature because i
> > wan't a button with a label above it. I set android:drawableBottom to
> > my button drawable, which is a  with a button background,
> > an icon and a toggle indicator.
>
> > First app launch every thing looks nice, close app, launch again and
> > the drawables seems to have lost their padding. If I close the app and
> > wait a few more seconds, GC runs or something, then the buttons looks
> > ok again.
>
> > Does the drawables gets altered at first launch? Doesn't the TextView
> > set the bounds on the drawables the second launch? Very inconsistent.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them

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


[android-developers] TextView setCompoundDrawables inconsistent size

2011-01-08 Thread Henrik Lindqvist
I'am trying to use TextView's setCompoundDrawables feature because i
wan't a button with a label above it. I set android:drawableBottom to
my button drawable, which is a  with a button background,
an icon and a toggle indicator.

First app launch every thing looks nice, close app, launch again and
the drawables seems to have lost their padding. If I close the app and
wait a few more seconds, GC runs or something, then the buttons looks
ok again.

Does the drawables gets altered at first launch? Doesn't the TextView
set the bounds on the drawables the second launch? Very inconsistent.

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

2011-01-05 Thread Henrik Lindqvist
Think I've got it, even without the 9-patch hack.

Using  to translate/move a separate  with gravity to
prevent scaling the needle itself. Sure at low "progress" it will be
clipped, as the 9-patch would be "squashed". But that's easy to
compensated for.


On Jan 5, 3:57 am, Henrik Lindqvist 
wrote:
> Thanks for the tips. Seems ProgressBar is useless in this case, so
> I'll probably need to "hack" my own.
>
> The ApiDemos contains a resource for circular progress-bars, \samples
> \android-8\ApiDemos\rescircular_progress.xml:
>
> http://schemas.android.com/apk/res/
> android">
>   
>   
>            android:pivotX="50%"
>       android:pivotY="50%"
>       android:fromDegrees="0"
>       android:toDegrees="360"
>       android:drawable="@drawable/progress_particle" />
>   
> 
>
> So  is supported. Too bad  isn't.
>
> On Jan 5, 3:39 am, Mark Murphy  wrote:
>
> > AFAIK, neither  nor  are valid for a drawable
> > resource. Those are used with tween animations for animation
> > resources:
>
> >http://developer.android.com/guide/topics/resources/animation-resourc...
>
> > As for how to solve your problem, one solution put an ImageView with
> > your needle atop your ProgressBar and use margins to position it.
> > Crude, but as you point out, in app widgets, you don't exactly have
> > tons o' options.
>
> > Another possible solution is to make your progress drawable be a
> > nine-patch PNG, where the needle is outside of the stretch area. That
> > may not give you quite accurate results for low progress values, but
> > it will asymptotically approach accuracy by the time you complete the
> > bar.
>
> > On Tue, Jan 4, 2011 at 9:30 PM, Henrik Lindqvist
>
> >  wrote:
> > > I'am trying to make a ProgressBar with a moving needle. Since it's in
> > > a app-widget I can't make any custom code. It all needs to be done
> > > with Drawables.
>
> > > Creating a rotating ProgressBar is easy, just use . But to
> > > move a needle image I've tried , it gives an error "invalid
> > > drawable tag translate".
>
> > > Anyone got any suggestions?
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

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

2011-01-04 Thread Henrik Lindqvist
Thanks for the tips. Seems ProgressBar is useless in this case, so
I'll probably need to "hack" my own.

The ApiDemos contains a resource for circular progress-bars, \samples
\android-8\ApiDemos\rescircular_progress.xml:

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

  


So  is supported. Too bad  isn't.



On Jan 5, 3:39 am, Mark Murphy  wrote:
> AFAIK, neither  nor  are valid for a drawable
> resource. Those are used with tween animations for animation
> resources:
>
> http://developer.android.com/guide/topics/resources/animation-resourc...
>
> As for how to solve your problem, one solution put an ImageView with
> your needle atop your ProgressBar and use margins to position it.
> Crude, but as you point out, in app widgets, you don't exactly have
> tons o' options.
>
> Another possible solution is to make your progress drawable be a
> nine-patch PNG, where the needle is outside of the stretch area. That
> may not give you quite accurate results for low progress values, but
> it will asymptotically approach accuracy by the time you complete the
> bar.
>
> On Tue, Jan 4, 2011 at 9:30 PM, Henrik Lindqvist
>
>
>
>  wrote:
> > I'am trying to make a ProgressBar with a moving needle. Since it's in
> > a app-widget I can't make any custom code. It all needs to be done
> > with Drawables.
>
> > Creating a rotating ProgressBar is easy, just use . But to
> > move a needle image I've tried , it gives an error "invalid
> > drawable tag translate".
>
> > Anyone got any suggestions?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

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


[android-developers] ProgressBar with moving image. Drawable resource using .

2011-01-04 Thread Henrik Lindqvist
I'am trying to make a ProgressBar with a moving needle. Since it's in
a app-widget I can't make any custom code. It all needs to be done
with Drawables.

Creating a rotating ProgressBar is easy, just use . But to
move a needle image I've tried , it gives an error "invalid
drawable tag translate".

Anyone got any suggestions?

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


[android-developers] Re: One local service multiple binding activities

2010-11-20 Thread Henrik Lindqvist
Solution:
http://stackoverflow.com/questions/2914921/android-context-bindservice-always-returns-false-and-serviceconnection-object-is

Use:
getApplicationContext().bindService(...)

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

On Nov 20, 8:20 pm, Henrik Lindqvist 
wrote:
> On further investigation. It works fine, unless a TabActivity/TabHost
> launches the Activity that calls bindService.
>
> Reading this thread from 
> 2008:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> >> * you can't bind to a service, onServiceConnected will never be
> >> called.
>
> >This is a bug that should be fixed in the future.  Not documented because we
> >didn't realize it was broken. :)
>
> Seems like an old, ignored bug in TabActivity. Sigh!
>
> On Nov 20, 6:53 pm, Henrik Lindqvist 
> wrote:
>
> > I have a local Service to which multiple activites needs to bind. In
> > the first launched Activity, bindService returns true and
> > onServiceConnected is called. But in any additionally launched
> > activites bindService returns false, and I can't get a reference to my
> > Service.
>
> > How can multiple activities simultaneously be connected to a local
> > Service?
>
>

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

2010-11-20 Thread Henrik Lindqvist
On further investigation. It works fine, unless a TabActivity/TabHost
launches the Activity that calls bindService.

Reading this thread from 2008:
http://groups.google.com/group/android-developers/browse_thread/thread/978fc19ae5976efa/0b830abad32d572a

>> * you can't bind to a service, onServiceConnected will never be
>> called.
>
>This is a bug that should be fixed in the future.  Not documented because we
>didn't realize it was broken. :)

Seems like an old, ignored bug in TabActivity. Sigh!


On Nov 20, 6:53 pm, Henrik Lindqvist 
wrote:
> I have a local Service to which multiple activites needs to bind. In
> the first launched Activity, bindService returns true and
> onServiceConnected is called. But in any additionally launched
> activites bindService returns false, and I can't get a reference to my
> Service.
>
> How can multiple activities simultaneously be connected to a local
> Service?

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


[android-developers] One local service multiple binding activities

2010-11-20 Thread Henrik Lindqvist
I have a local Service to which multiple activites needs to bind. In
the first launched Activity, bindService returns true and
onServiceConnected is called. But in any additionally launched
activites bindService returns false, and I can't get a reference to my
Service.

How can multiple activities simultaneously be connected to a local
Service?

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


[android-developers] Stop AlarmManager sending past repeating alarm.

2010-11-10 Thread Henrik Lindqvist
When the device awakens from sleep state the AlarmManager sends all
"missed" alarms. Can I prevent this from happening, grouping past
alarm to a single intent instead?

There is an intent extra "android.intent.extra.ALARM_COUNT" which
seems to suggest it's possible?

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

2010-11-10 Thread Henrik Lindqvist
Thank. I'll sleep well tonight knowing raptors are extinct.

On Nov 11, 1:30 am, Mark Murphy  wrote:
> On Wed, Nov 10, 2010 at 7:27 PM, Henrik Lindqvist
>
>  wrote:
> > Thanks. I'am using the AlarmManager to send PendingIntent.getService
> > with a "Explicit Intent" to an IntentService.
>
> > Read this post from July 2008:
>
> > "The "Alarm Service" sample code in ApiDemos at
> >http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
> > is intended to provide the best practices for this.  The current
> > example is a little overly complex because of the need of the
> > intermediate receiver.  In a future SDK where you can have the alarm
> > manager directly start a service, this is a lot cleaner."
>
> July of 2008 is the Jurassic era of Android development. Personally, I
> was nearly eaten by a raptor.
>
> :-)
>
> Seriously, that would have been the Android M5 pre-release. Anything
> older than, say, October 2008 should be viewed with a bit of
> skepticism.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 3.0.1 Available!

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


[android-developers] Re: AlarmManager starting service, API Level?

2010-11-10 Thread Henrik Lindqvist
Thanks. I'am using the AlarmManager to send PendingIntent.getService
with a "Explicit Intent" to an IntentService.

Read this post from July 2008:

"The "Alarm Service" sample code in ApiDemos at
http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
is intended to provide the best practices for this.  The current
example is a little overly complex because of the need of the
intermediate receiver.  In a future SDK where you can have the alarm
manager directly start a service, this is a lot cleaner."



On Nov 11, 1:10 am, Mark Murphy  wrote:
> On Wed, Nov 10, 2010 at 7:00 PM, Henrik Lindqvist
>
>  wrote:
> > I've read comment that the AlarmManager in a earlier API version
> > couldn't start services. Prior to which API Level was that?
>
> I don't know where you read that. PendingIntents have been able to
> start services since the beginning.
>
> I am a bit nervous about how WakeLocks work when starting a service
> directly versus going through a BroadcastReceiver, but otherwise
> AlarmManager starting services works like a champ. It's great for app
> widgets, if you have an IntentService that is doing the updates and
> you are controlling the update schedule yourself rather than using
> android:updatePeriodMillis, for example.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 3.0.1 Available!

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


[android-developers] AlarmManager starting service, API Level?

2010-11-10 Thread Henrik Lindqvist
I've read comment that the AlarmManager in a earlier API version
couldn't start services. Prior to which API Level was that?

I'am currently testing in the emulator with API Level 4 and it start a
service just fine.

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


[android-developers] Re: service intent-filter

2010-11-09 Thread Henrik Lindqvist
Wow. Quick reply. Thanks.

Ok. So to let the service act on the "broadcast" intents I'll forward
them in the BroadcastReceiver:

public void onReceive (Context context, Intent intent) {
  context.startService(intent.setClass(context, MyService.class));
}

Is that good practice?


On Nov 10, 1:53 am, Mark Murphy  wrote:
> On Tue, Nov 9, 2010 at 7:51 PM, Henrik Lindqvist
>
>  wrote:
> > I've got a IntentService started by an alarm. I also want it to start
> > on other intents, like ACTION_TIME_CHANGED. Do I have to create an
> > BroadcastReceiver that start the service when it receivers the
> > TIME_SET intent, can't the service be started by the intent in the
> > first place. I tried to add // but
> > didn't work. Should it?
>
> There are three "channels", if you will, on the Intent message bus:
>
> -- starting activities (Activity)
> -- starting services (Service)
> -- sending broadcasts (BroadcastReceiver)
>
> ACTION_TIME_CHANGED is a broadcast action (as indicated in the docs).
> That can only be received by a BroadcastReceiver. It cannot be
> received by a service.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

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


[android-developers] service intent-filter

2010-11-09 Thread Henrik Lindqvist
I've got a IntentService started by an alarm. I also want it to start
on other intents, like ACTION_TIME_CHANGED. Do I have to create an
BroadcastReceiver that start the service when it receivers the
TIME_SET intent, can't the service be started by the intent in the
first place. I tried to add // but
didn't work. Should 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