Giter VIP home page Giter VIP logo

processing-android's Introduction

Processing for Android

This is the main repository for Processing for Android. It includes the core library inside the core folder, and the mode itself in the root. See the wiki for build instructions.

The core, VR, and AR libraries are available on JCentral, so they can be easily imported into Gradle projects:

processing-core

processing-vr

processing-ar

processing-android's People

Contributors

codeanticode avatar benfry avatar omerjerk avatar imilka avatar manav-mj avatar rupak0577 avatar syamsundarkirubakaran avatar manindra29 avatar irealva avatar ybakos avatar kiwistrongis avatar lonnen avatar reas avatar jwill avatar suheb avatar qianlvable avatar shiffman avatar gkfx avatar jakubvaltar avatar loadus avatar b2renger avatar boubpopsyteam avatar gohai avatar joshgiesbrecht avatar kfrajer avatar

Watchers

James Cloos avatar Deeraj Esvar R avatar

processing-android's Issues

SDK download window should resize properly

If the user wants to resize the window to see the default installation path, the window should resize properly instead of being fixed to the upper right hand corner like this:
resize

Emulator cannot be connected / Run in pr

Reports given by @kfrajer :

I am also unable to run a sketch in any of the recently created devices (tried both emu-alpha and emu-beta NOTE: Processing-phone is not in the list) but it did not work. I get the following error (screenshot at the end):

Emulator process exited with status 1.
EmulatorController: Emulator never booted. NOT_RUNNING
Error while starting the emulator. (NOT_RUNNING)
Shutting down any existing adb server... Done.

image

Emulator never booted error is being shown, because of which the sketch is never run.

Brief Android Info popoup

Create entry in the PDE menu that provides sys info (Android SDK, tools, platform available, emulators, etc) installed in the PDE as well as provides a template to report bugs, issues and feature request either in GH or the P3 forum.

Definition of UX for milestone #1 and #2

@DeerajTheepshi @sarahlensing I wanted to talk about the current user experience(UX). When milestone 1 and 2 are done, we will have a revamped version of the SDK installer, SDK updater and the emulator installer/manager. I don't expect the SDK updater will change the current UX beside the discussed features to update individual components. On the other hand, the installer and emulator will introduce a new layer to the UX that will need to be discussed and properly defined.

Let me describe the current experience.

  • [L1] The user using the PDE switches into Android Mode
  • [L2] If the Android SDK is not detected, it will display a dialog box asking to do either an "automatic install"(a) of the Android SDK or "provide the SDK path"(b) if the Android SDK is already installed in the local computer.
  • [L3] The manual install (b) provides a file selector dialog box where the user provides the path for the Android SDK
  • [L4] An automatic install will download and setup the AndroidSDK in Processing's sketchbook folder (Fix location)
  • [L5] If the user selects manual install (b) and quits or does not provide a valid path, there is a message displaying "The Android mode has been disabled" and the installation fails.
  • [L6] If the user runs an app in disabled Android mode either by pressing run or by running on an emulator, he/she will get an error in the PDE's console.
  • [L7] If the Android SDK path is provided in (b), then it is my understanding that the emulator device is neither downloaded not installed (?) (Intended behavior?).
  • [L8] To verify: Would launching the app on the emulator in the PDE trigger the installation of the (default) emulator device?
  • [L9] If automatic install (a) is selected, then I believe the Android SDK is installed together with the emulator. In other words, this is an automated process with minimum user intervention and therefore, perfect for new users.
  • [L10] Note the Android SDK installer does not overlap with the Android Mode install in the Processing IDE. In other words, when the user is running PDE in Java Mode and he/she wishes to use the AM, he will need to install it first via the Contribution Manager >> Mode. After the AM is installed, then the user will be prompted to install the AndroidSDK. ([This need to be verified that this is the intended behavior]

After miletose 1+2 are completed, the new UX will be along the next lines:

  • [L101] AndroidSDK installer will show up when the user selects the AM in the PDE and PDE fails to locate the AndroidSDK files.
  • [L102] New feature: The installer provides a button in the installer message dialog allowing people to choose a folder where to install the AndroidSDK in case of automatic install (a). As default folder input, this File Selector should indicate the path to the sketchbook folder.
  • [L103] Should the user also use this Folder Selector window to indicate the path of the AndroidSDK (b) in case if it was previously installed?
  • [L104] In case of auto-install, then this will also install the default emulator.
  • [L105] Should this previous point be the intended behavior?
  • [L106] Note that there is not AndroidSDK install option available in the PDE menu.
  • [L107] Any updates for the AndroidSDK would be managed by using the revamped SDK installer.
  • [L108] Now the emulator: Installing a new emulator device should be done through the Emulator viewer/installer. This would be triggered from the PDE menu, probably under the Android menu title.
  • [L109] The emulator window option dialog box should be available only after an Android SDK has been successfully installed (?).
  • [L110] There is a variable called ANDROID_AVD_HOME where indicates where to find currently installed emulators. This could be another File Selector to allow users to indicate where the emulators should be installed (To be discussed)
  • [L111] The menu in the PDE should display all the available emulators and the user should be able to select any of them to launch their sketch.
  • [L112] Stopping the emulator should not affect the PDE
  • [L113] The PDE could fire multiple devices. How to manage them?
  • [L114] Need to handle cases when the android mode is disabled for the PDE and the user attempts to launch a sketch on an Emulator or any new device. Should these operations be blocked when the AM is disabled?

This is a start of the user experience before and after your work. Notice that this can change or it can be improved if needed. We also need to keep in mind that Processing and, in this case the Android Mode, both should be leaning towards simplicity and easy to use to permit new users start using the technology right away without needing to know a lot about the Android technology.

Downloader should check if android dir exists

If I already have an android/ in Processing but have removed or renamed the sdk folders (here I renamed them as a test), the SDK downloader should:

  1. download the SDKs into that existing dir
  2. set it as the default directory from the SDK downloader UI

Here, you can see that after I selected my existing android/, it placed them into android/android/sdk instead of android/sdk

detect-1

detect-2

detect-3

SDK updater: cancel when installing a platfrom

Issue:

When I use The SDK updater to install a platform, if I hit cancel, the installer cancels as intended but the install button does not change to install but to "Refresh" as you can see in the image next: https://i.imgur.com/UbJRjOE.png

Expected behavior:

When I click cancel, the button's content changes from refresh to install.

Note:

if I click refresh, I get a popup indicating "Not platform selected" and then the button's content reverts to "Install"

Testing of Android SDK installer on Mac

Summary:

Test the flow of Android SDK installer on Mac OS

Steps:

First, make sure the PDE is not running. Locate the Processing's preference.txt file (You can find it if you run the PDE and then go to File>>Preferences and the location of the preferences.txt file is at the bottom). Open this file and removes all lines related to Android settings as these lines are created by the intaller. An example of what you need to remove:

android.sdk.ar=1.2.0
android.sdk.gvr=1.150.0
android.sdk.path=C:\Users\C\Documents\Processing\android\sdk
android.sdk.play_services=11.0.4
android.sdk.support=26.0.2
android.sdk.target=26
android.sdk.wear=2.1.0

There could be more lines and you can removes those ones as well. Before removing these lines, you can backup the file if you feel like doing so.

Then start the PDE. If it starts in Android mode, switch to Java and follow the next steps:

  • The user launches the PDE running in java mode
  • The user switches to AM
  • A popup appears asking if automatic or manual install
  • User by error clicked on manual installer.
  • A fileChooser is shown. The user clicks cancel (Relevant)
  • A second message shows saying Android Mode is disabled
  • The user reverts to java mode
  • The user then switches back to Android mode.
  • A popup asks if automatic or manual install (Relevant)
  • The user clicks automatic install and then the Automatic Dialog menu shows up (Relevant)
  • This dialog shows what it will be installed, location and a button to change it
  • Please press the back button (Relevant)
  • The simple menu automatic or manual install appears again
  • The user clicks automatic install and then the Automatic Dialog menu shows up
  • Finally you click install (ensure there is not a previous SDK in that location !!!) and it will proceed to install (about 400MB) the required files including (Next for Windows):
    --- platformToolsFilename: platform-tools_r29.0.1-darwin.zip
    --- buildToolsFilename: build-tools_r29-linux.zip
    --- platformFilename: platform-29_r01.zip
    --- toolsFilename: sdk-tools-darwin-4333796.zip
    --- usbDriverFilename: usb_driver_r11-windows.zip (Only for Win OS)
    --- haxmFilename: haxm-windows_v7_5_1.zip (Only for Win OS)

Report:

  • Report any issues inn the steps above
  • You should be able to run a simple sketch on a device (No emulator at the moment)

Truncated text in Automatic Dialog box

Increase the dimensions of the dialog box so it display the full text for both the selected folder path and the buttons. I suggest to add the tool tip text feature to the Text Field for the selected folder path in case the selected path is too long.

mnual_download_PR2

Run Configuration only lists one device (only 1 of 2 connected)

I have one device connected and the Run Configuration displays it as expected when I clicked the radial button. However, If I connect my tablet, it does show the tablet but it does not show my phone. While in the "Run Configuration" window, if I unplug the tablet, then the list updates and it shows my phone. Image attached when I connected my tablet (my second device)

PDE-emu-avd-x1b-bug

Change the buttons in the install dialog menu

I suggest to change the buttons here[1]. Instead of two buttons, Continue and cancel, to have three buttons: Install, Back, Cancel

This means that the "back" button will take the user to the first dialog screen[2] in case the user wants to select the Android SDK folder.

Cancel will gracefully failed the install and disabled the Android mode as it is currently done.

[1] Current buttons
mnual_download_PR2

[2] Opening dialog screen
javaw_rUFUNwIR9m

AndroidSDK installation workflow glitch #2

Intended behavior:

  • The user launches the PDE in java mode
  • The user switches to AM
  • A popup asks if automatic or manual install
  • User by error clicked manual installer.
  • A fileChooser is shown. The user clicks cancel
  • A second message shows saying "AM is disabled"
  • The user reverts to java mode
  • The user then switches to Android mode (again)
  • A popup asks if automatic or manual install
  • The user clicks automatic install and then the Automatic Dialog menu shows up (***)

Bug:

In the last step, the dialog does not show up but instead, the installation starts right away and the progress bar dialog box is shown immediately.

Additional notes:

  • Similar behavior is observed in other workflows. When a popup message with "Android Mode is disabled" appears, next time the Android installer flow is executed, it sometimes skips the automatic AndroidSDK installer's menuand launches the progress bar.
  • Since this issue is observed even after restarting the PDE, I have the following theories:
    • Is there a state saved in the preference.txt file?
    • The installer workflow is looking for the temp folder where the AndroidSDK download are stored
    • The Android SDK workflow takes into account the fields present in the preferences file. When a download is canceled, the preference files already have the following fields:
      android.sdk.ar=1.2.0
      android.sdk.gvr=1.150.0
      android.sdk.play_services=11.0.4
      android.sdk.support=26.0.2
      android.sdk.target=26
      android.sdk.wear=2.1.0

Environment:

  • OS: Microsoft Windows [Version 10.0.17763.557]
  • Processing AM (First line "git log --pretty=oneline"):
    fc361dc (HEAD -> android-0274-v4.1.0-beta3, dfork/android-0274-v4.1.0-beta3) [Fix] Remove cancel,Resize path
  • Processing (First line "git log --pretty=oneline"):
    37108add372272d7b1fc23d2500dce911c4d1098 (grafted, HEAD -> master, origin/master, origin/HEAD) attempt to use 8u212, but Oracle has broken the download

Using Emulators from AS

As requested in this Processing forum's post, to be able to access emulators defined in Android Studio from Processing.

Key concept: To use emulators already defined in Android Studio or to allow the user to setup the emulator home folder in the same location as defined by AS.

How to get the Android Emulator home folder?

Emulator listing different in AS and Processing Android

Reports given by @kfrajer:

While testing creating devices, I am using the avdmanager CLI and the avdmanager UI from AS as a cross-reference. From my initial testing, they cannot see the newly created devices using the PDE's "Run Configuration" flow. This is my current setup that I have in my D: drive while initially managing emulators using AS:

a nexus5
a Pixel XL
Processing-phone
After I run the "Run Configuration" flow and after creating a coupled of emulators, I get the following in my C: drive from the PDE flow:

emu-alpha
emu-beta
Processing-phone
Both avdmanager CLI and UI (from AS) only shows nexus5, Pixel XL and Processing-phone. However, it seems the Pixel XL is corrupted as well as the Processing-phone as you can see in the image below.

Windows10: It fails installing AndroidSDK

While testing the whole flow for the Android SDK installer, I notice that when selecting the "automatic" installer, the progress bar gets stuck at 78% and it never finishes throwing an error: Installation cancel by user, Android mode has been disabled.

Tested in Windows 10 and P3 version 0270.

Next step:
-Figure out if it fails in downloading resource's step, if it fails when finishing the unpacking and re-arranging the folders or some sort of timeout issue.

Downloader should set mode back to previous if sdk download is cancelled

If I:

  • open Processing in the Java mode
  • change the toggle to Android and get prompted to download the SDK
  • start downloading the SDK and cancel it

After we show the dialog that the Android mode has been disabled, we should set the mode to the previously selected one instead of keeping it on Android

Should show better error message

If I don't have the SDK installed and go into the "Locate SDK path manually" window and press "cancel" instead of selecting a path, this error message shows:

null

It should probably say something like "the SDK path could not be found" or "the SDK path is invalid"

UX buttons: Manual SDKInstaller window

I suggest the following changes:

-The button "Continue" should be renamed "Install" meaning "Install now"
-This button should be the first from left to right
-Only truncate longer folder paths (Red square)
-To discuss, to drop the cancel button and to leave only two: "Install" and "back"

SDKinstaller_selection

Image List not refreshed, Repeated Packages

I run into the following issue when following option 2 above: When I selected and downloaded a system image, everything worked as expected. However, the new image was not made available in the list as it was not refreshed. I have to close the flow and restart the flow of adding a new emulator again. When I arrived to the step of images available, I was able to see it this time (See image below).

SECOND issue: This window shows images installed and not installed. In the image below, I noticed 21 and 26 shows as "Installed" but they are also listed as "Not installed" (I had to scrolled down the list to see them). Expected behavior: If an image is installed, then it should not be shown as "not installed" as well.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.