Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

In this Discussion

Android PDE - Create and run sketches on an Android device

edited November 2014 in Create & Announce Tools

With APDE, it is now possible to write sketches on your phone / tablet without a computer!

From the Android Processing Wiki:

We currently have no plans to make a version of the development environment (the PDE) that runs on the phone, but that might be fun for you internetpeople to hack together on your own, and amaze us all.

This is no longer the case.



You can download APDE from Google Play or from GitHub. Please keep in mind that this is currently alpha quality software and so contains many bugs and lacks features.

The source code is available on GitHub. A detailed description of the app and development for the app is available in the README file on GitHub.

If you have any questions, ideas, bug reports, or comments, you can leave them below.

«1

Comments

  • Hi. This looks like a great project. I have d'loaded it and it runs but I am having as problem with changing the name of the sketch prior to saving. When I try to do so I get the "apse" stopped unexpectedly" error box and the name of "sketch" hasn't changed... Also, where does the sketchbook get put on install? Thanks,

    Steve.

  • edited January 2014

    @mubase: Yes, there appear to be many issues related to device compatibility - I have limited ability to test across multiple devices. If you can provide some information about your device, such as model, OS Version, etc., that could help me to solve the problem.

    The sketchbook is currently stored on the device's external storage in a folder called "Sketchbook". I plan on making this changeable in the future, as it could potentially lead to problems. Also, if it helps, the Android build folder (for debugging, so not permanent) is stored in "build", also on the external storage.

    Thanks for taking the time to try it out, though!

  • edited January 2014

    It installs and runs and I can change the sketch name, but I can't enter any code. Nothing happens, no keyboard or cursor when I tap in the edit area? Using 4.0 Zenithink C91(upgrade) tablet. Mark

  • @hudson_m4000: The touch selectable area for the code area is much smaller than the actual code area - it is located in the top portion of the visible area. This is indeed something that I should fix.

    If you are unable to find the touch region, please wait until I correct the issue. I realize that this is critical to the functionality of the editor.

  • Found it :) Now though... keywords appear in both black and green slightly offset vertically from one another.... can still code though. Thanks for making this available. Mark

  • Right. That is my current syntax highlighter implementation. That is yet another item on the to do list. If you wish to disable the syntax highlighter, you can do so from the Settings screen.

  • edited January 2014

    I have updated APDE to version 0.1.1 Alpha. This new version includes a bug fix and some usability improvements.

    The main reason for the update is to make APDE available for download on Google Play. If you encounter any crashes, Google Play will make it easy to submit stack traces, enabling me to track down the bugs. It will also allow for automatic updates.

    I have changed the signing signature for APDE. If you have previously installed it, you must uninstall it before installing the update. Uninstalling will not erase any sketch data because the sketches are stored in the 'Sketchbook' folder on the external storage, but it will wipe your settings. This is a change that will not happen again.

    I will continue to work on improving the app and sorting out various bugs.

    @mubase, @hudson_m4000

  • I have updated APDE to version 0.2.0 Alpha.

    This update adds four example sketches that can be accessed from the Sketchbook drawer and it significantly improves the syntax highlighter. A bunch of bugs / annoyance factors have been ironed out.

    If you have installed APDE from Google Play, you should receive the update automatically within the next twenty-four hours.

    OpenGL is still broken for most practical uses. I've gotten the problem narrowed down some more, but am unable to resolve it at the moment. This is now the top priority and I may end up having a conversation with the Processing developers if this is what is necessary. The "Yellowtail" example is currently affected by this problem, but you can still view the code.

  • Much improved syntax highlighter! :)

  • I have updated APDE to version 0.2.1 Alpha.

    Most importantly: The OpenGL issues have been resolved. With this out of the way, I can focus on more interesting things, such as support for contributed libraries (like Ketai).

    P.S.: I don't intend to post every incremental update, incessantly spamming the forum (especially with Google Play auto-update), but this release seems particularly important...

  • Hi, when using tabs I am sometimes finding that the code I have entered and finished, eg a class, is being deleted and replaced with code from a different tab. I can't find any pattern to how or when this happens, but it has happened several times now?

  • @hudson_m4000: I used to encounter these types of issues all of the time, but have since ironed them out (so I thought...). I haven't had my code deleted for a while.

    What version of Android do you have? What about your device model? I'm assuming you're running the latest version of APDE (0.2.1)...

  • This is on my LG phone and a Zenithink c91 tablet, both running 4.03

    I am using 0.2.1 installed from playstore.

    Also another issue.. both my phone and tablet lock up, requiring a restart if I repeatedly use the backspace key.

    Mark

  • edited February 2014

    @hudson_m4000: Are these problems new in the latest version, or have they always been present?

    The backspace bug seems particularly strange. When you say that your phone / tablet locks up, requiring a restart, do you refer to restarting the app or the device? (Restarting the entire device would be awful... but just to be sure...)

    I'll try to replicate these behaviors in a 4.0.3 emulator later, but it may have more to do with LG / Zenithink's custom Android implementations, in which case I may not be able to fix all that much...

  • I don't remember with earlier versions, but I didn't try much coding then. Have been using quite a lot during the past 2 days so first noticed yesterday.

    Re the backspace, on my phone it's a complete reboot, but on my tablet it will give the 'not responding' message allowing me to quit.

    I will try to find a repeatable scenario to be more specific as to when these issues occur.

  • edited February 2014

    @hudson_m4000: Thank you for the feedback. I don't think that you should have to restart your phone in order to kill a single app, but I'll leave that up to you. Time to debug some bugs...

  • First off this is AMAZING!!! Thank you for your hard work.

    Bug report. When I compile it doesn't seem to import the data folder. Moto G 4.4 kitkat If you could publish this to the amazon market place that would be awesome. Again thanks a ton man. This is so rad.

  • @exithead: Thank you for the feedback! Indeed, it appears that the data folder is currently broken. This should be fixed for the next release. I will also look into publishing for the Amazon Marketplace.

  • edited September 2014

    After almost a month, APDE version 0.2.2 Alpha is available.

    This release should iron out most of the bugs, including those reported by @exithead and @hudson_m4000.

    For this release, I am distributing the update to a portion of the user base initially because I am somewhat concerned about breaking something. If the roll out goes smoothly, the update should be available to all users within three to four days. I am choosing to go this route because the number of users is significantly larger than it was before either of the previous two updates. If you want the update now, you can still get it from GitHub.

  • any progress on configurable storage location? I have an S3 with 16GB internal, and no microSD card inserted. I'm getting crashes, and creating a Sketchbook folder on the internal storage doesn't seem to get picked up in the app.

  • edited March 2014

    @chrwei: I remember hearing about this issue before, but somehow it didn't make it onto my to-do list for the most recent update. I realize that it is indeed a significant (and fundamental to the use of the app) problem. I will include an option to change the sketchbook location in the next update.

  • I just want to say again this is so cool. Lol.

  • just rediscovered Processing, reading Pragmatic Programmer's Rapid Android Development, and found APDE v0.22 !!! Pasted several examples and it worked great, eager to import ketai.ui.*; Really very functional considering it is still called an alpha !!!

    Great Job!

  • edited September 2014

    APDE v0.2.4 Alpha is now available, and with it, contributed library support! (It might take a couple of days before it rolls out completely.)

    I didn't post here for v0.2.3's release, so here's the combined change log:

    Changes:

    • Support for contributed libraries
    • Added Library Manager, supports installation of zipped libraries (includes pre-build dexing of library JARs)
    • Added full support for devices without an external storage (Sketchbook and build can be moved to internal storage)
    • New fragment-based Settings screen
    • New special character insertion tray for use with software keyboards
    • Improved coding assistance - auto indentation works on more devices and code block completion has been implemented
    • Support for code and code-dex folders in the sketch folder

    Bug fixes:

    • Two bugs causing tabs to overwrite each other have been resolved

    It is not yet possible to download the libraries in-app (for reasons outline in the documentation, see the second to last paragraph in the Key Changes heading), but APDE includes a library extractor and pre-dexer for zipped libraries. This obviously isn't ideal, but it should be sufficiently usable for those interested in using libraries like Ketai on their phones.

    Also, there is no easy way to access library examples - this is coming in the next release (there needs to be a major reworking of the Sketchbook folder). For the time being, you can locate the library's installation folder and copy the examples into the Sketchbook folder manually (again, not ideal).

  • Hi there. I've got some first experiences with processing and found APDE for my Note Pro 12.2. Thank you so much for your work and effort, it runs perfectly on my NotePro.

    Unfortunately I am not much experienced in Java or Android development, but I like to use the video library within the APDE. When I use the link in the library manager to the processing website, it says that it it already in standard processing included. Can you please provide the dexed standard libraries for usage within APDE.

    Thanks in advance.

  • @Uhliwa: Thank you for the feedback! The video library is not supported by APDE because Android mode has no core libraries. For more information, please see my response to a previous question. I'm sorry for the inconvenience...

    APDE contains a link to Processing's libraries page with the hope of making it easier for users to download libraries - this is because I have yet to implement a library downloader (it is not as simple as it sounds, I have a good reason for not doing this yet). However, this page does not make clear which libraries are (or aren't) available in Android mode as it was created with Java mode in mind.

  • what is the difference APDE with PDE processing? and what the pros and cons?

  • Hi i cant find how to save the sketch and also to rename it im using Gt-I9300 and android vrsion 4.3 can you tell why it has the problem?

  • @Milos: To save the sketch, select the "Save Sketch" option from the action overflow menu. If you have not yet saved the sketch and the sketch is named "sketch", you will be prompted to enter a new name. After you have saved the sketch, it will save automatically, but you can manually invoke the save command with the same option as above.

    To rename the sketch, open Sketch Properties (from the action overflow menu) and and press the "Rename Sketch" button (the pencil icon in the action bar). Renaming the sketch will change the file name on the disk.

    @paizahmad: It seems that I missed your comment. This may not be of much use to you now... but for future reference, some of the key differences are outlined on the GitHub page. Most importantly, the editor is on the phone (obviously), so there are major use changes that come along with that... Debugging is not currently supported very well in APDE due to log viewing permissions on Android (there is no console output for the sketch), although I have a workaround planned. APDE does not currently support any of the Processing 3.0 features (code completion, breakpoints, etc.).

  • Thanks for the latest APDE update which now includes the export signed package tool.

    I tried to export my first app and used the Create keystore function, but I couldn't get it to work. After I enter the new keystore and password information and tap "Create" it takes me back to the "Export Signed Package" popup and tells me the "Keystore file does not exist". I'm obviously doing something wrong, but I'm not sure what. Any help would be appreciated. Thanks.

  • @G_G: If the file is correct and it is local to the device, then it may point to a directory - the same error message is reported (perhaps this should be changed...). It may also depend on the file manager you are using and how it handles file selection... you may need to enter part of the path manually. Make sure that you edit the value so that it points to a new file, not one that has already been created (or a directory that has already been created).

    If it still fails... what is the path to the keystore file? There may be issues related to certain device file structures...

  • @calsign: This is just pure awesomeness. I was cooking up a drawing app for my android tablet using processing and your program takes days of tweaking and configuring out of the prototype development, huge kudos! A couple of stoopid questions as I'm noob on both processing and android system in general:

    1. How would I go about recording and saving a PDF file? The lib is not included, am I right? And is it even supported on Android?

    2. Where does APDE store the built .apk file?

    • huge huge thanks for this, great work.
  • @Loadus: Thank you for the kind words.

    As far as I know, the PDF library is not supported in Android mode. After a quick glance, I cannot tell if there is any dependency tying this core library to the desktop... at some point in time, I will begin to work on supporting core libraries (and improving Android mode in general), but I'm focusing on the editor for now. There are PDF libraries available for (native) Android, but in terms of integration at the same level that the core library provides, you are probably out of luck.

    By default, the sketch is built on the (private) internal storage and the build folder is deleted. You can change this behavior with Settings > General > "Build on Internal Storage" and "Delete old Build Folder" at the same location. If both of the options are disabled, the sketch will be built in the "build" folder on the external storage (I use this for debugging, so it can't be changed...). Within the build folder, the "bin" folder contains the generated APK ("appname.apk", with an icon). However, this APK file is unsigned and was built in debug mode.

    If you want to get a production APK file, you can export your sketch as a signed package (available with version 0.3.1, fully rolled out as of today). Go to (action overflow / menu) > Tools > "Export Signed Package". You will be required to create a keystore and a key (make sure you keep the keystore safe and use good passwords for both), but the resulting APK file is built in release mode and has been signed, and is thus suitable for uploading to Google Play. I would recommend this option (partially because it is new, I admit), but the debug APK may very well be suitable for your purposes.

  • @calsign: yuh, I was afraid that the PDF lib is not supported, oh well. : /

    I'm just basically looking for a way to save the drawing in vector format (or just save the drawing data for now).

    Export Signed Package is exactly what I needed, as I have the keys + Google Play dev account. This is just brilliance.

  • @calsign Thanks for the reply. I'll try it again over the weekend.

  • @calsign: I have some .java files in the sketch folder, can they be loaded as well when opening the sketch? :-$

  • It appears that .JAVA files are not currently supported... this will be implemented for the next release. Sorry for the inconvenience.

  • @calsign: nou pänik, I'll just use the normal Android build route from PC in the meantime. ^.^

  • i truly admire your work, this is just so phantastic for all of us people how hate it to get the development stuff working on the pc. keep rocking! one thing that i just noticed when installing it on my father in laws tablet: the "tools" menu is invisible when you have loaded a sketch. thus, i was not able to install ketai. it took me half an hour of tinkering until i had the intuition to start with a new sketch and then i found it. ux-wise, i'd solve this differently: if you don't want to allow the user to install a lib when there's a sketch loaded let the tools menu be visible and tell the user that he has to save his work and close the sketch first. otherwise it's hard to find out for the user how to find the menu.

  • @assadollahi: The tools menu is currently hidden when an example is loaded. I realize now that this is incorrect behavior - it will be fixed for the next release. However, the menu should still be visible if a sketch (not an example) is loaded. Is the menu behaving properly (based on the way that it is currently implemented) on your device? If not, there may be an (unintentional) bug...

  • Is there a way to import processing.net.* library ? If so, how can i do it? i have already tried to get the jar file from PDE desktop and than dexing it, but after that i don't know where i have to put the dexed jar file(assuming that i dexed it correctly :P)

  • @orasio, I have responded to your email, but I will copy relevant information here:

    APDE's library installer is designed to install the zipped file that would be retrieved by the library manager on the desktop. It is currently designed to work with libraries formatted as per the Processing library folder structure specifications. All libraries that are available from the library manager conform to this structure.

    APDE takes care of extracting the folder structure and dexing the library for you.

    For an example of a properly formatted library, see the controlP5 download available from the website. This file, after being downloaded, is directly consumable by APDE's installer.

    If you want to install the library manually, then you must place the extracted library folder in the libraries folder within the sketchbook just like the desktop... with the addition of the dexed JAR file. For every library JAR, a corresponding dexed version of that JAR must be placed in the "library-dex" folder at the same level as the "library" folder. For example, "controlP5/library/controlP5.jar" must be dexed and placed in "controlP5/library-dex/controlP5-dex.jar". The original file is still needed for ECJ, so don't delete it. Other than extracting, this is all that the "installer" does.

    Note: I don't think that the Processing Network library will work properly in Android mode. Instead, you may wish to consider the oscP5 library.

  • This app rocks, it solves all of my problems. Quick question though, how exactly can you load an image on the device? How would you use the 'loadImage("images/img.png")'?

  • @ChuiGum: Loading images in Android mode is essentially the same as on the desktop - if an image is placed in the data folder, then it can be loaded.

    To add a file to the data folder, navigate to Sketch Properties and select "Add File" (under Sketch Folder). You may also organize the files into sub-folders (with an external file manager) - for example, an image at path/to/data/images/img.png can be opened with:

    PImage img = loadImage("images/img.png");
    

    Alternatively, you can load an image with an absolute path to the file on the device. However, if this file is located in a restricted portion of your device's storage, you must enable the permission READ_EXTERNAL_STORAGE (from Sketch Properties > Sketch Permissions).

  • Thanks for the quick reply. Wow, I never noticed that "Add File" button in Sketch Properties. Dang, I need to open my eyes. Thanks for the help!

  • Hi Like everyone else I love this app really easy to work between PC and tablet for android, so many thanks to @calsign for making this possible :)

    I am now ready to try and export a signed apk but cannot get it to work, I have tried to create a new keystore, but like G_G back in September I get returned to "Export Signed Package".

    So, when I select '+" and then navigate into my file manager to create a keystore, what am I looking for? Does this process create a keystore/keyfile or are these things I am looking for in my file manager that I should have already created by some other means?

    This is new to me so if anyone can help... if I have to create/set up a keyfile and/or keystore first, how do I do that?

  • @hudson_m400: Perhaps this is a little bit confusing. The "Create Keystore" dialog creates a new keystore at the specified file location. The file explorer button is provided to make it easier to find a file location on the file system... but you should edit the path that it auto-inserts so that it points to a new file. I can't get better behavior than this without creating my own file manager (something that will have to happen eventually...).

    After you have entered and re-entered your password, if the specified keystore file already exists, the warning message "Will overwrite existing file" appears in yellow. This won't cause any problems as far as the keystore is concerned, but you will lose the original file. It is recommended that you change the path to point to a new file.

    It appears that problems arise when you try to create a keystore on top of an existing directory. This shouldn't be possible, so it is a bug. Don't try to create keystores on top of existing directories.

    After creating the keystore, you should be returned to the "Export Signed Package" dialog, but with the keystore file and password fields filled in with the corresponding values for the just-created keystore. If it says "Keystore file does not exist", then close the dialog and check the console, because chances are that there was a problem creating the keystore. I have only been able to reproduce this by trying to create a keystore on top of an existing directory. This stack trace should be helpful in resolving the problem if there is something else going on.

    If this still doesn't work, then please provide the path to the keystore file that you are trying to create and the stack trace described above (if there is one).

  • @calsign Many thanks for the detail of your reply! I have successfully made a keystore/file now. It all worked very well.... :)

  • now....

    I am trying to run a fairly large sketch (lots of classes, functions etc in different tabs). It is fine on my PC, but I am getting "unexpected token: void" as an error during syntax checking, as it finds one of my functions.

    As it's a big sketch, before I start trying to figure this out I thought I'd just ask if this is happening to anyone else? Is there for example any need for classes and functions to placed in sequence (functions before classes, for example). As already said, on my PC there is no problem, and the code is identical.

  • edited November 2014

    Just noticed that tabs with many lines of code are not fully loaded. Is there a limit to number of lines of code a tab can have?

    EDIT: This also happens if Ioad the tab/pde file into any basic text editor. Something wierd is happening? any body have any ideas?

    EDIT2: a bit more testing... APDE is not only not loading the full file, but is auto saving the incomplete file when the tab is selected... which is why it also then appears wrong in a text editor.

Sign In or Register to comment.