How to create simple self LVL like library - android

I have been trying to understand LVL library but without luck. All i need is a simple method that will send and receive current status of License without Policies , just send / reply from ILicensingService service. I want to create custom LVL library but i must understand it first.

Well, have you taken a look at the actual Market Licensing source files provided by Android? Once you take a few minutes you should be able to understand how the policies work. They are actually simple.
The key class where all the action happens is the LicenseValidator class. There is where the licensing check request are taken and there is where the connection to the remote service for licensing checks happens.
In that class take a look how the Policy interface class is used.

Related

Piwik tracking in an android application

I want to do data analytics for my android application using Piwik.
In Piwik's documentation, they suggest using GitHub.
I got the Piwik API and download the following file:
https://github.com/piwik/piwik-java-tracking
which I don't know how to use.
What are the steps needed to get the data analysis using the Piwik working?
What should I do next?
I also would like to implement piwik tracking in my android app.
This is what I understood so far:
Unlike for iOS/MacOS applications, there is currently no SDK to help us out.
Piwik developers have a ticket opened in their bugtracker about this, which shows they're aware of the issue and willing to improve the situation, but it will take some time before this android tracking SDK is released.
At the moment, the Piwik team encourages android and Java developers to use the piwik-java-tracking library you mentioned. This is basically just a java wrapper for the web tracking API reference, which helps you to generate Tracking Request URLs to send to your Piwik instance.
This piwik-java-tracking project lacks documentation (there is none that I know of in Github), but there is javadoc in the java files.
Basically what you need to do to track an action is to:
Create a new instance of SimplePiwikTracker
Feed it with whatever values and parameters you wish to track using the various setters available
When you're done, get the URL using one of the methods defined in the PiwikTracker interface, depending of the type of "event" you want to track
Send a request to that URL to actually track your action into you Piwik instance.
This has several drawbacks:
If you need bulk tracking, you'll have to figure out a way of doing so. The web tracking API reference states you can use use a HTTP POST request containing a JSON object to do it.
It doesn't provide any help to handle the case where user is offline. If you need to, you'll have to find a way to cache your tracking request (in an sqlite database for example) and bulk send them when the user is back online.
You'll need to handle possible exceptions raised by network error for the tracking request, to make tat tracking does not interfere with your app normal behavior.
Be sure to read this article too. It gives you an overview of what you need to do to get up & running.
This is what I understood so far. I may update this answer as I progress in implementing piwik tracking in my own app.
Good luck.
Edit: I just noticed that Piwik released "Piwik SDK Android". There are some instruction on how to get this working in the project's wiki.

Put some values on internet to access from android

In my app a user can (only) see the values uploaded by admin.
For example. A salesman is using the app will be able to see the latest rate provided by the manger to trade.
Now the question is "where to put these values?"
I have .net webservice experience with android but I guess it wont work in this scenario,will it?
Any suggestion that the returned result be in (preferably) XML format.
It sounds like you already know how to do this. You can download and parse xml within your app. If you alreayd know how to set up the websever, the rest is easy. Limiting who can see what is just a matter of associating specific transactions with an individuals account. Then just have the phone check for updates on that transaction when the app loads (using someting like AsyncTask) or if you want to get more complicated you could push notificatinos using the android cloud service, or even use a REST model. More details are needed for a more specific answer but you can do what you want.
You can do it on your own, and build a webserver with a MySQL/PHP JSON API or you can use parse.com for a smaller project.

How to use Tmdb API or any other API

i am a newbie android coder.
i am writing a practicing app to search Movie name. I have made XML and java which has a textbox for user to type movies name, but i don't know how to search this over internet!
as i know i have to use IMDb or TMDb API, but i have no idea how to use it! i found this site :
http://www.javacodegeeks.com/2010/10/android-full-app-part-2-using-http-api.html
but there is no explanation for codes. and also i didn't found any other learning.
can somebody please write a full explanation for how to use IMDb or TMDb API for newbie?
it would be a great help to new coders like me! :)
you are most likely going to interact with these api using HttpClient. Go thru those examples first, like pulling in twitter feeds etc. Then you will be ready for the specifics of IMDb. So you are going to have to
1) Determine the base request url. Maybe it is imdb.com/api (it will be in the documentation).
2) you might need to sign up for a key which you will pass over as a parameter. (also in the documentation)
3) read the documentation to determine if you are going to use get/post since it effects how you encode the parameters. One of those parameters might be the key or you might not need a key.
4) In general you should try first in browser client before writing code, just to see what is returned. Then do the same in your code before processing.
5) all http clients are much the same, but determine what you are getting back. Is is JSON, use simple_json to parse. Is it XML, then probably use a SAXParser to handle what is returned. If you have specific questions please post them. The best we can do is give you sort of an algorithm like this as to how you go about it.
Thats really all there is to it. Just make sure you know the right url, if there is a key, if the communication is via get or post, if they are using REST you will encode url without parameters usually. Then its just a matter of parsing what you get back.
The real answer is take it one step at a time. At each step, ask if you have questions. The truth is unless we have used a particular protocol no one knows up front. Trust me, just take it one step at a time, and you will be able to handle any http api.

Storing 'pairing' information with Google TV 'Anymote Protocol'

I've implemented an application based off of the BlackJackRemote in the google-tv-samples (https://code.google.com/p/googletv-android-samples/source/browse/) and am having to pair the application to the GTV with every session. I've looked through the open source Google TV Remote application but it looks like it requires pairing each session as well. Is there something built into the AnymoteLibrary to retain paired sessions, or some pointers on implementing something like that myself?
My intuition is that I'll need to modify the AnymoteLibrary directly to get this functionality, but maybe it's already available and I've overlooked it.
Yes. It is possible. Infact The Google TV remote app does not make you pair everytime you open the app. Its only when the connection is lost that you need to pair again. The same can be replicated in the AnymoteLibrary. I am planning to release an update to the library for it soon.
The creator of Able Remote made a very nice library to handle this sort of thing:
https://github.com/entertailion/Anymote-for-Java (pure Java implementation of Anymote)
https://github.com/entertailion/Android-Anymote (Android project that uses said implementation)

Is there a way to track how many users open your app(hourly,daily,etc)?

So does anyone know if there is a program that will allow me to track how many times my app is opened daily?
I'm not looking to track the users behavior or anything, I just what stats on the average use of my app.
To know this you need to send information to a server somehow. On the device you would need some kind of library or code that posts this information. On the server you need some service that receives it.
There's a number of tools that let you do that. Analytics tools for example: http://code.google.com/mobile/analytics/docs/
If you don't want to use a pre-made tool you could simply use an HttpClient and you could make a simple Servlet on the server that dumps the use count into a database.
Tow more details:
1- Make sure you ask the user for permission the first time he runs your app. This could be problematic for him because of privacy and bandwith.
2- I would batch this and send it to the server once per day (midnight).
I hope this helps.
Emmanuel
If want something easy to implement, you can use http://www.localytics.com/ I've used it for a couple of apps and it works really well.

Categories

Resources