Android : calling an url while app is on background - android

I have an app where I detect tags and my question is :
I want my app to do an action when detecting new tags, in this case, opening a webpage. It works without problems but only when the app is on the foreground, but I want it to work even when the app is running in the background. I read about Android Services but I'm not sure it is what I can use.
Can you give me directions to find a way to solve that problem?
Thank you very much

Please see AsyncTask from google documentation. Here is the link https://developer.android.com/training/best-background.html
This site has an example on it
http://www.sitepoint.com/scheduling-background-tasks-android/

Related

Is it possible to open native android clock app from web application?

I am looking for a way to open the native android alarm clock app when a user clicks on the link or button on a web browser of the android. So basically need to open the native android app from web application. I tried using intent://#Intent;package=com.android.deskclock;end' and it is not working. I am wondering if I am using the wrong package name or it is not even possible in android.
Thank you much for help!
According to this documentation, this is not possible. In particular, this footnote is the limiting factor:
Only activities that have the category filter, android.intent.category.BROWSABLE are able to be invoked using this method as it indicates that the application is safe to open from the Browser.
If you look at the AndroidManifest.xml for the DeskClock app, none of the activities contain the android.intent.category.BROWSABLE category filter, meaning none of them can be opened from the browser.
I have a suspicion that the problem is that you are not providing a URI path in your URL. It might need to be a path declared in the app's manifest. See: https://developer.chrome.com/multidevice/android/intents
This could change it to ie intent://path/#Intent;package=com.android.deskclock;end'
It might be helpful if you were to look at the javascript console when you try to click on that link in Chrome, there might be details of what went wrong.
Keep in mind that the alarm clock app is not necessarily consistent. Manufacturers can remove the default alarm clock app to replace it with a different one, or just modify the source code so that it has the same package name but different source code. You could try opening multiple package names from javascript depending on what happens when the intent can't be opened.
Welcome to code party
You can get a android device IFrame from appetize site.
This is the easiest way for show android apps in web applications.
Update me in comments ;)

Broadcast Receiver in Phonegap 'Build'

I'm trying to receive a link shared from another application like browser or youtube into my phonegap app. I'm using phonegap build (build.phonegap.com) to make my app.
I'd like to know how to make my app appear in the 'share' list for links.
All solutions I found online are making me edit Android Manifest or Java files, but is there a way (a plugin of sorts) I can use to make data transfer between apps possible?
There is a plugin available for PhoneGap which will handle receiving content from other application. You can use it. Following is the link to this plugin. https://www.npmjs.com/package/cordova-plugin-intent
If you find any issue or something else other than that functionality, you can make the custom plugin so that you will have direct access of java file from javascript.
If I understand your question correctly, you're talking about deep linking in android. The details about it can be found here
Correct me if I explain your ideas wrong: What you want to do is that you have an URL that showed up in another application (Ex: Facebook Messenger, Slack, ...) and you want after clicking it, a list of application that can be used to open that link appear and you want your app to be listed there.
But here is the problem, how can the OS knows what apps it can suggest to the end-user and what kind of link your is acceptable to your app? the answer lies in your application manifest and to be more precise, the intent-filter tag. It tells the OS what you kind of url you want and also use it to determine if the OS should suggest your app to be open by using that link for the user.
So the answer for your question about doing without editing Manifest is impossible. As for the reason why you don't want to edit your apps is unknown to me but I still suggest you to take a look at this tutorial. It still involves editing your manifest but the guide it self is clear and easy to implement.
Hope this help ^^

add another app inside my app?

my goal is to get a video from a usb connected device (an easycap video grabber) displayed. There is already an android app that does exactly that. However i need to add some buttons and some extra functions to it. So i came to the idea of displaying the app that already exists inside my app. Is that possible in any way?
I already tried to decompile the existing app to edit the code a bit but i didn't get anything to work with.
Do you have any other idea? If you know how to program that please let me know what i need to achieve that.
Thank you!
This cannot be done due to security reasons in the Android OS itself.
Android provides a security layer called the Sandbox in which the OS assigns a User ID for each app, so that an app will not have permission to access resources from another app.

How to handle and use the default application of android programatically

Can anyone explain me, how can I handle and use the default applications of my Android device programatically.
Also how can I get all the app information installed on my device and also unistalling them progromatically.
If possible kindly give me fews links to understand and using these things properly.
By "default app" I assume you mean a Home replacement. There is a Google sample here as well as ADW Launcher and also the source for the Android launcher

Regarding Multitasking in Android application

I want to launch more than one application at the same time.Like one application should run in the background when a new application is started, and I have to switch between those two application.
If anyone having the code to do this please help me.
Give some website links to know about the multitasking in android and how to achieve it.
If you want to run something in the background, you have to use a Service. Services are not killed except in extreme memory situations. Read the Application Fundamentals for more information.

Categories

Resources