Use JavaScript for sending/reading sms on Android phones? - javascript

I use PhoneGap for developing native apps on Android platform. Previously there used to be a Javascript function for doing that. But currently that function is not included in the their API. Is there a plugin or any another JS based API which I can use to send/read/delete sms on an Android phone.
Plus: Can I get access to the folder where the smses are stored on an android phone?
PS: I know the URI way of sending sms so that wont count as an answer

Is there a plugin or any another JS based API which I can use to send/read/delete sms on an Android phone.
There is no support in the Android SDK for "read/delete sms". You are welcome to write a PhoneGap plugin for Android that ties to SmsManager to send SMSes, though.
Plus: Can I get access to the folder where the smses are stored on an android phone?
For starters, there are many SMS clients, and so there are many different stores for the SMSes. I am not aware of any SMS client that offers an API for manipulating those messages. Certainly, the Messaging app from the Android open source project does not have a documented and supported API.

you can access the sms database if you have ("root") its etc/data/data/telephony/mmsm.db or something like that depending on your version google
directory of sms database in android 4.0 then you can use es file explorer or another file manager to access this database...
you can also view deleted sms in this database...

Related

Does a non-mobile DJI Drone SDK exist?

I can see that DJI has a drone SDK for mobile apps (iOS/Android), but I would like to pilot the device from client-side JavaScript or desktop C#. Preferably some type of REST api that can be addressed by any language.
Does something like that exist? I don't see anything obvious on their website.
Did you find the DJI Onboard SDK?
It has sample programs for Qt, Linux, and STM32.
You could use the desktop app/web app to send commands to an MQTT server. You would then need to write a simple mobile app to connect to the MQTT server and subscribe to the command channel.
Then as commands come in via your various applications (desktop, web, etc) you translate the commands received from MQTT to the specific DJI SDK commands and send them to the UAV.
If you're looking to straight up control the drone without being connected to the RC controller or a mobile device, then the only option is the onboard SDK. If you are just looking for a way to run code on the drone directly, you would need to go through either the mobile SDK or onboard. There would be no way to do so without onboard or mobile sdk, you would need some device to communicate with your application and transfer those commands to the drone via onboard sdk or just write an android or ios application for the mobile sdk.
Just buy Blue stack emulator for Windows to simulate Android OS. Better option is to explore docker on Windows and spin some android docker container. It is free to host it in Azure also with database inside.

equivalent ios library for RTCMultiConnection in java script

I am working on webRTC iOS integration. Our Web team integrated the webrtc using RTCMultiConnection library (https://cdn.webrtc-experiment.com:443/rmc3.min.js) and created the Web Application. They are setting the socket url (server url) and configuring the library objects and creating the session using the library.
Is there any equivalent library for making the connection directly from client? Or is it possible to access the .js file from swift?
Please check the RTCMultiConnection-API:
https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/ios-android.md
Above doc explains how to create a cordova-based iOS/Android application.
Everything from RTCMultiConnection-v3 is supported in cordova-apps except "Screen-Capturing". You can NOT capture your screen from any iOS/Android app.
The ONLY_Disadvantage of Cordova_based_apps is "It adds 20MB unwanted Size in the compiled iOS/Android app" .... i.e. your APK file may have 20MB minimum size.
Here is an example APK file (android-application using RTCMultiConnection v3):
https://play.google.com/store/apps/details?id=com.webrtc.experiment

https network call ssl implementation using Javascript (Cordova)

In my cordova application, I am using https api calls using java script. In android platform it is working as expected. But the iOS api was not working with my iPad. When I investigated more, I found that it is related to ssl habndshake. I have added the following method to my app delegate
#implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host{
return YES;
}
Now the api is working fine. But came to know that this is not recommended when application is uploaded to iTunes store. In native applications apple recommends to implement NSURLProtectionSpace api. I wish to know how this can be accomplished in cordova platform?

Database for 2 android apps (one Java, the other Javascript)

I'm currently developing an app (via Intel XDK) that reads a .csv file that was created by another app (via Android Studio). The Android Studio app is mainly for capturing sensor data, whereas the Intel XDK app should display the data fancily. Since saving everything as .csv and reading it all later on is incredibly naive performance and storage-wise, I was thinking about creating a database that manages the data. Now, setting up a database for each app seems easy enough, and there are also solutions for two Android Studio apps. But how can I create and manage a database that can be used by an Android Studio as well as by an Intel XDK app?
OK, I think you want to have your Native Android Database to be accessible from another Application so your solution will be ContentProviders.
You should build a ContentProvider layer above your SQLite database in the native android application then you can easily contact the ContentProvider from any other application included PhoneGap or any cross platform one.
To learn more about ContentProviders in android check that.
To learn how to expose or use ContentProvider from CrossPlatform phonegapp applications check that.
You can use the Content Provider mechanism of Android, as described in http://developer.android.com/guide/topics/providers/content-providers.html.
You decide on one of the two apps to actually manage the database and play the role of content provider to the other. The other accesses the data via the interface provided by the content provider.
This works if both apps are on the same device. For cross-device synchronization of data look at Couchbase Lite, a database that offers this feature out-of-the-box.

Can a website (HTML5,JavaScript) access a mobile device's (android/iPhone) contact list, SDCard files

Can a website (HTML5,JavaScript) access a mobile device's (android/iPhone)
contact list, SDCard files?
A website as in one opened in a browser not a phonegap application/webapp.
There was an attempt at the W3C to create a browser API to access contacts from the browser.
This is often mentioned as one of the new HTML5 APIs.
However the attempt never became a real specification and never got implemented by any browser vendors. Now it is officially discontinued:
http://www.w3.org/TR/contacts-api/
You can't access the mobile device file system through a website, it would be a major security problem. You might be able to steal all user files if you can access them through the browser. Hope this helps.
At this point in time there is no way to access the internal APIs from Android, iOS and Windows Phone via a simple website. This also precludes you from accessing aspects such as the contact list because these are all only accessible via API calls.
Solutions that allow you to code phone apps or web apps in JavaScript or HTML5 and still grant access to APIs do so by utilizing a wrapper with calls back to the native code. But you can't call native code from an external source such as a website.
Chrome has since shipped their own version of a "Contact Picker" HTML5 API in Chrome 80: https://web.dev/contact-picker.
Chrome only: it is not a W3C Standard nor is it on the W3C Standards Track.
selectRecipientsButton.addEventListener('click', async () => {
const contacts = await navigator.contacts.select(['name', 'email'], {multiple: true});
if (!contacts.length) {
// No contacts were selected in the picker.
return;
}
// Use the names and e-mail addresses in |contacts| to populate the
// recipients field in the website’s UI.
populateRecipients(contacts);
});
Am not so sure if the author of this question will still be interested in a solution but I use this on my apps, its really a handy way of access native api from html5 apps. http://bridgeit.mobi/bridgeit.html#features
BridgeIt enables any web application to access a wide range of mobile device capabilities using a simple JavaScript API.
Using this tool is as easy as 1, 2, 3…
Include the BridgeIt JavaScript in your page
<script type="text/javascript" src="http://api.bridgeit.mobi/bridgeit/bridgeit.js"></script>
Attach a BridgeIt call to some action element on your page, and provide a callback to handle returned values from BridgeIt. For instance, a button to retrieve a contact from the address book...
bridgeit.fetchContact('element_ID', callback_Function);
Access the page from your mobile browser. If the BridgeIt utility app is not already installed, you will be prompted to do so. Once the BridgeIt utility app is installed, your application can access all of BridgeIt's native features.
Example code can be found here https://github.com/bridgeit/bridgeit.js/wiki/Contact-List-Tutorial
https://developers.google.com/people/
You can't access Contacts by website stored on phone, but you can do it server side using People API. If user stored everything on the cloud - you win. Perhaps this is only way to provide native-like experience on your website
You can access address book using Autofill feature of safari browser in iOS devices (but settings > safari > autofill > contact info must be turn on). And the name field in must be "name, email, phone, tel, etc" to get autofill works properly. It works only in Safari but not in other browsers.
Using pure HTML
<input type="file">
you can access files from mobile device,but you cant access contact.

Categories

Resources