No serial library Processing for smartphone. Help

OK. But how to cram it when generating an outgoing apk?

please clarify what are the links to?
to github? or share your downloaded libraries?

@ZENAR57 what is the serial library you downloaded i want the link of it


how are you building the apk? Is this the internal build? Ie setting apde to app vs preview or are you talking about something else.

Have you tried setting the permissions in the build settings, ie settings >build>permissions.

Also i have created some code a while back to access permissions in android so that you will get the user choice popup to allow or deny a specific permission.

public class Permission{
  
  PApplet parent;
  String p;

  public Permission(PApplet pParent,String permissionName) {
    p = permissionName;
    parent = pParent;
    parent.requestPermission("android.permission."+permissionName, "onPermissionResult", this);
    println(permissionName);
  };

  public void onPermissionResult(boolean granted) {
    if (!granted) {
      PApplet.println("User did not grant camera permission.",p,"is disabled.");
    }
  };

};

then in your sketch

Permission p;

in setup

p = new Permission(this,"WRITE_EXTERNAL_STORAGE");

change the string value in the constructor to your required permission and finally make sure the matching permission is checked in the apde sketch and build settings.

so for example if I wanted to use the camera I would change the above code to .

p = new Permission(sketch,"CAMERA");
1 Like


then make sure to follow the steps I’m suggesting.
The permissions need to be set in the sketch settings and build settings

three dots > sketch properties > sketch permissions
three dots > settings > build > change preview permissions

then the code I’ve posted above needs to be added in android to request permissions from the user. Also note if you have already built your file once without asking for permissions you will need to delete the build file and reinstall it as further builds will never trigger the request.

that should be it for permissions.

1 Like

This should present you with the following screen when you first launch the app, or one similar for every request you use.

1 Like

Clear.
but I am not a very fast programmer, now I am busy at work, I can only check it late at night at home. thanks.

2021_05_12_11_14_14
2021_05_12_11_22_14

How do normal people get the finished apk in APDE processing? not all, how do I use the additional total commander program to extract the apk installed on the system?
2021_05_12_11_09_30

what version of apde are you using?

1 Like

finally a full guide to install libraries on apde

  • Installation Steps
  • If the library is in a ZIP or other type of compressed file, then extract it.
  • Copy the extracted folder to the libraries folder in the Sketchbook folder and rename it to the desired name of the library., e.g. “path/to/Sketchbook/libraries/Ketai/”.
  • Ensure that the library JAR file is located in the “library” folder in the library’s folder with the same name as the enclosing folder, e.g. “Ketai/library/Ketai.jar”. Copy any additional JAR files to this folder.
  • Optionally, ensure that the library’s examples are located in the “examples” folder in the library’s folder, e.g. “Ketai/examples/”.
  • Optionally, ensure that the “library.properties” file is located at the root of the library’s folder, e.g. “Ketai/library.properties”.
  • Create a new folder at the same level as the “library” folder with the name “library-dex”, e.g. “Ketai/library-dex/”.
  • Open APDE and navigate to (action overflow) > Tools > Import Library > Manage Libraries > (action overflow) > DX Dexer. Note: The library should already appear in the list, but it has not been fully installed yet.
  • In the “Input File” text box, enter the path to the library JAR file, e.g. “path/to/Sketchbook/libraries/Ketai/library/Ketai.jar”. You may use the file select button to aid in locating this file.
  • In the “Output File” text box, enter the same path as above, but change the “library” folder to “library-dex” and change the library JAR file to “libraryName-dex.jar”, e.g. “path/to/Sketchbook/libraries/Ketai/library-dex/Ketai-dex.jar”.
  • Press the “Dex” button. Wait for the dexing process to complete.
  • Repeat steps 7 through 10 for any additional library JAR files.
  • When the dialog closes, the library has been fully installed. It will now be automatically added to any sketch with the import statements at the top.

I havent tested all of these yet but I have attempted the traditional way and couldnt get them to load.

There have been many problems reported with adding libraries to apde

So I’ve managed to successfully install the jcomms library after a few failed attempts here are the steps I followed

then

and select

  • 6 install the library manually using the following steps

in your sketchBook folder create a new libraries folder. Here add a new folder with the name of your library (they must match), in that folder create a new folder called library, and in that folder add your jar file.

This will now allow you to be install them using the apde add library process

2 Likes

@paulgoux all my APDE libraries install this way

1 Like

I have all versions.

just use the latest version. I’ve posted a full guide above to install libraries, and so has Jafal. I understand you may be struggling, but the solution is there.

With both of these posts you should be able to

A add permissions.
B add libraries.

Please make sure to follow the instructions carefully, and report any problems.

1 Like

@paulgoux look for peasy library you have to do the procedure twice one for math file and one for cam file

2 Likes

Is that a question or a statement?

2 Likes