Extend/ Modify Sencha Touch 2 Native Packaging for Android - android

How is it possible to modify and extend the Sencha Touch 2 Native Packaging for Android (see http://docs.sencha.com/touch/2-0/#!/guide/native_android)? I want to add a Push functionality to the Android Project.

IMO, you should use cordova(phonegap). With that, you'll get plugins to add push in your app. As far as I know, there's no way you can use PUSH with Sencha Touch itself. To work with Push you must have a device id. Sencha can not give you that (unless you manage to call functions inside your activity from javascript). Moreover, you need to have a broadcast receiver set up to listen to incoming push messages. Basically, there's bunch of to-do's involved in using Push, so you can not simply automate that job and let native packaging do it.
Modifying/extending sencha tools native packaging is not simply worth it considering time and efforts that would take (if possible).

You should check out http://www.pubnub.com/ they have Javascript client to do listen to a queue and using that you can extecute whatever you want once message is pushed.

Related

Native android background module for react native

I want to write a android native module which work as a background service and get current location and post to server and then integrate that module with react native.
if you just want it for the location then i suggest react-native-workers
it has access to native modules (network, geolocation, storage ...) you can aslo integrate it with react-native-queue
There are a couple of example projects / demo apps you might want to check out which implement both "Foreground Services" and "Background Services" in Android to help you get location updates while the app is closed or the screen is off. The background service example will only allow you to get updates as frequent as 1 minute, while the foreground service example will allow you to get updates as fast as 1 second (or maybe faster, I haven't tested that yet) while also displaying an "Ongoing Notification" to the user.
Background Service Example: https://github.com/comoser/rn-background-location
Foreground Service Example: https://github.com/andersryanc/ReactNative-LocationSample
There are a number of Android specific code adjustments you will need to make in either case. It's not ready yet, but in the near future I plan to update my repo's readme with a detailed set of instructions for implementing the necessary changes in your project.

How to stream mic data between flutter and platform?

I been trying to figure out how to stream mic data from the android to flutter. I found some example code on how to query mic in chucks but I do not know a way to get the data onto flutter.
https://github.com/bitplane/Microphone/blob/master/src/net/bitplane/android/microphone/MicrophoneService.java
I am not sure which classes to look in flutter
https://docs.flutter.io/flutter/services/EventChannel/receiveBroadcastStream.html
I wonder if anyone can help me point to the right direction.
I been digging through example plugins in flutter github and found this.
https://github.com/flutter/plugins/tree/master/packages/sensors
Unfortunately for me, EventChannel documentation is sparse. I do not believe we can pass streams from flutter to the platform so I can replay whatever I recorded in a feedback loop.
Event callback. Supports dual use: Producers of events to be sent to Flutter act as clients of this interface for sending events. Consumers of events sent from Flutter implement this interface for handling received events (the latter facility has not been implemented yet).
https://docs.flutter.io/javadoc/io/flutter/plugin/common/EventChannel.EventSink.html
The process is similar to creating a methodchannel, but I need to create an onCancel and onListen in android. Within the onListen, I must create also listener that could receive events. If I want to create audio events, I must use setPositionNotificationPeriod(int) and OnRecordPositionUpdateListener(listener).
https://developer.android.com/reference/android/media/AudioRecord.html
https://github.com/flutter/plugins/blob/master/packages/sensors/android/src/main/java/io/flutter/plugins/sensors/SensorsPlugin.java
On flutter I must create a broadcast stream event
https://github.com/flutter/plugins/blob/master/packages/sensors/lib/sensors.dart
I manage to write my own terrible plugin that is android only atm. If anyone needs it I wonder what permissive license I should add
https://github.com/hungrymonkey/mic_stream

Android implement automatisation

Everyone knows Tasker.
The optimal way to use Tasker would be to create a Plugin. But then you can't use other automation Apps like Llama (except you also build a plugin for them of course).
I saw a clever workaround for this. since nearly all automatisation Apps are able to start Intends, some Apps like the one for Franco.Kernel or ElementalX have classes which can be startet from such Apps to do Stuff. For ElementalX it looks like this: flar2.elementalxkernel.powersaver.DISABLE_POWERSAVE.
I like this idea and want to implement this to!
but I have some questions...
Are these just normal classes like every other Activity and Class in my Project?
How do I get my Context in those Classes?
Can those classes access all other functions and SharedPrefs in my App?
Is it possible to hand over parameters like Ints or Strings?
What else do I need to keep in mind?
The example you gave is an intent from the application ElementalX Kernel (now replaced by EX Kernel Manager)
The intent is made public by adding android:exported=“true” to the app's manifest. This means other apps like Tasker can use it.
Within the ElementalX Kernel app, there is a broadcast receiver that listens for this intent. When the intent is used, it triggers further actions. In your example, when the intent flar2.elementalxkernel.powersaver.DISABLE_POWERSAVE is broadcast, the app will receive the broadcast and call the methods that disable powersave mode.

how to control outgoing intnet in android?

is it possible to access and control all outgoing intent from my app?
i use some library in my project that sends intent to start other app (for ads) because that library is compiled i have no access to the source code.
i wonder if there is any way to block or control all intent sent by my app.
if you know any other way to prevent that app to start (ads) please tell me.
i think because my app start the other app, there is a way to stop it.
You might be able to use reflection on the library and hook the google API calls but you have to check the licensing scheme for the added library so that you do not do something illegal.

How to send SMS in Qt for Android?

What is the official API in Qt5.2 (which started supporting Android and iOS officially) for sending text messages? or generally the Messaging API.
Currently Qt mostly work for GUI only stuff on Android. To be able to do what you want you have to call Java code from C++. I suggest you start of by extending QtActivity (and call super on the functions already implemented like onCreate() etc.). Then you would have to code using the Android SMS Manager class.
More information and an example on how to call Java code from C++/Qt can be found here.
This should get you started if you decide to proceed.

Categories

Resources