I'm currently trying to make a cordova app for android.
The end goal is to make an app that will unlock a door when the phone come near it. To achieve this, I believe that I need to setup a custom plugins that will handle the interaction with the door.
So far I got the basic of the application. I got the cordova interface with a bluetooth plugin that let me detect the door(in my case any bluetooth device that emulate it), I can stock the bluetooth ID in the local storage. I'm able to connect to it and send/receive data.
What I need to know, is how can I declare a background service that will be wake up by the system, that doesn't involve the UI nor the mainActivity (since I don't have access to it with cordova)
I'm not sure how must I declare the service, how must I register it so that the system will know it must not wake up the app (because the cordova core will do nothing with it) but only the plugin class that will by able to handle it.
I was looking at android beacon library but I didn't know how to integrate it in a plugin since they register the thing in the main class of the application in the onCreate (I don't think I have access to that in cordova)
Any help would be really helpfull. Thank in advance!
Related
does anyone have any idea how to make an app that automates and filter rideshare/restaurant apps requests? It's kinda working as an umbrella for more than one app.
for example, the XYZ app will be in the foreground and will monitor both Uber Eats and Postmate in the background and whenever requests are received it will show on the XYZ app screen with its details.
I believe it's not doable on the IOS but its existing on android on an app called Mystor. it uses somehow advisability functions in the phone but I want to understand the logic behind it and know how does it work?
I need to develop an app that should periodically check for available WiFi networks and trigger an action once an specific network is on range.
I plan to implement an Android service to handle the part on which it keeps checking for the available networks and make it broadcast a notification once the specific network is detected.
I'm wondering how to integrate that on a NativeScript App, what I mean is that I want to make the code on NativeScript subscribe to receive the notifications from the Android Service, and once it is received do something.
To be clear, I want the Service to be native (written on java) and somehow get it included on my NativeScript app, to make it interact with the GUI.
Thanks,
Well, it seems like there is quite a few resources regarding this subject:
mainly:
https://github.com/NativeScript/sample-android-background-services
https://www.nativescript.org/blog/using-android-background-services-in-nativescript
this might be useful (if you happen to have an error mentioning 'empty constructor'):
https://www.npmjs.com/package/nativescript-android-utils
you might be also interested in using web workers:
http://docs.nativescript.org/core-concepts/multithreading-model#multithreading-model
or extending an existing android app:
http://docs.nativescript.org/integration-with-existing-ios-and-android-apps/extend-existing-android-app
I am working on an android app built on apache cordova. The app used to send your location via SMS, Email & in app notification to your predefined contacts. I want this sharing event to be triggered on double tapping on screen (when locked) or 3-4 times pressing the power button/ volume button.
Its for emergency situation, when user may not be able to unlock phone & open app to share any info.
I've searched a lot but could not find any relevant info. is there any available plugin to do that? I know very little of JAVA. Expecting any plugin that would allow me to launch the app(any activity) when phone is locked.
Any helpful information or suggestions are appreciated.
To accomplish this kind of task, you need to run a service in background, it is not possible to use any cordova webview, so you won't be able to run any javascript.
I don't think there is any plugin doing such a thing as it is very specialized.
I needed to create an app that needed to send notification to the user depending on his location. It ended up in writing a native plugin...
So the best advice I can give you is "It's never too late to learn Java" ;-)
maybe some other JS framework (maybe NativeScript) allows such things but I never used it yet so it might be impossible too.
I'm currently working on a project using Cordova and the ionic framework. It will be available on iOs and Android.
I want to implement websockets on the project (the server-side is already done), and I basically know how to do that for the writting, but I'd like it to read, 'listen', on the websockets also when the app is not on foreground.
From what i saw in my researchs, I guess I will have to implement background services in both languages (Java and Swift), but if it's possible to avoid that....
The main problem is I don't really know where to start and my researchs didn't lead to a lot of results.
Thanks
EDIT: to be more precise, the part of the app that will use websockets is a chat, and I'd like to continue sending notifications when a message is received, even if the app is not on foreground.
I am writing a sample application for detecting iBeacons through android app. I am using the code from the following site https://github.com/AlvinBert/android-ibeacon-Jaalee-source-code
With the code from the above site i can able to detect ibeacons and send notifications. When i check the running apps, there is 1 Service running.
If i close my application, by long press the home key and remove my app from the Recent list, then i didn't get the notifications, but still 1 service is running.
I debug the code and found that "IncomingHandler" is not getting fired which is in the service inside the "com.communicate.ibeacon.service.IBeaconService" package.
I need this to be called continuously, even after the application closes. Since, i am new to android could you please point me what to do, to achieve this.
Thanks
Jai
The beacon library you mention is an unauthorized copy of the Pro Android iBeacon Library formerly provided by Radius Networks. As the original author of that library, I can confirm that it would not detect beacons after the app being killed until a power cycle of the phone takes place. Unfortunately, this library had been discontinued by my company over licensing issues.
Library issues aside, one approach you could take to accomplish your goal is to use Androud Broadcast Intents to automatically re-launch your app based on system events like power connected and disconnected. This will not relaunch immediately, but will typically do so once a day when a device is in normal use.