Send data via Bluetooth to Serial












0















I have an application running on Win that the JavaScript would capture the string from a webpage and wake up the cmd, cmd would have the parameter as below.




bridgetool.exe -c serial -p com1: -b 384000 -s string_from_webpage




bridgetool.exe is software that transfers the string into the RS232 String and sends the string via comport which defined in the CMD line.



-s is the string parameter from the webpage.



I want to do the same thing on Android. But instead of sending it via Serial, it would send the information via Bluetooth. And use a Bluetooth to the serial module to transfer this order.



I am not an Android programmer so before I start to work, I want to make sure that Android can do:




  • Is it possible to call terminal and pass the parameter in Android?


I understood that I can use some app to run a terminal command and send information via Bluetooth. But is it possible that an APP/Script can call the Terminal APP and pass the parameter? Like what I did on Windows. So the Terminal can transfer the parameter into an RS232 String and send it via Bluetooth?










share|improve this question













migrated from superuser.com Jan 7 at 21:17


This question came from our site for computer enthusiasts and power users.























    0















    I have an application running on Win that the JavaScript would capture the string from a webpage and wake up the cmd, cmd would have the parameter as below.




    bridgetool.exe -c serial -p com1: -b 384000 -s string_from_webpage




    bridgetool.exe is software that transfers the string into the RS232 String and sends the string via comport which defined in the CMD line.



    -s is the string parameter from the webpage.



    I want to do the same thing on Android. But instead of sending it via Serial, it would send the information via Bluetooth. And use a Bluetooth to the serial module to transfer this order.



    I am not an Android programmer so before I start to work, I want to make sure that Android can do:




    • Is it possible to call terminal and pass the parameter in Android?


    I understood that I can use some app to run a terminal command and send information via Bluetooth. But is it possible that an APP/Script can call the Terminal APP and pass the parameter? Like what I did on Windows. So the Terminal can transfer the parameter into an RS232 String and send it via Bluetooth?










    share|improve this question













    migrated from superuser.com Jan 7 at 21:17


    This question came from our site for computer enthusiasts and power users.





















      0












      0








      0








      I have an application running on Win that the JavaScript would capture the string from a webpage and wake up the cmd, cmd would have the parameter as below.




      bridgetool.exe -c serial -p com1: -b 384000 -s string_from_webpage




      bridgetool.exe is software that transfers the string into the RS232 String and sends the string via comport which defined in the CMD line.



      -s is the string parameter from the webpage.



      I want to do the same thing on Android. But instead of sending it via Serial, it would send the information via Bluetooth. And use a Bluetooth to the serial module to transfer this order.



      I am not an Android programmer so before I start to work, I want to make sure that Android can do:




      • Is it possible to call terminal and pass the parameter in Android?


      I understood that I can use some app to run a terminal command and send information via Bluetooth. But is it possible that an APP/Script can call the Terminal APP and pass the parameter? Like what I did on Windows. So the Terminal can transfer the parameter into an RS232 String and send it via Bluetooth?










      share|improve this question














      I have an application running on Win that the JavaScript would capture the string from a webpage and wake up the cmd, cmd would have the parameter as below.




      bridgetool.exe -c serial -p com1: -b 384000 -s string_from_webpage




      bridgetool.exe is software that transfers the string into the RS232 String and sends the string via comport which defined in the CMD line.



      -s is the string parameter from the webpage.



      I want to do the same thing on Android. But instead of sending it via Serial, it would send the information via Bluetooth. And use a Bluetooth to the serial module to transfer this order.



      I am not an Android programmer so before I start to work, I want to make sure that Android can do:




      • Is it possible to call terminal and pass the parameter in Android?


      I understood that I can use some app to run a terminal command and send information via Bluetooth. But is it possible that an APP/Script can call the Terminal APP and pass the parameter? Like what I did on Windows. So the Terminal can transfer the parameter into an RS232 String and send it via Bluetooth?







      command-line terminal bluetooth






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 2 at 15:27







      jashdf











      migrated from superuser.com Jan 7 at 21:17


      This question came from our site for computer enthusiasts and power users.









      migrated from superuser.com Jan 7 at 21:17


      This question came from our site for computer enthusiasts and power users.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          No. Android does not really have a commandline environment intended for use by Apps. There is to a limited extent one available for development, and launching subprocesses from an App is highly discouraged but technically possible, however applications run under highly restricted user accounts which cannot do much on their own, and most systems services are only provided by Java APIs that make requests through interprocess communication.



          So you'll basically have to do this in the Java-level code of an application.



          A little web searching will find you examples for how to interact with bluetooth devices from Android application code. Do note that there are many varieties of
          bluetooth target, so that aspect of your question would be too broad, but additionally stack exchange sites are not a code writing or code finding service - you will have to do your own research there.



          Android does often utilize a principle of delegating tasks to something else, but the utilized mechanism is not invoking a subprocess as a terminal command would, but rather sending an "Intent" - an Android-unique mechanism for making a request for a particular action, which Application components can either make, or register their ability to handle if made by other components. There are no standard Intents for doing what you want to do, but it would be possible to create a component which sends bluetooth messages upon receiving an Intent request to do so, and then utilize that either within the same Application or in a different one.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "139"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f206176%2fsend-data-via-bluetooth-to-serial%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown
























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            No. Android does not really have a commandline environment intended for use by Apps. There is to a limited extent one available for development, and launching subprocesses from an App is highly discouraged but technically possible, however applications run under highly restricted user accounts which cannot do much on their own, and most systems services are only provided by Java APIs that make requests through interprocess communication.



            So you'll basically have to do this in the Java-level code of an application.



            A little web searching will find you examples for how to interact with bluetooth devices from Android application code. Do note that there are many varieties of
            bluetooth target, so that aspect of your question would be too broad, but additionally stack exchange sites are not a code writing or code finding service - you will have to do your own research there.



            Android does often utilize a principle of delegating tasks to something else, but the utilized mechanism is not invoking a subprocess as a terminal command would, but rather sending an "Intent" - an Android-unique mechanism for making a request for a particular action, which Application components can either make, or register their ability to handle if made by other components. There are no standard Intents for doing what you want to do, but it would be possible to create a component which sends bluetooth messages upon receiving an Intent request to do so, and then utilize that either within the same Application or in a different one.






            share|improve this answer




























              0














              No. Android does not really have a commandline environment intended for use by Apps. There is to a limited extent one available for development, and launching subprocesses from an App is highly discouraged but technically possible, however applications run under highly restricted user accounts which cannot do much on their own, and most systems services are only provided by Java APIs that make requests through interprocess communication.



              So you'll basically have to do this in the Java-level code of an application.



              A little web searching will find you examples for how to interact with bluetooth devices from Android application code. Do note that there are many varieties of
              bluetooth target, so that aspect of your question would be too broad, but additionally stack exchange sites are not a code writing or code finding service - you will have to do your own research there.



              Android does often utilize a principle of delegating tasks to something else, but the utilized mechanism is not invoking a subprocess as a terminal command would, but rather sending an "Intent" - an Android-unique mechanism for making a request for a particular action, which Application components can either make, or register their ability to handle if made by other components. There are no standard Intents for doing what you want to do, but it would be possible to create a component which sends bluetooth messages upon receiving an Intent request to do so, and then utilize that either within the same Application or in a different one.






              share|improve this answer


























                0












                0








                0







                No. Android does not really have a commandline environment intended for use by Apps. There is to a limited extent one available for development, and launching subprocesses from an App is highly discouraged but technically possible, however applications run under highly restricted user accounts which cannot do much on their own, and most systems services are only provided by Java APIs that make requests through interprocess communication.



                So you'll basically have to do this in the Java-level code of an application.



                A little web searching will find you examples for how to interact with bluetooth devices from Android application code. Do note that there are many varieties of
                bluetooth target, so that aspect of your question would be too broad, but additionally stack exchange sites are not a code writing or code finding service - you will have to do your own research there.



                Android does often utilize a principle of delegating tasks to something else, but the utilized mechanism is not invoking a subprocess as a terminal command would, but rather sending an "Intent" - an Android-unique mechanism for making a request for a particular action, which Application components can either make, or register their ability to handle if made by other components. There are no standard Intents for doing what you want to do, but it would be possible to create a component which sends bluetooth messages upon receiving an Intent request to do so, and then utilize that either within the same Application or in a different one.






                share|improve this answer













                No. Android does not really have a commandline environment intended for use by Apps. There is to a limited extent one available for development, and launching subprocesses from an App is highly discouraged but technically possible, however applications run under highly restricted user accounts which cannot do much on their own, and most systems services are only provided by Java APIs that make requests through interprocess communication.



                So you'll basically have to do this in the Java-level code of an application.



                A little web searching will find you examples for how to interact with bluetooth devices from Android application code. Do note that there are many varieties of
                bluetooth target, so that aspect of your question would be too broad, but additionally stack exchange sites are not a code writing or code finding service - you will have to do your own research there.



                Android does often utilize a principle of delegating tasks to something else, but the utilized mechanism is not invoking a subprocess as a terminal command would, but rather sending an "Intent" - an Android-unique mechanism for making a request for a particular action, which Application components can either make, or register their ability to handle if made by other components. There are no standard Intents for doing what you want to do, but it would be possible to create a component which sends bluetooth messages upon receiving an Intent request to do so, and then utilize that either within the same Application or in a different one.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 2 at 15:47









                Chris StrattonChris Stratton

                1,5261212




                1,5261212






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Android Enthusiasts Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f206176%2fsend-data-via-bluetooth-to-serial%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                    Alcedinidae

                    Can an atomic nucleus contain both particles and antiparticles? [duplicate]