How to embed a mobile application in other application? - android

I'm building a mobile application for a company and I need to add in the company mobile application a button that go directly in a different application .
Anyone know a solution to embed 1 mobile app in other app???

Inside the code of your button, you can launch an explicit/implicit intent that can launch another application (authored by someone else). The application won't be running inside your application, but to the user, he/she will have the illusion that the other application running is part of your own. This is assuming of course that the second application is already installed on the user's phone. If it isn't installed, your button can just fetch the relevant application's installation page from Google Play for the user to install the app, and then run the application once installed.
In your application, you can also provide a content provider to keep your data. A content provider provider exposes a set of public CRUD interfaces to your data for other applications to access. This is how the contacts database is shared on Android for instance between many different applications, even non-Google applications.
Basically, you first need start at the beginning and educate yourself on the fundamentals of Android. If you start reading about intents and content providers, those constructs may not make any sense to you until you first learn about Activities, the Activity's lifecycle, stacks/tasks, and the way security generally works on Android. You may even want to look on Youtube, there are some very good highly rated Google I/O videos on there that talk about the fundamental concepts of Android.

Related

Is it possible to access the currently opened browser tab from an android application?

If I create an application, which the user installs on his Android device, is it possible for that application, that from the background, it can access the currently opened browser tab, and if the user navigates to a specific domain with his browser, the app sends a push notification, or maybe notifies the user about a promotion on that domain?
well, for usual apps this isn't possible for security reasons obviusly. but it probably may be done using AccessibilityService. note that Google is filtering apps which have such big privileges and won't let your app to Play Store if it will be using AccessibilityService to such "trivial" operation (isn't very helpful, for sure isn't accessibility-kind-of)

Best way to manage ios and android applications simultaneously

When I build a web application, like most others, I simply build an admin area from which the client can control their site.
Most applications I build for android never require this kind of maintenance as they are all self contained. However Something I'm extremely curious about, say you build a cross platform application that does require constant maintenance; you've got 2 versions - an iOS and android version. What would be the best way to go about managing both applications from the same place?
For examples sake, let's say you build a real simple application. It could be something that once a day sends you a message, "hope you're day is going well" or "let me tell you a joke". Now what if those messages were hand typed and submitted to the applications, you want to log into a system, type the daily message in and both applications are simultaneously updated with the new message.
In my head I'm imagining you would need to build a dedicated admin system either as a web application or standalone desktop application that connects to the apps hosted database however I'm wondering about how well that would work, what kind of problems are you going to run Into, would it even be feesable?
I've never had to build something like this but some of the more recent web applications I've built would work well as straight forward applications and that just gets me thinking, if I was asked to turn them into apps that function the way they do already, what would be the best way?
It's something I'm really curious about and feel like I need to get my understanding on the right track.
I think you are describing an application for an admin that will set up (write) data to be used by users of Android and IOS apps. Few options:
Write the admin application as a regular web application. Be careful to use transactions in the code that writes to the database. That is to avoid inconsistent DB states when your admin applications DB writes interleave between mobile app reads. Also you have to secure the admin REST resources (API end points) for admin access only, so you would need authorization code in the app.
Write admin apps for the mobile platforms (or an admin section in the existing app that is properly authorized in the app code) and the server API end points. That is more tedious because of 2 platforms. Again you will need the DB transactions and authorization code
Write separate admin apps for mobile but with one framework (Xamarin). It will work for simple apps and yours sounds simple enough for Xamarin to work well.

Calling activity from another app that stores data

I am currently developing a set of three standalone Apps for Android. One of these Apps provides functionality that - if this App is installed on a device - can be called by the other two apps. This specific activity collects some data and stores it in an SQLite DB. Since I am rather new to Android development I'd like to know the following:
If I call an external activity from within my App, does this activity act as if it were still part of its "originating" App and thus accesses data managed by the originating App? That's what I think is happening but I want to be sure before I design my Apps that way.
Thanks for helping out
Sven
If I call an external activity from within my App, does this activity act as if it were still part of its "originating" App and thus accesses data managed by the originating App? That's what I think is happening but I want to be sure before I design my Apps that way.
this activity will run in its own process. This means that if its process was not yet created, then it will be created for this activity.
If you are the owner of all your apps and want them to share data you might be interested in this manifest option:
http://developer.android.com/guide/topics/manifest/manifest-element.html#uid
android:sharedUserId
The name of a Linux user ID that will be shared with other applications. By default, Android assigns each application its own
unique user ID. However, if this attribute is set to the same value
for two or more applications, they will all share the same ID —
provided that they are also signed by the same certificate.
Application with the same user ID can access each other's data and, if
desired, run in the same process.

How to get the content of running applications in Android?

I want to make a application that has similar function as Android Beam, but the question is how to get the content of those running apps. For example, if the web browser, Youtube and Google Map is running, how do I get the web address, the video link and the location? Thank You.
You will only be able to get information like this if the running application provides it through some sort of global access method, e.g. a service or content provider. It is highly unlikely that any application will do this as it has some serious security/privacy implications.
You will only be able to develop such an application by writing a system application aka you'll need root permissions.
The best approach in my opinion will be that you look through the Android Beam source code, to see how it's done there. The official API will not help you here. Since the functions used in such system applications is not in the API there is no guarantee that it will work with future versions of Android, so be careful.
I doubt that this will be an easy task. If it's really similar to Android Beam, try building your code on top of the official source.
For Android Beam, the app itself is sharing the data. The NFC background service gets the data to be shared via Android Beam delivered to it by the app's Activities. An Activity either calls at the beginning (e.g. in onResume()) the method NfcAdapter.setNdefPushMessage() to share a static piece of data or it calls NfcAdapter.setNdefPushMessageCallback() to register a callback that will create the data to be shared at the moment Android Beam becomes active.
A number of the standard Android and Google apps have been extended to support this in Android 4.0 ICS, for example Browser, Gmail, Maps, People and Youtube. Apps that have no support for this, will by default share a link to the download page of that app in the Google Play store.

How Android ensures security?

I am just starting on Android development. To my nascent knowledge, it seems that anybody can grab any personal info and modify it or phone it home. Like with ContactContentProvider. I know these(permissions) have to be specifically declared in application manifest and the user would be presented with this info during installation. But still how would you you know the application handling your private data is not going to go rouge on it?
Example:
Suppose I create an app with internet
and contact-reading permissions. It
claims that it will backup contacts on
a server specified by user. While
secretly it also copies them to your
own server.
It's no different than you developing an app that does it that runs on a PC, or something that uses your gmail login to see if there's others you know on the same site.
It's all about trust. Also the Apple approval process doesn't safeguard against any of this if you hide it and when found out malicious apps can be killed & uninstalled instantly.

Categories

Resources