Android queryInventoryAsync bug or not - android

I have been trying to implement google in app billing lately in an android application and today i witnessed something strange. I have an app witch sells non consumable products,more precisely a kind of information. Now the need is for having more than 150 products and when i query google for product info it seems that google does not respond to my request , i waited nearly 5 minutes and set a dialog which gets dismissed when google responds and populates an adapter which populates a spinner. Now i read somewhere that queryInventoryAsync can't deal with lists more than 20 items long,sorry about not having the link but I lost track of it searching all over google to find a solution or some explanation or a possible scenario to which i can refer. So my guesses are:
queryInventoryAsync cant handle 20+ items long lists
maybe it is the adapter that cant handle it
maybe the spinner would be better to be replaced by a ListView
or something else
I thank you in advance for any kind of effort. Good job stackoverflow comunity, thank you for being a place to exchange knowledge and share it. :)
So i hardcoded it and experienced it myself , i tried to send a query with a list with 20 elements and queryInventoryAsync responded, but with a list of more than 20 elements exh:23 it didn't. So now i am searching how to send subsequent requests to google while I split the list in parts if the original list has more than 20 elements. Help is needed , running out of ideas.

I fell foul of this issue as well, or at least something very similar. The patch in this answer fixed the issue and allowed me to query more than 20 SKUs.
Also, if like me you are using the *.utils helpers from the Google Play Billing Library and installed the package from the Android SDK Manager, then you may fall foul of issues like this. You should update the *.utils files from the Google marketbilling repo, making sure you merge the changes from the answer above.
I hope this helps you out.

Related

How do I defer a subscription in Android (Google Play Billing)?

I have implemented an in app subscription in Android, it all works fine, I even have a 30 day free trial to begin with.
I have a referral feature in the app, so when a certain value in the database reaches 10 (i.e. 10 referrals) - I want to give the user a free 30 day subscription.
I have had a look around and think deferring the subscription by the desired amount would the solution. However, I have no idea how to go about this. The api docs dont seem to be Android-specific, and I cant find a proper tutorial anywhere. Any help massively appreciated.
Already tried looking at the docs - https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/defer
Do I just make the http request listed there? I was hoping for a nice in-built call I can make.
I simply wish for:
when a certain variable == 10, to defer, or increase the subscription length by 30 days.
Cheers mate.
Currently this is the only official way to do it. You may try to find some third party library on github, but I would not count on it.
I would recommend you to use Retrofit and create this call by yourself.
Maybe in (the) future Google will include this method as a default one in its billing library though - we just have to wait)
Hope it helps, mate.

What are the best practices for consuming several API's in Android

I was hoping someone could help me with a question I have.
If I want to consume data from several API's in android (they are checked once a day for changes) and then I combine all of the data and do something with it, what would be the best way to do this from a resource and memory point of view ?
An example would be getting bus timetables from several bus companies operating in a city and then showing what busses are leaving in the next hour for example, that is relative to your location.
I do know how to consume Rest API's in Android, I am just wondering if there is a better way than calling say 20 API's once a day and storing the data ?
If I have not explained the question well enough please feel free to ask me anything and I will try and explain it better.
Thanks in advance.
I think you should make a few question about your solution.
Does your solution require the access to 20 different api's and the mobile app will be distributed in more than one user? If the answer is YES then you need a backend. The backend will execute a batch process to access the data from the 20 sources, consolidate the information and will be available for as many client devices require that information.
If the information will be not updated, you can make one call per day to the backend and keep it cached on the device.
If your app get more complex, could even receive notifications about changes on the data so it could update it.
Hope it helps.

Flash card app user performance with Google Analytics?

We are building an app (iOS and Android). The core of the app will be a flash card interface where the user will see a question and then will need to give an appropriate answer. They have a timer and will be shown hints as time goes on.
We want to understand the following on a per question basis (there are potentially 100s of questions):
Which questions took longer to recall correctly (with and without hints)?
Which questions had the most errors (with and without hints)?
Which questions were skipped the most (with and without hints)?
What were the most common (wrong) answers for a question?
Of course, we are also going to be collecting number of installs, usage, churn, etc., but I figure that is pretty well covered by GA.
Also, we will be storing different information about the user themselves so they can track their progress. This is meant to help us understand how to tweak the flash card data later on so that it is better for the students.
It feels like we could potentially use goals within GA (end goal is to get the right answer), but I am not as familiar with them.
Would this be goals within Google Analytics? Or is Google Analytics not a good use for this type of thing? Is there something else we could use to collect/analyze this information or should we build it ourselves?
Google Analityc suppor custom variables. You can save custom data.
First I would just track every card event as unique pageView (card1234) with it's data.
You can also track events with data for every card.
Goal is more for tracking your app behaviour in general. Example:
Goal 1
for tracking wring answers - Make a goal with more that 100 wrong answer (for session or in general for day) - in this way you can track that your app has difficult question
Gola 2
Quick answer - Make goal with Event or pageView for card that has small duration (5 second for example). In this way you can check behaviour of whole app.
There are many other good analytics
Localitic
KiSSmetric payed one
Mixpanel - very good for tracking information about users and making segmentation reports
https://mixpanel.com/notifications/
County -Haven't try this one so can't say anything
Here you can find many others
Im currently using Flurry analytics it, more easy to integrate and simple to use.
http://www.flurry.com/flurry-analytics.html
http://www.google.com/analytics/ this is GA official web-page.
Edit: Documentation for developers: https://developers.google.com/analytics/

Location exchange between Android phones

I'm seeking more an advice on where to go next, rather than how to do it.
I'm developing an augmented reality Android game as a student project, and I've stumbled upon a problem. Four phones have to know each other's position and show it on a map with time steps (it should not be really realtime, for the sake of the game). Besides that, the players should be notified when one of the phones/players gets to some location, or does something.
I wanted to do it with a PHP service, where each phone would check in a couple of seconds for the positions of the rest (all by JSON), send it's position and that's it. Quite simple, but I'm afraid that there will be a lot of desynchronisation and unconsitent data as the game progresses. Since the phones don't start at the same second as everyone signs in. Also, I'm not sure how to do the events this way (for example, one of the players can cloak and his position should not be updated anymore in the next x seconds), or get to a location, or what items are still on the map (players can "pick up" items). Someone will know earlier than the others.
This really calls for a push-like solution, but I'm not really familiar with C2DM, and it seems to me that using it is a real overhead in development, and I need a C#/Java or similar server as PHP certanly can't push to the cloud (or can it?). I know C# and Java, but it takes more time as I need to solve threading and so on. Can C2DM even be used for this?
Basically, I'm seeking thoughts of more experienced developers, what is the best solution here for sync? Is there any way to remedy the problems with PHP and periodic checking the server or should I continue with the cloud service and a more complicated server?
Sorry for the long explanation :) .
Sorry that this isn't simpler but I've encountered pretty much the exact same problem in my own app and there is no way to avoid this, you need;
a server with a REST API to manage and distribute data
a way to set up friends / groups
a way to push data
Google Cloud Messaging really isn't that much trouble.
Check out the Google IO 2012 code, they've made use of it there with not much code.
http://code.google.com/p/iosched/source/browse/
What you really need to build is a rest api with quite a few functions for being able to identify devices and set up these groups of friends. I would suggest using Facebook integration for establishing a friend network.
https://developers.facebook.com/
And there are infinite ways to set up the REST API, but the fastest I've seen was released this year at google IO and thats Google AppEngine EndPoints.
http://devthots.blogspot.com/2012/07/building-awesome-android-apps-with.html
Give Comet a try, it's all about http requests

Android Market - Time to wait between two updates

I would like to know how many times I must wait to post an update for my application. I want to be sure that the update will appears in the "news" section of the Android Market.
You're trying to game the Market system. Don't do that. Update your app when it needs updating, i.e. when you have new features or bug-fixes.
In my experience, updating too often will make existing users angry, and you'll get several one-star "too many updates - uninstalled" comments. I think those are a bit dumb (I'm always glad to have well-maintained apps), but the bottom line is still - don't update if you don't have to.
You can update several times a day if you wish, there's no limitation regarding that. Personally, I tried to wait at least 14 days inbetween updates, but if I can hold out even longer, I will.
Updates are an hidden question to the user, "Do I really need this app?"
There are two buttons: Update and Uninstall.
Easy enough to press the Uninstall-Button.
So, with every update you will loose installations ...
S.
My experience: less than 2 weeks but I think also, that you have to change the description more than just a bit. I cant believe that the Market only check for "waiting time".
I always thought it was 7 Days.
You can update as many times you wish on Android Market Place. Normally, I try to update my app on NET-30 day basis. Reason being that for any new update, Google marks it as new app and try to promote the updated app in marketplace. Most importantly, the app is given a position in New Chart and that helps boost your download. On the other side, if you update often, you may annoy your users and they may leave bad comments if they don't see much change in UI and any extra feature being added. It's wise to update your app once every 2-3 weeks.

Categories

Resources