From dipugee at gmail.com Mon Aug 29 19:13:05 2016 From: dipugee at gmail.com (=?utf-8?Q?Dipankar_=E2=80=9CDipu=E2=80=9D_Ganguly?=) Date: Mon, 29 Aug 2016 16:13:05 -0700 Subject: [Mobile-sig] Python code to Android App Message-ID: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> I am developing image processing algorithms in IPython under Anaconda Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert that code easily into an Android to run on an Android tablet? Thanks. Dipu Dipankar Ganguly Consultant: Strategy/Technology/Commercialization Bothell, WA Cell: 408-203-8814 email: dipugee at gmail.com http://www.linkedin.com/in/dipugee -------------- next part -------------- An HTML attachment was scrubbed... URL: From russell at keith-magee.com Tue Aug 30 10:35:07 2016 From: russell at keith-magee.com (Russell Keith-Magee) Date: Tue, 30 Aug 2016 22:35:07 +0800 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> Message-ID: Hi Dipu, The short answer is ?not really? - especially if you?re hoping to have an actual user interface. The problem is that Android *really* wants you to run Java. You *can* compile CPython for Android, but that code won?t have any easy access to UI elements like buttons - you need to use JNI to bridge into the Java runtime. Another approach would be to play around with running your Python algorithm as a service on your tablet, which your UI then interacts with. Another approach is to use VOC, which is a Python compiler that outputs Java classfiles; this is a fairly new tool (so it isn?t feature complete with Python yet), and it isn?t the fastest option, so if you?re doing image processing, it might not be the best idea. Jython would also be an option - but Jython doesn?t currently compile on Android, due to some binary dependencies that Jython has. So - it *can* be done, but you?re going to need to get your hands dirty if you want to make it happen. There isn?t an easy, ready-to-use, just-deploy-it solution for Android. Yours, Russ Magee %-) On Tue, Aug 30, 2016 at 7:13 AM, Dipankar ?Dipu? Ganguly wrote: > I am developing image processing algorithms in IPython under Anaconda > Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert > that code easily into an Android to run on an Android tablet? > > Thanks. > > Dipu > > > Dipankar Ganguly > Consultant: Strategy/Technology/Commercialization > Bothell, WA > Cell: 408-203-8814 > email: dipugee at gmail.com > http://www.linkedin.com/in/dipugee > > > > > > > > > > > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil at riverbankcomputing.com Tue Aug 30 10:58:21 2016 From: phil at riverbankcomputing.com (Phil Thompson) Date: Tue, 30 Aug 2016 15:58:21 +0100 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> Message-ID: <60A407B1-AC91-4C09-A847-8836DEBFD02F@riverbankcomputing.com> On 30 Aug 2016, at 12:13 am, Dipankar ?Dipu? Ganguly wrote: > > I am developing image processing algorithms in IPython under Anaconda Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert that code easily into an Android to run on an Android tablet? It depends on your choice of GUI toolkit. PyQt5 applications can run unchanged on the desktop and Android (and iOS). You can use pyqtdeploy and the Qt Android deployment tools to create installable apps. Phil From phil at riverbankcomputing.com Tue Aug 30 11:20:36 2016 From: phil at riverbankcomputing.com (Phil Thompson) Date: Tue, 30 Aug 2016 16:20:36 +0100 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <093E6C25-BE19-42CB-A722-68A600394D69@gmail.com> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> <60A407B1-AC91-4C09-A847-8836DEBFD02F@riverbankcomputing.com> <093E6C25-BE19-42CB-A722-68A600394D69@gmail.com> Message-ID: On 30 Aug 2016, at 4:06 pm, Dipankar ?Dipu? Ganguly wrote: > > Thanks Phil. Where can I go to learn more about PyQt5 and the method(s) you allude to? http://pyqt.sourceforge.net/Docs/PyQt5/ http://pyqt.sourceforge.net/Docs/pyqtdeploy/ > I have a launch-able icon for QTConsole 4.2.1 on my Navigator dashboard. Could that be used to do what you suggest? Unlikely - you will need to re-implement your GUI. Phil From gabriel.pettier at gmail.com Tue Aug 30 11:24:04 2016 From: gabriel.pettier at gmail.com (Gabriel Pettier) Date: Tue, 30 Aug 2016 17:24:04 +0200 Subject: [Mobile-sig] Python code to Android App In-Reply-To: References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> Message-ID: <20160830152404.zphf2wlzaghu674a@dev-desk-1> Python-for-android (from the Kivy project) is also an option You can keep your Python/CPython code, you just have to write the necessary build recipes if you have any unusual C lib to build, and keep the rest of your code logic as is, i don't think anybody tried to run Jupyter Notebook with it, but there are bootstraps to display a web view instead of a kivy app, so maybe it's totally possible to make ipynb run there and display the interface in a normal android WebView. If what you want precisely is the algorithms you are devising, not specifically IPython notebook, and you don't care for a semi-native look on your app (kivy uses OpenGL to display everything, not the native toolkit, which is unnacceptable for some people) you can build a different UI to display your results with kivy, which is quite efficient for rapid prototyping of applications. Regards On Tue, Aug 30, 2016 at 10:35:07PM +0800, Russell Keith-Magee wrote: >Hi Dipu, > >The short answer is ?not really? - especially if you?re hoping to have an >actual user interface. > >The problem is that Android *really* wants you to run Java. You *can* >compile CPython for Android, but that code won?t have any easy access to UI >elements like buttons - you need to use JNI to bridge into the Java >runtime. Another approach would be to play around with running your Python >algorithm as a service on your tablet, which your UI then interacts with. > >Another approach is to use VOC, which is a Python compiler that outputs >Java classfiles; this is a fairly new tool (so it isn?t feature complete >with Python yet), and it isn?t the fastest option, so if you?re doing image >processing, it might not be the best idea. > >Jython would also be an option - but Jython doesn?t currently compile on >Android, due to some binary dependencies that Jython has. > >So - it *can* be done, but you?re going to need to get your hands dirty if >you want to make it happen. There isn?t an easy, ready-to-use, >just-deploy-it solution for Android. > >Yours, >Russ Magee %-) > >On Tue, Aug 30, 2016 at 7:13 AM, Dipankar ?Dipu? Ganguly >wrote: > >> I am developing image processing algorithms in IPython under Anaconda >> Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert >> that code easily into an Android to run on an Android tablet? >> >> Thanks. >> >> Dipu >> >> >> Dipankar Ganguly >> Consultant: Strategy/Technology/Commercialization >> Bothell, WA >> Cell: 408-203-8814 >> email: dipugee at gmail.com >> http://www.linkedin.com/in/dipugee >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig >> >> >_______________________________________________ >Mobile-sig mailing list >Mobile-sig at python.org >https://mail.python.org/mailman/listinfo/mobile-sig From kevin-lists at theolliviers.com Tue Aug 30 11:22:14 2016 From: kevin-lists at theolliviers.com (Kevin Ollivier) Date: Tue, 30 Aug 2016 08:22:14 -0700 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> Message-ID: It depends on what exactly your requirements and dependencies are. The real pain points of Python development for mobile right now are modules that have C extensions or code, and deciding what you want to do about the UI. For my projects I'm using HTML5 for my UI, and so what I've done is write a little library that makes it easier to create Python apps that simply load a main window with an embedded web browser for the UI on any platform. Then you just tell the browser which web page to load for your UI and have callbacks to the Python code, either via a local server or protocol handling. It uses Kivy on Android, Pythonista on iOS (Kivy supports iOS as well, but I was unable to get this solution working), and wxPython for the desktop, though eventually I want to just use PyObjC and PyCEF / Win32API directly instead of having an entire UI toolkit as a dependency. You can find the code here: http://pyeverywhere.org/ It's pretty rudimentary right now, but it does what I need it to. The main roadblock I've run into is that since there's no cross-compiler support for Android or iOS in Python itself, mobile projects like Kivy and Pythonista require you to write special recipes to get any dependency that require compilation running. (My ultimate goal is on-device machine learning, e.g. NLTK, which will be fun to set up... ;-) Since there also is not really a way to set up a "site-packages" for a target environment, you also sometimes have to manually copy some dependencies into your source code tree to make sure they end up in the package. (Kivy nicely uses a virtualenv for Android setup, which allows you to avoid some of that.) Regards, Kevin On 8/29/16, 4:13 PM, "Mobile-sig on behalf of Dipankar ?Dipu? Ganguly" wrote: I am developing image processing algorithms in IPython under Anaconda Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert that code easily into an Android to run on an Android tablet? Thanks. Dipu Dipankar Ganguly Consultant: Strategy/Technology/Commercialization Bothell, WA Cell: 408-203-8814 email: dipugee at gmail.com http://www.linkedin.com/in/dipugee _______________________________________________ Mobile-sig mailing list Mobile-sig at python.org https://mail.python.org/mailman/listinfo/mobile-sig From dipugee at gmail.com Tue Aug 30 10:50:11 2016 From: dipugee at gmail.com (=?utf-8?Q?Dipankar_=E2=80=9CDipu=E2=80=9D_Ganguly?=) Date: Tue, 30 Aug 2016 07:50:11 -0700 Subject: [Mobile-sig] Python code to Android App In-Reply-To: References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> Message-ID: <4308D223-88D1-4820-B723-76C00455D989@gmail.com> Thanks Russ. A few things to think about. Best. Dipu Dipankar ?Dipu? Ganguly dipugee at gmail.com Cell: 408-203-8814 > On Aug 30, 2016, at 7:35 AM, Russell Keith-Magee wrote: > > Hi Dipu, > > The short answer is ?not really? - especially if you?re hoping to have an actual user interface. > > The problem is that Android *really* wants you to run Java. You *can* compile CPython for Android, but that code won?t have any easy access to UI elements like buttons - you need to use JNI to bridge into the Java runtime. Another approach would be to play around with running your Python algorithm as a service on your tablet, which your UI then interacts with. > > Another approach is to use VOC, which is a Python compiler that outputs Java classfiles; this is a fairly new tool (so it isn?t feature complete with Python yet), and it isn?t the fastest option, so if you?re doing image processing, it might not be the best idea. > > Jython would also be an option - but Jython doesn?t currently compile on Android, due to some binary dependencies that Jython has. > > So - it *can* be done, but you?re going to need to get your hands dirty if you want to make it happen. There isn?t an easy, ready-to-use, just-deploy-it solution for Android. > > Yours, > Russ Magee %-) > > On Tue, Aug 30, 2016 at 7:13 AM, Dipankar ?Dipu? Ganguly > wrote: > I am developing image processing algorithms in IPython under Anaconda Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert that code easily into an Android to run on an Android tablet? > > Thanks. > > Dipu > > > Dipankar Ganguly > Consultant: Strategy/Technology/Commercialization > Bothell, WA > Cell: 408-203-8814 > email: dipugee at gmail.com > http://www.linkedin.com/in/dipugee > > > > > > > > > > > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dipugee at gmail.com Tue Aug 30 11:06:17 2016 From: dipugee at gmail.com (=?utf-8?Q?Dipankar_=E2=80=9CDipu=E2=80=9D_Ganguly?=) Date: Tue, 30 Aug 2016 08:06:17 -0700 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <60A407B1-AC91-4C09-A847-8836DEBFD02F@riverbankcomputing.com> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> <60A407B1-AC91-4C09-A847-8836DEBFD02F@riverbankcomputing.com> Message-ID: <093E6C25-BE19-42CB-A722-68A600394D69@gmail.com> Thanks Phil. Where can I go to learn more about PyQt5 and the method(s) you allude to? I have a launch-able icon for QTConsole 4.2.1 on my Navigator dashboard. Could that be used to do what you suggest? Dipu Dipankar ?Dipu? Ganguly dipugee at gmail.com Cell: 408-203-8814 > On Aug 30, 2016, at 7:58 AM, Phil Thompson wrote: > > On 30 Aug 2016, at 12:13 am, Dipankar ?Dipu? Ganguly wrote: >> >> I am developing image processing algorithms in IPython under Anaconda Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert that code easily into an Android to run on an Android tablet? > > It depends on your choice of GUI toolkit. PyQt5 applications can run unchanged on the desktop and Android (and iOS). You can use pyqtdeploy and the Qt Android deployment tools to create installable apps. > > Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: From dipugee at gmail.com Tue Aug 30 12:35:10 2016 From: dipugee at gmail.com (=?utf-8?Q?Dipankar_=E2=80=9CDipu=E2=80=9D_Ganguly?=) Date: Tue, 30 Aug 2016 09:35:10 -0700 Subject: [Mobile-sig] Python code to Android App In-Reply-To: <20160830152404.zphf2wlzaghu674a@dev-desk-1> References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> <20160830152404.zphf2wlzaghu674a@dev-desk-1> Message-ID: My focus are the algorithms not Jupyter. Jupyter is just a dev./presentation environment for me. I have a team of SW engineers who will take my algorithmic kernels and and ?package" them within an app. Thanks. Dipu Dipankar ?Dipu? Ganguly dipugee at gmail.com Cell: 408-203-8814 > On Aug 30, 2016, at 8:24 AM, Gabriel Pettier wrote: > > Python-for-android (from the Kivy project) is also an option > > You can keep your Python/CPython code, you just have to write the necessary build recipes if you have any unusual C lib to build, and keep the rest of your code logic as is, i don't think anybody tried to run Jupyter Notebook with it, but there are bootstraps to display a web view instead of a kivy app, so maybe it's totally possible to make ipynb run there and display the interface in a normal android WebView. > > If what you want precisely is the algorithms you are devising, not specifically IPython notebook, and you don't care for a semi-native look on your app (kivy uses OpenGL to display everything, not the native toolkit, which is unnacceptable for some people) you can build a different UI to display your results with kivy, which is quite efficient for rapid prototyping of applications. > > Regards > > On Tue, Aug 30, 2016 at 10:35:07PM +0800, Russell Keith-Magee wrote: >> Hi Dipu, >> >> The short answer is ?not really? - especially if you?re hoping to have an >> actual user interface. >> >> The problem is that Android *really* wants you to run Java. You *can* >> compile CPython for Android, but that code won?t have any easy access to UI >> elements like buttons - you need to use JNI to bridge into the Java >> runtime. Another approach would be to play around with running your Python >> algorithm as a service on your tablet, which your UI then interacts with. >> >> Another approach is to use VOC, which is a Python compiler that outputs >> Java classfiles; this is a fairly new tool (so it isn?t feature complete >> with Python yet), and it isn?t the fastest option, so if you?re doing image >> processing, it might not be the best idea. >> >> Jython would also be an option - but Jython doesn?t currently compile on >> Android, due to some binary dependencies that Jython has. >> >> So - it *can* be done, but you?re going to need to get your hands dirty if >> you want to make it happen. There isn?t an easy, ready-to-use, >> just-deploy-it solution for Android. >> >> Yours, >> Russ Magee %-) >> >> On Tue, Aug 30, 2016 at 7:13 AM, Dipankar ?Dipu? Ganguly >> wrote: >> >>> I am developing image processing algorithms in IPython under Anaconda >>> Navigator?s Jupyter on my Mac running OS 10.11.6. Is there a way to convert >>> that code easily into an Android to run on an Android tablet? >>> >>> Thanks. >>> >>> Dipu >>> >>> >>> Dipankar Ganguly >>> Consultant: Strategy/Technology/Commercialization >>> Bothell, WA >>> Cell: 408-203-8814 >>> email: dipugee at gmail.com >>> http://www.linkedin.com/in/dipugee >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Mobile-sig mailing list >>> Mobile-sig at python.org >>> https://mail.python.org/mailman/listinfo/mobile-sig >>> >>> > >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guido at python.org Tue Aug 30 17:55:17 2016 From: guido at python.org (Guido van Rossum) Date: Tue, 30 Aug 2016 14:55:17 -0700 Subject: [Mobile-sig] Python code to Android App In-Reply-To: References: <278DCACF-432A-4A98-B80D-240907748C47@gmail.com> <20160830152404.zphf2wlzaghu674a@dev-desk-1> Message-ID: On Tue, Aug 30, 2016 at 9:35 AM, Dipankar ?Dipu? Ganguly wrote: > My focus are the algorithms not Jupyter. Jupyter is just a dev./presentation > environment for me. I have a team of SW engineers who will take my > algorithmic kernels and and ?package" them within an app. Then shouldn't the members of that team be asking the questions here? -- --Guido van Rossum (python.org/~guido)