I am writing a library project which can be installed across multiple apps.
In order for the library to function it needs to download files. My goal is to download the files once and share them across other instances of my library in other apps. (I want to save the network traffic), how do I achieve this. Public external storage is not an option for me.
If you want to share functionality between different android applications, you should implement the Inter-Process Communication (IPC) between them.
Since android applications are actually sandboxed linux processes, they do not have access to each other's private data and files.
In the domain of Android development, there are two ways to implement IPC :
Messengers and AIDL ( Android Interface Definiton Language), which both make use of the bound services in application.
I recommend you to start studying the aformentioned documents to get a big picture on the subject.
Related
I'm making an android application with some features, but I think some people didn't need some features available, so I want to make this app with some main features and some downloadable features.
Example : I have 10 features in my app, 5 features is main features, so it will available for all users app, and 5 other features is downloadable features, only users who download this features can use this features.
So is there any way to do this?
From what I was thinking is maybe :
Using cloud server, maybe Google app engine,
Using a WebView on my android app,
Downloading java class resources and image manually, and then put it in specific android directory, so the apps can access the new plug-in features.
I really hope no.3 is possible, can we do this? if yes, can you share some tutorial about it.
From what I know, desktop apps can use this method, especially for open-source apps.
Thank you.
You might want to take a look at Dynamic Delivery with split APKs.
With that you can deliver a Base APK (your main features) and several Feature APKs!
" Dynamic feature APKs: Each of these APKs contains code and resources for a feature of your app that you modularize using dynamic feature modules. Through Dynamic Delivery, you can then customize how and when that feature is downloaded onto a device. For example, using the Play Core Library, dynamic APKs may be installed on demand after the base APK is installed on the device to provide additional functionality to the user. Consider a chat app that downloads and installs the ability to capture and send photos only when the user requests to use that functionality. Because dynamic features may not be available at install time, you should include any common code and resources in the base APK. That is, your dynamic feature should assume that code and resources of only the base APK are available at install time. Google Play generates dynamic feature APKs for your app from your project’s dynamic feature modules. "
(From Android Developers)
Is it possible to integrate a third party app with the already available Point of Sale Systems present in retails/restaurants?
Do they expose their APIs or any such thing where I will be able to integrate my system with them. Any help would be appreciated.
No doubt, we can develop applications for them using Android. But, basically all the restaurants, retails don't use the same Software, that depends on them, which resource they are using. And we can't say whether they are exposing their API to develop the Android application or not. To make android application for those type of applications we need to talk with the application provider or we need to design our own API.
I recently read a blog post by the Gmail team on the approach they used to develop the different platform versions for Inbox for Gmail. The short story is that they write everything in Java (so basically for Android) but separate all the UI code from the shared logic code. Then for iOS they reimplement the UI in a platform specific iOS manner but use a program they developed (and open sourced) called J2ObjC to convert the shared logic from Java to Objective C.
I understand how to get this working on the iOS but how should I arrange the classes on the Android? I understand that I need to create separate classes for the different parts of the shared logic but how do I this practically so that a) all the shared logic is in its own directory so I can easily reference it on it's own and b) I can still reference it from my activities.
Based on my searches I think I need to use the MVP pattern but I'm not 100% sure.
I put the model logic in a separate project with no Android dependencies. Another project depends on the shared project and contains the user interface and builds the Android project.
I have the impression that the Google App Engine allows an interface for developers to make use of Google's servers for storing custom application data in a highly scalable and cost effective way. Whilst working through their tutorials, it seems like tools are focused on aiding the development of 'web applications'.
I'm looking to take advantage of the GAE in order to serve data for a platform independent desktop application that I'm writing in Java, so my end product will not rest within the confines of a browser. Is this functionality supported by the GAE?
Yea! you can do that.
So basically, you are going to build a native application and use API calls to send/receive data from a server(GAE). I see a good solution will be to
Build your API endpoints using the Endpoints lib https://cloud.google.com/appengine/docs/java/endpoints
Then, depending on your application you can make API calls directly or build a client library
is it possible to create java libraries the apps can use shared?
It is totally clear to me how to create a library project and how to use it while shared between several another projects, compile each project into different apps.
But in this case the library gets compiled into each app separated.
What I want is to create a library, compile it, install it into the device (or emulator) and several apps calling into this library.
And when it is needed to change something the apps use shard in this library, I just re-work the library, re-compile it, replace it on device (or emulator), and the apps use the new library, all apps use the new functions.
Is it possible?
I googled it, but I couldn't find the solution.
I am using Win + Eclipse, I can't use native code (since I know only Java).
Thanks
UPDATE: Thank you for your suggestions, I know about using Services and Activities started explicitly in order to share functionality.
I asked about libraries because I am investigating the possibilites. If there is no way to use common library, what is the purpose of uses-library... in the app manifest?
Thank you
It's more likely that you need a service as a library. Have you considered this possibility? You can create it as a separate application, define an interface for your service and use it in other apps. So as the interface does not change this will not influence on other apps that depends on this service.
The Android model installs each application as a separate user (UID) on the device and the users have no access to other application's/user's files. Therefore, you can't share libraries as such.
As Yury suggested, you might need a service or an activity that can be invoked from multiple applications.