What are the packages which need to be installed for writing scripts using PyJius in system ?
Is there anyway by which i could run these python scripts on android phone ?
What is K ivy Launcher for android ? Will it be helpful for executing my scripts ?
How actually Kivy works ( in detail say in I want to switch on Bluetooth using scripts, which are the things in the K ivy architecture gets invoked by doing so ? )
What i need is to write scripts on computer and then after sending those scripts to my phone, then i need to execute my scripts from phone. Get the results on the phone and send those results to system.
What are the packages which need to be installed for writing scripts using PyJius in system ?
I'm not sure what you mean here. To run use pyjnius, all you need is...pyjnius. It is a separate module, not part of kivy itself, though kivy uses it on android. Kivy's mobile build tools automatically package this when you build an android apk.
What is K ivy Launcher for android ? Will it be helpful for executing my scripts ?
An app that can dynamically open kivy apps from your user data directory. You can use it to upload and run kivy scripts/apps on your device.
It is most useful for quick tests, not as a way to distribute apps. For this, it's very easy to build your own apks, which gives a lot more flexibility in what you do and what you package.
How actually Kivy works ( in detail say in I want to switch on Bluetooth using scripts, which are the things in the K ivy architecture gets invoked by doing so ? )
I'm not sure what you're asking here. Kivy is a graphical framework for python, using an optimised opengl interface...you write python gui applications with it.
For things like bluetooth on android, you can use pyjnius (or more easily, wrapper projects like plyer providing an abstracted python api, though I don't think plyer has bluetooth quite yet). This generally isn't very hard, I've seen bluetooth done before.
Kivy itself is a graphical framework, these other tools are sister projects but separate from the graphics.
What i need is to write scripts on computer and then after sending those scripts to my phone, then i need to execute my scripts from phone. Get the results on the phone and send those results to system.
You can certainly do this with kivy, by putting the scripts in an app that you run. Network communication also isn't hard - it's separate to kivy itself, but you have access to all the normal python modules you might use.
Related
I'm a young flutter developer and I would like to understand, why we use this command
flutter config --no-enable-web --no-enable-macos-desktop --no-enable-windows-desktop --no-enable-linux-desktop
while we can create the binary file by writing the command :
"build platform-name"?
moreover, if flutter was designed for cross-platform applications starting from a single code, why do these engineers always allow us to use this command?
and from what I've read, the command can only be useful if, flutter doctor finds problems or missing components for a platform you don't want to develop for. but, I also say to myself, that I can use this command, in this following:
-- if I only want to develop an application for mobile (android and ios), then I don't need other platforms and vice versa so that it can lighten the files.
unless, when we decide to build according to any platform, the build system manages to recognize the if....conditions that we place at certain levels of the codes in order to specify the nature of the platform for insert, the design that suits it, and according to the user experience when we develop for all platforms. from the same project.
because me, I think that, if the developer, finished developing his project on a platform such as (android and ios) and later thinks of developing this same application for the other remaining platforms, he can create a project of the same name and given that his backend (if of course his project has any architecture) of his first project is cross-platform he can simply copy and paste this backend, then focus on developing the frontend side according to the platforms (Windows, Linux, macos and web) always according to the perspectives of his project.
Hence the weight of the files will be controlled, in order to make the build according to the fluid platform.
Basically that's what I think, so , tell me more about this command in order to use it better and to be able to manage my architectures according to the platforms. thank you
I am currently learning how to code in Python. My goal as of right now is to learn how to write apps for Android.
Recently, I have been thinking about switching over to Java. However, since I am a beginner I find Python comes relatively easy to me. If I write an Android app in Python using sl4a, does the end user need to have sl4a installed for the app to work?
If so, I think I am just going to start learning Java. Thanks for the help!
Yes. sl4a requires the sl4a app to be installed on the user's Android device.
sl4a is essentially a runtime application that needs to be installed before the user can run your app built and run on top of sl4a.
AFAIK sl4a is not just for Python but other languages too.
Update:
If you're looking to build cross-paltform (Mobile) apps in Python; IHMO the best option for this right now is Kivy. I'd encourage any Python developer wanting to get into the Mobile platform space to look at this :)
My company has 2 native applications that run on Windows/Mac/Linux as services or daemons. I have taken this code and compiled it with the Android toolchain. I have a rooted android device to which I can push this application, run as as process and it works great. However, I'd like to build some sort of installer (probably an .apk) to which I could add this native application and run on ANY android device (e.g. without being rooted).
So does anybody know of a link, example or even just how to "install" a native application and run?
Thanks
/Loren
To do this properly, you need to rework your native service to be a library utilized by an android Service, and operate in keeping with android's conception of services (lifecycle, status bar notification, etc).
Trying to run your own executable (vs library to an android-provided executable) is not something android makes easy and not something you are encouraged to do.
Okay, here's the situation:
I'm developing an application for a client (or trying to do so). It requires much (if not all) of the same functionality as the built-in SMS/MMS application. So, I thought - HEY! Android is open source right? I can take the application and modify to my needs, right?
So, I found the code on github for the MMS/SMS application (for some reason, based on the AndroidManifest file, it calls my project I built, "ConversationList"). But I get TONS of errors involving the import com.google.android.mms.* package and a couple other packages.
Everyone keeps saying "it's a private/internal package", and "download the entire AOSP". But, HOW do I do this on Windows, and WHY can't I just download the appropriate packages to use in the program?
ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code. If Android is open source, why so many secret/internal packages? This is frustrating.
Any advice?
So, I found the code on github for the MMS/SMS application (for some reason, based on the AndroidManifest file, it calls my project I built, "ConversationList"). But I get TONS of errors involving the import com.google.android.mms.* package and a couple other packages.
AOSP applications like this are designed to be built as part of a firmware image, not as standalone apps.
But, HOW do I do this on Windows
Most likely, you don't. Cygwin might work. More likely, you will need to use OS X or Linux, such as running Linux in VirtualBox. And the result of your build will not run on anything, except as part of a firmware build that you use to replace the firmware on a device.
WHY can't I just download the appropriate packages to use in the program?
Because that application is designed to be built as part of a firmware image, not as a standalone app.
ALL I want to do is build a project in Eclipse deploy it to my phone, and then modify the necessary code.
Then find a project that is designed to be built as a standalone app as your starting point. Or, work on modifying the project you are trying to use to work as a standalone app, by ripping out all the functionality that depends upon things that are not in the app itself.
If Android is open source, why so many secret/internal packages?
They are not "secret". They are part of the firmware.
For example -- since you appear to be familiar with Windows -- it is entirely possible that "apps" like Control Panel are not designed to be built independently from the Windows OS. If you were able to download the source code to Windows and tried to load Control Panel into Visual Studio, it is eminently possible that you could not create some standalone CPANEL.EXE file just via that one project. Rather, you would need to use a customized Windows OS build process to build the whole OS, which would then contain a CPANEL.EXE that would run within that built version of the OS.
Most of the AOSP apps work this way. Some have been forked to create standalone apps -- K-9 Mail came from the early version of the AOSP email app. I have no idea if anyone has done this with the stock AOSP Messaging app or not.
You could instead fork TextSecure[0] as it is no system application but looks very similar to the stock messaging application. The AOSP application needs to be installed on /system/app which requires root and might not be what your customer wants.
Please note that this application is copylefted (GPLv3) so you'd have to give your client access to the source code under the terms of the GPL if you fork.
[0] https://github.com/WhisperSystems/TextSecure
I would like to create an App with python, but i need that it includes all it needs in order to operate correctly. I have saw this post about the ability to sell the app via and Market, but it didn't have a final answer there.
Currently the best solution i could find, is at this pdf chapter (from Pro SL4A Apress book), but still it seems that even if i create an .apk file, the user whom install that app would have to have the SL4A on his Android device.
Is there a way to incorporate the SL4A in the .apk file, or better yet, to incorporate just the needed stuff ?
As far as I'm aware, APKs created this way don't include the script interpreters that SL4A provides. According to the PDF you posted, it should request for SL4A and the relevant script interpreter to be installed when the APK is installed, however.
This question is now quite old, but for any other users who might come by here, it is now possible to embed the Python interpreter in an APK package. Look at this project for instructions and methods of doing so.
so what actually happens when compiling an APK via the method described in the book is a little bit different than what you have described. What actually happens is that upon installation of the APK file it will check to see if the user has Python installed, not SL4A. If the user does not have Python installed it will prompt for a download, similar to how certain applications prompt to install BusyBox in order to use certain commands. This means that the user doesn't need to have a scripting environment, or in fact even know what python is.
As for compiling 3rd party modules/libs into your APK, what happens is when you are compiling in Eclipse it will point to the folder on the computer containing python, and compile from there. That means that all you need to do in order to get extra modules or libraries into the APK are to make sure that they are included in the folder that Eclipse looks to when compiling the APK. By default I think that is your native Python folder, but I'm not 100% sure so somebody please correct me if I am wrong.
Hope this helps!