Your SlideShare is downloading. ×
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Python For Droid
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Python For Droid

589

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
589
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CYBER SECURITY INFORMATION TECHNOLOGY AppSec CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE (By Rich Helton) Python for Droid (September 21, 2011) State of Colorado Office of Cyber Security State of Colorado Office of Cyber Security
  • 2. Class IntroductionCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   A good reference for an online Python class is http://code.google.com/edu/languages/google-python-class/ introduction.html , PyQuick Python Class from Google University.   Another place for reference Python Documentation, http://www.python.org/doc/ State of Colorado Office of Cyber Security
  • 3. Python HistoryCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   From http://en.wikipedia.org/wiki/Python_(programming_language) ,   Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.   The reference implementation of Python (CPython) is free and open source software and has a community-based development model, as do nearly all of its alternative implementations.   Python interpreters are available for many operating systems, and Python programs can be packaged into stand-alone executable code for many systems using various tools.   Python’s implementation was started in December 1989 by Guido van Rossum in the Netherlands as a successor to the ABD programming language. State of Colorado Office of Cyber Security
  • 4. CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE Android Python State of Colorado Office of Cyber Security
  • 5. Android PythonCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Android is basically a Micro Edition of Linux, and because Linux normally runs Python, Android can add a package to run Python.   See http://hameedullah.com/develop-your-first-android-application-in- python.html State of Colorado Office of Cyber Security
  • 6. Set up the Android SDKCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   First the Android environment, Software Development Kit (SDK), needs to be set up on the local Desktop, http://developer.android.com/sdk/installing.html : State of Colorado Office of Cyber Security
  • 7. Android Virtual Device (AVD)CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE  An AVD will have to be created for debugging and testing, this is your target device, State of Colorado Office of Cyber Security
  • 8. Android PythonCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Create an AVD from your now installed Android SDK, by creating a new Virtual Device, http://developer.android.com/guide/developing/devices/index.html State of Colorado Office of Cyber Security
  • 9. Android PythonCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   The “New” Virtual Device for Android, State of Colorado Office of Cyber Security
  • 10. AVD CreatedCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   The new AVD called “PythonDev”, State of Colorado Office of Cyber Security
  • 11. AVD StartCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Start “PythonDev”, State of Colorado Office of Cyber Security
  • 12. Use the Browser in the AVDCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Open the Browser in “PythonDev”, and go to http://code.google.com/p/android-scripting so install Android Scripting State of Colorado Office of Cyber Security
  • 13. Download SL4ACYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   After tapping on the QR code icon (center box) to download, State of Colorado Office of Cyber Security
  • 14. Install SL4ACYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Double click the download to install, State of Colorado Office of Cyber Security
  • 15. SL4A InstalledCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Installed, State of Colorado Office of Cyber Security
  • 16. Now Python has to be installedCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Go back in the browser and to the SL4A website, hit the download URL for Python for Android and you will get, State of Colorado Office of Cyber Security
  • 17. InstallCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   After downloading, you need to install Python, State of Colorado Office of Cyber Security
  • 18. Run a scriptCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Go to applications and select SL4A, State of Colorado Office of Cyber Security
  • 19. Run HelloWorld.pyCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Select the Run icon on script, State of Colorado Office of Cyber Security
  • 20. Says “Hello, Android!”CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   You get the “Hello, Android!” State of Colorado Office of Cyber Security
  • 21. See the scriptsCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Android uses a bridge, called “adb” to talk from the desktop to the emulator. Under the android SDK/platform-tools, run “adb shell ls / sdcard/sl4a/scripts”, State of Colorado Office of Cyber Security
  • 22. Write a small scriptCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   We are going to write a small script that prints the inputted name with a greeting, Notepad will work, State of Colorado Office of Cyber Security
  • 23. Set the scriptsCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Run “adb push myGreet.py /sdcard/sl4a/scripts”, to copy this python file to the emulator, State of Colorado Office of Cyber Security
  • 24. Execute the scriptCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   Execute the “myGreet.py” script, State of Colorado Office of Cyber Security
  • 25. GreetingCYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE   After typing in your name, you get a greeting, State of Colorado Office of Cyber Security
  • 26. CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE HOMELAND SECURITY MULTI-USER NETWORK CYBER SECURITY INFORMATION TECHNOLOGY CRITICAL INFRASTRUCTURE Questions? Have a Good Day State of Colorado Office of Cyber Security

×