Python Forum
Python coming to DroidScript (build native Android Apps)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python coming to DroidScript (build native Android Apps)
#1
Hi Guys,

I'm the founder of droidscript.org, a not-for-profit organisation with the aim of making app development easy, fast and fun for everyone, everywhere.

I'm please to announce that we've just started adding Python support to DroidScript. I hope you find this as exciting as we do, because this will allow thousands of coders, young and old, to easily create native Android apps directly on their phones and tablets using Python.

This is what a simple Python app looks like in DroidScript -

#Import the native app object.
from native import app

#Called when application is created.
def OnStart():

    #Create a layout with objects vertically centered.
    lay = app.CreateLayout( "linear", "VCenter,FillXY" )

    #Add an image 20% of screen width.
    img = app.AddImage( lay, "/Sys/Img/Hello.png", 0.2 )
    
    #Add a button 30% of screen width.
    btn = app.AddButton( lay, "Press Me", 0.3 )
    btn.SetMargins( 0, 0.05, 0, 0 )
    btn.SetOnTouch( btn_OnTouch )
    
    #Add layout to app.    
    app.AddLayout( lay )
    
    
#Called when user touches our button.
def btn_OnTouch():

    app.ShowPopup( "Hello World!" )
    
    #Vibrate phone with a pattern (in milliseconds).
    #pause,vibrate,pause,vibrate...
    app.Vibrate( "0,100,30,100,50,300" )
That's a very simple app, but you have the 'full power' of the DroidScript native framework at you disposal and can use Camera, USB, Bluetooth Serial, BLE, WiFi, Accelerometer, GPS and much more... even NodeJS!

If you would like to try this out and maybe give us some feedback, then you can find a beta version of DroidScript here that supports it -

http://androidscript.org/beta/DroidScript_263b1/

You just need to enable the 'experiments' option in the About box and restart the app to see the Python templates appear in the 'New' menu.

We are making use of Brython to achieve this and the performance seems to be very good so far.

Please let me know what you think Smile

Regards
David
DeaD_EyE likes this post
Reply


Messages In This Thread
Python coming to DroidScript (build native Android Apps) - by d_a_v_e - Oct-02-2023, 02:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python to build desktop and mobile apps tneilson08 4 3,007 Apr-04-2024, 09:49 PM
Last Post: Thadectives
  python-3.10.0-amd64 build corrupt? lohphat 4 2,489 Nov-21-2021, 09:28 AM
Last Post: Axel_Erfurt
  Python GUI for Android - ebook for free OlafArtAnanda 2 3,848 Jul-20-2021, 11:07 PM
Last Post: phoenix
  configuring python at build time Skaperen 2 1,981 Jul-03-2019, 11:33 PM
Last Post: Skaperen
  Resources for automated testing of Android apps using TestComplete? ackmondual 0 1,815 May-20-2019, 09:03 PM
Last Post: ackmondual
  coming up with a sentinel string for file names lacaca 1 1,962 Apr-13-2019, 09:31 AM
Last Post: Larz60+
  Failed tkinter Compile In Custom 3.7.2 Build Using Custom Tcl/Tk Build gwc 0 2,679 Jan-25-2019, 01:56 PM
Last Post: gwc
  coming up with a sentinel string for file names Skaperen 4 2,701 Jan-05-2019, 06:28 AM
Last Post: Skaperen
  Whether or not it needs Java for Android with Python Aashuraa 4 3,246 Nov-26-2018, 02:36 PM
Last Post: Aashuraa
  How does one get reproducible builds for apps on PyPI? arnavb 0 2,771 Sep-06-2018, 07:44 PM
Last Post: arnavb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020