I ported my JavaFX application to my Android device. I want my application to read incoming SMS messages and store it in a database. I found several questions here in StackOverflow but I don't know how to implement in a JavaFX approach. Please help!
How to analyze incoming message (JavaFX on Android)
1.3k views Asked by The Well At
        	1
        	
        
	There are 1 answers
Related Questions in JAVA
- How do I customize NSOutlineView to have border color?
 - How to generate request format for WCF web service method for Mac and iPhone
 - How to Handle Command Line Prompt from a Cocoa App
 - Change views inside NSSplitViewController
 - CMYK NSImage get pixel data
 - Reactive Cocoa Conditional Split ?
 - Set background color of NSImageView with proportionally sized image
 - Use NSWindow or NSViewController?
 - Imports and includes in header files - when is it okay?
 - How to prevent the app from automatically open a window when launched?
 
Related Questions in JAVAFX
- How do I customize NSOutlineView to have border color?
 - How to generate request format for WCF web service method for Mac and iPhone
 - How to Handle Command Line Prompt from a Cocoa App
 - Change views inside NSSplitViewController
 - CMYK NSImage get pixel data
 - Reactive Cocoa Conditional Split ?
 - Set background color of NSImageView with proportionally sized image
 - Use NSWindow or NSViewController?
 - Imports and includes in header files - when is it okay?
 - How to prevent the app from automatically open a window when launched?
 
Related Questions in JAVAFX-2
- How do I customize NSOutlineView to have border color?
 - How to generate request format for WCF web service method for Mac and iPhone
 - How to Handle Command Line Prompt from a Cocoa App
 - Change views inside NSSplitViewController
 - CMYK NSImage get pixel data
 - Reactive Cocoa Conditional Split ?
 - Set background color of NSImageView with proportionally sized image
 - Use NSWindow or NSViewController?
 - Imports and includes in header files - when is it okay?
 - How to prevent the app from automatically open a window when launched?
 
Related Questions in JAVAFX-8
- How do I customize NSOutlineView to have border color?
 - How to generate request format for WCF web service method for Mac and iPhone
 - How to Handle Command Line Prompt from a Cocoa App
 - Change views inside NSSplitViewController
 - CMYK NSImage get pixel data
 - Reactive Cocoa Conditional Split ?
 - Set background color of NSImageView with proportionally sized image
 - Use NSWindow or NSViewController?
 - Imports and includes in header files - when is it okay?
 - How to prevent the app from automatically open a window when launched?
 
Related Questions in JAVAFXPORTS
- How do I customize NSOutlineView to have border color?
 - How to generate request format for WCF web service method for Mac and iPhone
 - How to Handle Command Line Prompt from a Cocoa App
 - Change views inside NSSplitViewController
 - CMYK NSImage get pixel data
 - Reactive Cocoa Conditional Split ?
 - Set background color of NSImageView with proportionally sized image
 - Use NSWindow or NSViewController?
 - Imports and includes in header files - when is it okay?
 - How to prevent the app from automatically open a window when launched?
 
Popular Questions
- How do I undo the most recent local commits in Git?
 - How can I remove a specific item from an array in JavaScript?
 - How do I delete a Git branch locally and remotely?
 - Find all files containing a specific text (string) on Linux?
 - How do I revert a Git repository to a previous commit?
 - How do I create an HTML button that acts like a link?
 - How do I check out a remote Git branch?
 - How do I force "git pull" to overwrite local files?
 - How do I list all files of a directory?
 - How to check whether a string contains a substring in JavaScript?
 - How do I redirect to another webpage?
 - How can I iterate over rows in a Pandas DataFrame?
 - How do I convert a String to an int in Java?
 - Does Python have a string 'contains' substring method?
 - How do I check if a string contains a specific word?
 
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
 - Is it possible to use adb commands to click on a view by finding its ID?
 - How to create a new web character symbol recognizable by html/javascript?
 - Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
 - Heap Gives Page Fault
 - Connect ffmpeg to Visual Studio 2008
 - Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
 - How to avoid default initialization of objects in std::vector?
 - second argument of the command line arguments in a format other than char** argv or char* argv[]
 - How to improve efficiency of algorithm which generates next lexicographic permutation?
 - Navigating to the another actvity app getting crash in android
 - How to read the particular message format in android and store in sqlite database?
 - Resetting inventory status after order is cancelled
 - Efficiently compute powers of X in SSE/AVX
 - Insert into an external database using ajax and php : POST 500 (Internal Server Error)
 
                        
These are the required steps to create and port a JavaFX application to an Android device, so you can track SMS messages, allowing:
Step 1
Using Gluon plugin for NetBeans create a new JavaFX project. Let's call it SMSTracker, with main class
org.jpereda.sms.SMSTrackerFX. Onbuild.gradle, update the jfxmobile plugin version to b9:First of all let's create
SMSMessage, a JavaFX pojo with our model:With ScenicBuilder and FXML or by code, create your UI. For this sample, it will be a simple UI with three main areas, for the three above mentioned options.
And this is what we have for now:
Step 2
Following HelloPlatform sample, we will add a
PlatformServiceclass and aPlatformProviderinterface, with the required services:This interface will be implemented on each of the three platforms (desktop, iOS and Android). Obviously, we'll focus only on the Android implementation.
This is the project view on NetBeans with all the packages and files involved:
Step 3
Let's implement now the services on Android. For that I've followed several great answers at SO: sending SMS, read inbox and listening to incoming SMS.
From the last one, we can crete a class that sets an
ObjectPropertywith anSMSMessageobject every time one is received:In order to launch this listener, we use
FXActivity, the class that extends the Android Context class and provides the access to the Android services, to register an instance ofSmsListener:Step 4
Finally, all we need to do is bind the property with our label on the UI and start the broadcast:
Note the use of
Platform.runLater()to update the label: the broadcast thread is different than the JavaFX thread.Step 5
The last step before building the apk consists on modifying the
AndroidManifest.xmlfile to ask for the required permissions.Since the jfxmobile-plugin creates one by default, running
gradlew androidat this stage will generate it. It is located underSMSTracker\build\javafxports\tmp\androidfolder.Copy it to another location (
SMSTracker\lib) and include its reference in thebuild.gradlefile:Now edit the file and add the required permissions and the receiver:
Save, build and run
gradlew androidInstallto upload the apk to your device.Full project
All the code for this application can be found here, including apk ready to be installed on Android devices.