Updating java code from server - java

I have an app that has an activity which allow users to download PDF files by selecting a PDF and clicking the download button.
The issue is: I don't want to always ask users to update the app when there's a new material available.
Is there a way I can update the .java code without always asking users to update the app?

Wrong design point.
You have probably hardcoded the PDF / file names in your Java application.
When these values are supposed to change, then well: don't hardcode them.
Instead you create a server side service that lists the available PDFs. And then your app uses that service in order to acquire that information.
Anything that is "dynamic" must not be hardcoded in your app itself. Instead your app knows how to fetch that piece of information from somewhere.
When the source code of your application changes, your users have to upgrade the app. It is that simple. The other way round: if you know about "changes" to your app that need to work without upgrading the app, then well: you have to design the whole app around that requirement.
A first starting point / further reading: see here.

Related

Create Multiple apps of the same project

I have been searching a lot for the best practice for my problem and didn't find anything useful so far.
My problem is:
I have platform that create E-commerce apps for the user and than we publish it for the users on the play store.
NOTE: each app have different name and maybe different google account.
Every time there's bug fix or new feature, we need to copy paste the same code in every project and then upload them again to the store.
My question is:
Is there's smarter way to deal with this ? i mean what if we have 100 app of the same project, that will be pain to update the code in all of them and than upload all APK's again.
Maybe there's way to update the classes and content dynamic ? or even some tool that can organize the whole thing or manage uploading the APK's ?
Thanks in advance.
You don't need to copy paste the same code in every project and you don't even need different google account.There is a process called white labelling apps in which you can manage unlimited apk from a single project. Just add all the clients in product flavours in gradle file with different application id. Follow the link attached for detailed procedure of white labelling
https://proandroiddev.com/advanced-android-flavors-part-1-building-white-label-apps-on-android-ade16af23bcf

Getting user behavior on the Android Phone (App History, Browse History etc)

Is it possible to get the user behavior on the phone (for example Alpesh has an Android phone and he uses multiple apps, browser YouTube etc). Whatever he is doing on the phone I want to get all those things from behind (which apps he has installed, which app he opens and what he search on the phone, All these data I want to get programmatically so what all can be get in android).
For now I am aware that installed apps list can be get easily but I want to get usage history and what he do all on mobile.
This is not a code solution, but an answer to your question, so you can get start some where.
In my opinion your question title are asking about two things.
(part 1) Getting User Behavior on the Android Phone (part 2)(App History, Browse
History etc)
1- First part Getting User Behavior on the Android Phone:
There is a concept called context awareness. Short described; it is about gathering different information from the phone, like light sensor, motion sensor, sound, location or even user behavior etc. and depending on your app requirement and the gathered information:
You could send these information over cloud data store for statically usage
You could make your phone doing (behavior) different things depending on location, motion or what ever.
etc.
For context awareness it is an open area for pervasive computing research. And it is not just few lines of code to write, it is typically a complete solution depending on requirement. Example I have built a context awareness application to gather noise collected by phones from different locations for research purpose inspired from this framework, but I am pretty sure you can find other frameworks or even build your own, as I did in my case.
The mentioned framework has some examples.
2- The second part is about App History, Browse History etc.:
This is possible, but you still need to build a peace of software (App) to collect all these information (logs) from the phone. Hereafter you can make phone act on different conditions and/or again send it over a RESTful API over cloud service data store, there is no limit for it.
The problem is, there is no thing out of the box for your requirement. Even if you find frameworks you still need to research it and further work on it.
You can find different examples for your requirement, like to collect browser history, you can find SO question here:
Get browser history and search result in android
Or get list of installed application:
How to get a list of installed android applications and pick one to run
My point here is you need to solve small goals at a time and put your knowledge together at the end.
Both 1 and 2 can also be related to each other, depending on your achievement.
Conclusion
Make a goal to your project.
Define the main requirements and tasks of your project.
Research your options (Technology, Cost, Target Audience, What data I can or I should not collect, what is possible to collect, what is the limits, Privacy issues etc.).
Split your project in small assets and try to solve small problems/goals.
Finally you would be able to put the puzzles together and build your final application
but i want to get usage history and what he do all on mobile
This is not possible and shouldn't ever be possible. Each app is sandboxed by Android so apps cannot inspect what other apps are doing. Think about it, you wouldn't want apps to be able to intercept private information such as banking details.
Every app is isolated from the other ones. Unless you develop a system signed app, you will not be able to gather all that data.
What you could do is to develop your own Android Rom where you then develop your data collection the exact way you want. Then you need to distribute your rom, which is another story...

pop up window when message selected in other app - Android

Is it possible to pop up a window for a selected text within another android app ?
for example a user is using some pdf reader and selects a word and a small window pops up that provides the options to highlight the text or Define and ... , I want to know is it possible to add another option to that window (or add a small window next to that) that defines the meaning using my dictionary app, not the pdf reader's dictionary?
basically I want to know if it is possible to have the user to use my dictionary app for all his needs , surfing web, reading pdf , looking up words directly ..
No, its not possible.
Only way of do that if you upload your app to Google Play and shared the options with other apps (using PendingIntents and Broadcast actions), but the code of other apps must use your code, you can not modify other app installed.
If I have understood your question correctly then NO.
It is not possible to edit the behavior of other apps with your own since then you would have to edit that apps source code. As far as I know the system does not provide any overhead setting for what your asking as it does for sharing things whith different apps (email, social media etc.)

Android Policy: External application files

Google Play Developer Program Policies says:
An app downloaded from Google Play may not modify, replace or update
its own APK binary code using any method other than Google Play's
update mechanism.
I want to publish my application to Google Play. And I been planing to load my core SWF file dynamically, so game updates could be done without the need of going to Google Play market. An alternative Java implementation can achieve the same thing by downloading remote jar file.
In both cases I will have the next limitations:
I cannot modify my Manifest file.
I cannot extend the application permissions that I asked
My external code is bounded to application sand box(Just as the rest of my application)
Notice that my external code is not part of the APK files. It will be stored in application folder or in external storage(SD-Card). Its same place where external assets is stored.
Does this violatating Google policy? I am not sure what they meant by "APK binary code".
I am not a lawyer, and I don't play one on TV...
Your best course of action is to look at the reason they included that phrase in the first place. That text now exists in the Google Play policy because Facebook did the very same thing that you are describing in their application (providing an auto-update mechanism outside the Play Store) earlier this year, and Google threatened banning the application until this "feature" was removed (which it was, shortly thereafter).
The spirit of the law in this case is that Google does not want applications updating themselves without the user's consent outside of the Play Store...period. If your application does this, you can bet Google won't care how you are doing it and will likely remove the application when and if the feature is discovered. They won't care how closely executable code in an external SWF file resembles the internal classes of the APK.
Legal language like this is is intentionally vague so companies can apply it in any situation they see fit. Don't think you're being safe by splitting hairs with the terminology.
I am not a lawyer. I see this restriction as limiting only the apk binaries. There are many apps that have dynamic behavior changes, for example Google search where the search results algorithm is determined by dynamic code on the server, or facebook which loads new images texts, layouts and more.
I think that as long as you do not do anything bad for users using the swf changes, you should be ok.
The purpose of this clause, as I understand it, is to prevent apps from loading and using code that was not tested by Google using the normal process that tests apps when published. Google want to ensure that all code is scanned/tested by their bots.

Android number of exact downloads

From what I know, you can't get the exact number of users which downloaded your app, unless you're connected to your Google plus account. Is that true? (I haven't yet got a google play (android market) account, my app isn't yet up on the market, so i just wanna make sure i'm saying valid things here.)
Is there any way i could programmatically get the number of downloads, preferably in real time?
From what I've found, there isn't an API for the market which let's me do this. So how can this be accomplished?
I need to take that value and in real time update a graph on my website and blog.
Can anyone come up with a workaround for this? One thing i was thinking of was: to either make a Firefox extension which on my home machine, automatically connects to my Google plus account, takes the required value and updates the page via ftp or something, or instead of Firefox extension i could use PHP locally to do the parsing and whatnot. But i'd need to keep my home machine always on, which i don't really want to.
Any other ideas? I really need that exact value, and i need it to be automated :)
When the user downloads the app, you could have it do a callback to a script on your site that does a tally for you. The app should, obviously, only call this on the first run (but, depending on how you implemented it, would probably be called on each refresh of the app's cache/data). If you don't have a service that needs registration, you could have it done in the background.
Not possible by default. The only figures that do exist are only updated daily at most.
You would need to devise your own way to count downloads such as requiring your users to register on your own service.

Categories

Resources