Create Multiple apps of the same project - java

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

Related

Updating java code from server

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.

How to "send" a variable from app to a different module?

I had an original stand alone java code, that could be used by multiple computers in order to find the answer in a distributed systems fashion. Alternatively, I could run everything I needed in eclipse by running a few projects at the same time, instead of one component in each computer.
Now I want to extend this project in Android Studio. The basic idea is that the user gives some input in the app and then ,after some processing, some output comes back.
I have tried using modules (since I cannot separate the different components with projects) and I have not been able to replicate my result.
My questions are :
Can different modules in Android Studio be run simultaneously, like
different projects in eclipse ? If not how can I find a solution ?
If yes, how can I make the modules and the app communicate between each other? e.g. I have an EditText, which I save it as a String variable. How can I send it to a different module for it to be processed or passed on to different modules ?
To the discussion in the comments seems you want to pass data from your computer (or a computer that I'll call server from now) to your Android app (that from now I'll call client).
What you are trying to achieve so is the client-server architecture (standard use):
client make a request of some data of the server
server sends data to client
client process data or show data to user
The decision about how the communication should be it's up to you. There are many possibilities (web-socket, custom API REST), but it's up to you and your capabilities.
Is it really hard to explain in just one answer the whole process from the code view, so I link here for the client part.
Also, this question could really help you.

Recieve constant updates from Google Drive API Android AppDataFolder?

I have created an Android application in which it is able to read files from the Google Drive Hidden AppData folder and react based on whether specific filenames are present.
I have created a separate external interface that creates a file in this folder and it seems to do it successfully.
The problem I have is that I can't seem to find a work around for having my android application constantly listening/receiving updates from the appdata folder.
The odd thing is, is that sometimes the application will pick up the file change straight away but other times it can take hours.
I'm convinced that Google's 'OnChangeSubscription' method they provide in the developer documentation doesn't actually work.
Any suggestions on methods I could try/where people have been successful at this would be great as I have been at it for weeks and it's the final thing I have left to do.

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...

Upgrade multiple apps to one app

I currently have a few apps in the Play Store about different ships. Is there a way to upgrade all these apps to one consolidated app?
It is not quite possible to do what you want since all your apps use a different package name. As Henry suggested, you can update all your apps and tell the user to install the new app.
The other (not so recommended) option would be to create your consolidated app and generate a different apk for each app you already have on the Store, modifying only the package name. All the users will be able to have the consolidated app without the need to install a new app. However, it is a bad approach since you will have many copies of the same app in the store, which may lead you into troubles (not so easy to maintain and probably problems with Google).

Categories

Resources