Yeah, API levels and Permissions belong the Android systems are pain in the ass, even Java is outdated and shitty syntax to read like @Override and class with inside of function.
However, NativeScript is fucking awesome, basically if you port Java shitty code to Javascript which is very easy to do UI.
https://www.nativescript.org
You showed me PhoneStateListener, I make an example as incoming call like this:
It's ugly code, however it can be ported to Javascript with Nativescript.Code:private class CallStateListener extends PhoneStateListener { @Override public void onCallStateChanged(int state, String incomingNumber) { } } tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE); tm.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE);
It looks nice, you can integrate any elements as UI including getting phone state and incoming number.Code:var callStateListener = android.telephony.PhoneStateListener.extend({ onCallStateChanged: function (state, incomingNumber) { } var application = require("application"); var tm = application.android.context.getSystemService(android.content.Context.TELEPHONY_SERVICE); tm.listen(new callStateListener(), android.telephony.PhoneStateListener.LISTEN_CALL_STATE);
Results 1 to 30 of 97
Threaded View
-
03-18-2018
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)