We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Honey, There Is a Python in My Android Phone!

00:00

Formal Metadata

Title
Honey, There Is a Python in My Android Phone!
Title of Series
Number of Parts
130
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
This is a small code snippet that I have written in Python for the POC of getting the GPS coordinate from android phone: import androidhelper import json import time from bottle import Bottle, run, response, request app = Bottle() droid = androidhelper.Android() @app.route("/location") def get_location(): droid.startLocating() droid.eventWaitFor('location', 12500) time.sleep(0.1) current_location = droid.readLocation().result if not current_location: current_location = droid.getLastKnownLocation().result droid.stopLocating() response.content_type = "application/json" return json.dumps( { "result": current_location }, indent=4 ) This project was initiated during my Christmas vacation, inspired by Android Barcode Scanner as I was looking on the solution that I could catalogue my books by scanning the ISBN using android phone. This quick solution did save me enormous amount of time in cataloguing my books. Intriguing by the design of APIs that can interact with android intents, I decided to dig further to understand how the APIs works. In concept, there is an RPC call between android app and python interpreter within the app that acts as a bridge, which allows python APIs to trigger Android intents, upon calling related APIs. For example, using the code snippet above, when Python GPS API is executed, the API will send request to Android GPS intent via the RPC call. Once Android intent receives the request, it will grab the GPS data, and passes the GPS data back to Python GPS API through the same channel. Reference: python-for-android Qpython Android Barcode Scanner
Android (robot)ArmHard disk driveComputerComputer programEmulationGoogolMobile appInterpreter (computing)Android (robot)Form (programming)Computer programmingMoore's lawProgramming languageInterpreter (computing)Systems engineeringCurveFront and back endsWeb applicationInterface (computing)System administratorNumberSoftwareInstallation artOperations support systemWindowDimensional analysisCartesian coordinate systemNeuroinformatikWebsiteState of matterPresentation of a groupInteractive televisionTouchscreenPower (physics)Library (computing)FamilyPersonal identification numberFocus (optics)Multiplication signWordMobile appAverageScripting languageCASE <Informatik>Dynamical systemBitFacebookException handlingTerm (mathematics)Pairwise comparisonArithmetic meanYouTubeBacktrackingQuicksortPrisoner's dilemmaCodeJava appletCondition numberSystem callInheritance (object-oriented programming)Pattern languageAeroelasticityMeeting/InterviewComputer animation
Exploratory data analysisGoogolScripting languageBuildingBit rateAndroid (robot)Information managementPoint (geometry)Web pageEmulationUniform resource locatorMetreData storage deviceRevision controlVarianceIntegrated development environmentTouchscreenGastropod shellAndroid (robot)CodeCASE <Informatik>WritingFile formatStudent's t-testForm (programming)Cycle (graph theory)PlotterCartesian coordinate systemLaptopSoftwareNumberParticle systemMeasurement2 (number)WebsiteHacker (term)WordOffice suiteSlide ruleBitMobile appCodeProjective planeGoogolMultiplication signScripting languageRemote procedure callLine codeFocus (optics)Social classPort scannerComputer fileLine (geometry)ResultantGravitationSystem callModule (mathematics)Network socketExecution unitBackupComputer-assisted translationPoint (geometry)DatabaseBootingInformationDemo (music)Standard deviationDerivation (linguistics)Process (computing)Arithmetic meanFormal languageCommunications protocol
Demo (music)Computer animation
Error messageObject-oriented programmingMultiplication signComputer animation
Multiplication signComputer animation
Computer animation
Uniform resource locatorInformationPoint (geometry)Queue (abstract data type)CubeComputer animation
Information securityGoodness of fit
Multiplication signRight angleReal-time operating systemReal numberForm (programming)Computer animation
Event horizonMultiplication signBitAndroid (robot)Moment (mathematics)DreizehnDifferent (Kate Ryan album)PiVariety (linguistics)Set (mathematics)Order (biology)Sheaf (mathematics)CASE <Informatik>Line (geometry)Zoom lensFigurate numberAuthorizationXML
Demo (music)Sound effectMeeting/Interview
Transcript: English(auto-generated)