Re: [android-developers] get bitmap size

2012-09-19 Thread Przemyslaw Wegrzyn

On 2012-09-19 08:34, Live Happy wrote:
what is the best way to get the size of bitmap image i know there is 
myBitmap.getByteCount() but this method is for api level 12 so it is 
there any other way to get it thx on advance
You can use the following instead: myBitmap.getRowBytes() * 
myBitmap.getHeight()


Both methods available in API Level 1 already. And this is exactly what 
getByteCound() does internally.


BR,
Przemek


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

2012-09-04 Thread Przemyslaw Wegrzyn
Hi!

No, after creating the application again, all the products added
previously simply reappeared. It wasn't necessary to create any new ones.

BR,
Przemek

On 09/04/2012 12:48 AM, Rob B wrote:
 Did you have to use new product ids? I noticed that after deleting the
 APKs, when I re-added, my products that I had previously had there
 were still there. I'd prefer to be able to keep the same products, if
 possible (especially since if you delete one, you cannot reuse the ID).

 This is getting incredibly frustrating.

 Rob

 On Saturday, August 18, 2012 2:27:14 PM UTC-7, Przemyslaw Wegrzyn wrote:


 Just in case someone else is struggling with it - now it works for
 me.
 Redownloading new APKs, changing settings, etc didn't help.

 What helped was removing the application submission altogether (i.e.
 deactivating and deleting one and only APK version), and recreating
 everything from scratch.
 S frustrating...

 BR,
 Przemek


 On 08/16/2012 02:12 PM, Przemyslaw Wegrzyn wrote:
  On 08/16/2012 12:19 PM, bharadwaj wrote:
  u have publish the items u have put in the developer account
 but no
  need to publish ur app.
  That's exactly what I've done.
  also need to mention required permisssions in your manifest.
  I have all the necessary permissions configured.
  My public key is OK, my test account is configured, device was
  factory-reseted...
 
  What makes me wonder: does it matter the account I used the upload
  belongs to 2 developer profiles (I have my own + I was added to mu
  customer's one, where I uploaded the test app).
 
  I'm gonna check this with the demo application today.
 
  the unique id which u have given in for each item should be
 same as
  the id u are sending to google while purchasing package.
  It is the same - purchase pop-up windows shows valid item
  title/descriptions, so it can see the item on the server side.
 
  I'm nearly sure it is some google-side quirk. Googling around
 I've found
  a few similar cases, e.g. here:
 
 
 http://stackoverflow.com/questions/11020587/in-app-billing-item-requested-not-available-for-purchase
 
 http://stackoverflow.com/questions/11020587/in-app-billing-item-requested-not-available-for-purchase

  See the longest answer, point 4.
 
  BR,
  Przemek
 
 

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

2012-08-20 Thread Przemyslaw Wegrzyn
On 20/08/12 20:15, Nathan wrote:
 I would like to do a copy on a bitmap from itself, ie, shift pixels in
 a bitmap by copying from one rectangle to another rectangle. The src
 and destination rectangles might overlap. This snake eating its own
 tail trick did work in Windows and Windows Mobile. 

 I see there is one issue logged about this on Android.

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

 However, I don't know that it was ever supposed to work. I can't find
 any documentation that suggests it should.

 Has anyone come up with an efficient solution for this? I know that
 having yet another bitmap buffer the same size would work, but it is
 something I want to avoid as it increases memory footprint (its not a
 small bitmap).

 I'm not using native code, so a solution using smaller bitmaps and
 drawing calls may not be very efficient.

What is the minimum Android version you're targetting?

If you're not afraid of using native code - starting from API-8 (Android
2.2) you can relatively easily access Bitmap pixels from C code.
http://mobilepearls.com/labs/native-android-api/#bitmap

Calling AndroidBitmap_getInfo(..) would give you the dimensions, format
and stride,  AndroidBitmap_lockPixels(...) gives you the pointer to raw
pixel data (it's just and array of pixels - bytes per pixel depends on
bitmap format, the stride parameter tells you how many bytes to skip to
get to next row). The rest is just moving/copying bytes...

Note, that no bitmap copy is done this way, you can edit the Bitmap in
place - it's thus really efficient.
 
Another questions is - what are you actually trying to achieve? Perhaps
there's another way around it?

Best Regards,
Przemek


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

2012-08-18 Thread Przemyslaw Wegrzyn

Take a look at Google Play licensing library, it is a good example of
AES-based obfuscation.

Search for AESObfuscator here
http://developer.android.com/guide/google/play/licensing/adding-licensing.html

BR,
Przemek


On 08/18/2012 03:06 PM, William Ferguson wrote:
 Thanks Nikolay, that makes sense.

 Kostya, you mean obfuscate each field value independently (and yes I
 prefer to use a DB that writing my own file format). I haven't found
 any examples that do that. To which library are you referring? Have
 you got a URL to an example?

 William

 On Saturday, August 18, 2012 9:39:37 PM UTC+10, Nikolay Elenkov wrote:


 On Aug 18, 2012 8:21 PM, Kostya Vasilyev kman...@gmail.com
 javascript: wrote:
 
  You obfuscate the values before storing them regular Android
 storage mechanisms (shared preferences or a database). I believe
 there is an example in the library.
 
 

 You can also use obfuscated names for the tables and column names
 like 'a', 'b'' etc.

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

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

Re: [android-developers] Re: InApp billing - always getting RESULT_ITEM_UNAVAILABLE

2012-08-18 Thread Przemyslaw Wegrzyn

Just in case someone else is struggling with it - now it works for me.
Redownloading new APKs, changing settings, etc didn't help.

What helped was removing the application submission altogether (i.e.
deactivating and deleting one and only APK version), and recreating
everything from scratch.
S frustrating...

BR,
Przemek


On 08/16/2012 02:12 PM, Przemyslaw Wegrzyn wrote:
 On 08/16/2012 12:19 PM, bharadwaj wrote:
 u have publish the items u have put in the developer account but no
 need to publish ur app.
 That's exactly what I've done.
 also need to mention required permisssions in your manifest.
 I have all the necessary permissions configured.
 My public key is OK, my test account is configured, device was
 factory-reseted...

 What makes me wonder: does it matter the account I used the upload
 belongs to 2 developer profiles (I have my own + I was added to mu
 customer's one, where I uploaded the test app).

 I'm gonna check this with the demo application today.

 the unique id which u have given in for each item should be same as
 the id u are sending to google while purchasing package.
 It is the same - purchase pop-up windows shows valid item
 title/descriptions, so it can see the item on the server side.

 I'm nearly sure it is some google-side quirk. Googling around I've found
 a few similar cases, e.g. here:
 http://stackoverflow.com/questions/11020587/in-app-billing-item-requested-not-available-for-purchase
 See the longest answer, point 4.

 BR,
 Przemek



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


[android-developers] InApp billing - always getting RESULT_ITEM_UNAVAILABLE

2012-08-16 Thread Przemyslaw Wegrzyn
Hi!

I'm integrating InApp Billing functionality into my application. Testing
with fake items e.g. android.test.purchased works fine, but trying to
purchase any of my own items fails.

I've double-checked the following:

- signed application was uploaded to the publisher site, same APK
installled on the device
- all the inapp items were created
- device runs Android 2.2.2, Google Play 3.7.15, and I have just
factory-reseted it and assigned a brand new gmail account
- the account is added as a test account on a publisher site

Unfortunately, all I get is RESULT_ITEM_UNAVAILABLE. To make things more
frustrating, I can see that the item was found on the server, as the
billing popup dialog contains the item title/description that was
entered on the publisher site!

In the logs I can see the following messages from Finsky (replaced
package name with xxx ,as I don't want to disclose it yet):

08-14 12:46:03.312 D/Finsky  (  525): [7]
MarketBillingService.getPreferredAccount: com.xxx.xxx: Account from
first account.
08-14 12:46:03.322 D/Finsky  (  525): [7]
MarketBillingService.getPreferredAccount: com.xxx.xxx: Account from
first account.
08-14 12:46:03.513 D/Finsky  (  525): [1]
SelfUpdateScheduler.checkForSelfUpdate: Skipping self-update. Local
Version [8013015] = Server Version [0]
08-14 12:46:03.722 W/Finsky  (  525): [1] CarrierParamsAction.run:
Saving carrier billing params failed.
08-14 12:46:03.722 E/Finsky  (  525): [1] CarrierBillingUtils.isDcb30:
CarrierBillingParameters are null, fallback to 2.0
08-14 12:46:03.732 D/Finsky  (  525): [1] GetBillingCountriesAction.run:
Skip getting fresh list of billing countries.
08-14 12:46:03.742 E/Finsky  (  525): [1] CarrierBillingUtils.isDcb30:
CarrierBillingParameters are null, fallback to 2.0
08-14 12:46:03.752 D/Finsky  (  525): [1]
CarrierProvisioningAction.shouldFetchProvisioning: Required
CarrierBillingParams missing. Shouldn't fetch provisioning.
08-14 12:46:03.752 D/Finsky  (  525): [1] CarrierProvisioningAction.run:
No need to fetch provisioning from carrier.
08-14 12:46:04.242 E/Finsky  (  525): [1] CheckoutPurchase.setError:
type=IAB_PERMISSION_ERROR, code=4, message=null
08-14 12:46:07.302 D/Finsky  (  525): [1]
MarketBillingService.sendResponseCode: Sending response
RESULT_ITEM_UNAVAILABLE for request 3209013950184753921 to com.xxx.xxx.

What am I missing here? What is IAB_PERMISSION_ERROR, code=4 ?

Any help highly appreciated!

Przemek

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

2012-08-16 Thread Przemyslaw Wegrzyn
Actually, I've just realized that Googl'e s InApp tutorial contradicts
the documentation statement.

Documentation states that:
Note: You do not need to publish your application to do end-to-end
testing. You only need to upload your application as a draft application
to perform end-to-end testing.
Make sure that you publish the items (the application can remain
unpublished).

However, above the inapp items list in the developer console I see the a
message saying that I need to *publish the application itself* to make
the items published, regardless of the individual item state.

Which is true? Do I really need to publish my app to check InApps?!

BR,
Przemek


On 08/14/2012 12:48 PM, Przemyslaw Wegrzyn wrote:
 Hi!

 I'm integrating InApp Billing functionality into my application.
 Testing with fake items e.g. android.test.purchased works fine, but
 trying to purchase any of my own items fails.

 I've double-checked the following:

 - signed application was uploaded to the publisher site, same APK
 installled on the device
 - all the inapp items were created
 - device runs Android 2.2.2, Google Play 3.7.15, and I have just
 factory-reseted it and assigned a brand new gmail account
 - the account is added as a test account on a publisher site

 Unfortunately, all I get is RESULT_ITEM_UNAVAILABLE. To make things
 more frustrating, I can see that the item was found on the server, as
 the billing popup dialog contains the item title/description that was
 entered on the publisher site!

 In the logs I can see the following messages from Finsky (replaced
 package name with xxx ,as I don't want to disclose it yet):

 08-14 12:46:03.312 D/Finsky  (  525): [7]
 MarketBillingService.getPreferredAccount: com.xxx.xxx: Account from
 first account.
 08-14 12:46:03.322 D/Finsky  (  525): [7]
 MarketBillingService.getPreferredAccount: com.xxx.xxx: Account from
 first account.
 08-14 12:46:03.513 D/Finsky  (  525): [1]
 SelfUpdateScheduler.checkForSelfUpdate: Skipping self-update. Local
 Version [8013015] = Server Version [0]
 08-14 12:46:03.722 W/Finsky  (  525): [1] CarrierParamsAction.run:
 Saving carrier billing params failed.
 08-14 12:46:03.722 E/Finsky  (  525): [1] CarrierBillingUtils.isDcb30:
 CarrierBillingParameters are null, fallback to 2.0
 08-14 12:46:03.732 D/Finsky  (  525): [1]
 GetBillingCountriesAction.run: Skip getting fresh list of billing
 countries.
 08-14 12:46:03.742 E/Finsky  (  525): [1] CarrierBillingUtils.isDcb30:
 CarrierBillingParameters are null, fallback to 2.0
 08-14 12:46:03.752 D/Finsky  (  525): [1]
 CarrierProvisioningAction.shouldFetchProvisioning: Required
 CarrierBillingParams missing. Shouldn't fetch provisioning.
 08-14 12:46:03.752 D/Finsky  (  525): [1]
 CarrierProvisioningAction.run: No need to fetch provisioning from carrier.
 08-14 12:46:04.242 E/Finsky  (  525): [1] CheckoutPurchase.setError:
 type=IAB_PERMISSION_ERROR, code=4, message=null
 08-14 12:46:07.302 D/Finsky  (  525): [1]
 MarketBillingService.sendResponseCode: Sending response
 RESULT_ITEM_UNAVAILABLE for request 3209013950184753921 to com.xxx.xxx.

 What am I missing here? What is IAB_PERMISSION_ERROR, code=4 ?

 Any help highly appreciated!

 Przemek


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

2012-08-16 Thread Przemyslaw Wegrzyn
On 08/16/2012 12:19 PM, bharadwaj wrote:
 u have publish the items u have put in the developer account but no
 need to publish ur app.
That's exactly what I've done.
 also need to mention required permisssions in your manifest.
I have all the necessary permissions configured.
My public key is OK, my test account is configured, device was
factory-reseted...

What makes me wonder: does it matter the account I used the upload
belongs to 2 developer profiles (I have my own + I was added to mu
customer's one, where I uploaded the test app).

I'm gonna check this with the demo application today.

 the unique id which u have given in for each item should be same as
 the id u are sending to google while purchasing package.
It is the same - purchase pop-up windows shows valid item
title/descriptions, so it can see the item on the server side.

I'm nearly sure it is some google-side quirk. Googling around I've found
a few similar cases, e.g. here:
http://stackoverflow.com/questions/11020587/in-app-billing-item-requested-not-available-for-purchase
See the longest answer, point 4.

BR,
Przemek


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