# No serial library Processing for smartphone. Help

**URL:** <https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870>\
**Category:** Processing for Android\
**Created:** [May 5, 2021, 9:34am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870 "2021-05-05T09:34:04Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 7:41am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/121 "2021-05-12T07:41:09Z")

</div>

> [@paulgoux](#):
>
> In any case youll always need an xml file to pass info to your main activity.

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

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 7:44am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/122 "2021-05-12T07:44:52Z")

</div>

> [@jafal](#):
>
> give me the link of it

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

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [May 12, 2021, 7:49am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/123 "2021-05-12T07:49:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 7:54am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/124 "2021-05-12T07:54:45Z")

</div>

> **[Release 0.2.0 · inventit/processing-android-serial](https://github.com/inventit/processing-android-serial/releases/tag/0.2.0)**
>
> //github.com/inventit/processing-android-serial/releases/tag/0.2.0

 ![Screenshot_20210512_105235](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/21034f23f6c8c1e7910b41e63c6676f06c8b8e87.jpeg)  
 ![Screenshot_20210512_105154](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/586f905c830ce310384f8ae3370b5b67134bc779.jpeg)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 7:55am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/125 "2021-05-12T07:55:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 7:58am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/126 "2021-05-12T07:58:36Z")

</div>

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.

```auto
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

```auto
Permission p;

```

in setup

```auto
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 .

```auto
p = new Permission(sketch,"CAMERA");

```

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 8:05am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/127 "2021-05-12T08:05:55Z")

</div>

> [@paulgoux](#):
>
> 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.

 ![Screenshot_20210512_110316](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7f7bf498f4f5db2c692f0a2879ab2e328a8751c2.jpeg)  
 ![Polish_20210508_192042550](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2734eef23b5f34af11056b3a1c381ab54e789094.jpeg)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 8:10am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/128 "2021-05-12T08:10:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 8:14am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/129 "2021-05-12T08:14:17Z")

</div>

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

 ![Screenshot_20210512_091251_com.google.android.permissioncontroller](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6c554830680d5cc5c15b0364f1e8dcaa83695f39.jpeg)

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 8:19am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/130 "2021-05-12T08:19:32Z")

</div>

> [@paulgoux](#):
>
> then make sure to follow the steps I’m suggesting.

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.

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 8:23am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/131 "2021-05-12T08:23:19Z")

</div>

> [@paulgoux](#):
>
> This should present you with the following screen when you first launch the app, or one similar for every request you use.

![2021_05_12_11_14_14](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/801f0a1c50c7203436fc974431aab2ae6c9f96d3.gif)  
 ![2021_05_12_11_22_14](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d7979a63aa8928cde2076597147a89b8ecc5c295.gif)

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 8:32am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/132 "2021-05-12T08:32:11Z")

</div>

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](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0da9c388ada9133b4e44b2fafe1a7aaf2f5f7d6d.gif)

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 8:39am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/133 "2021-05-12T08:39:40Z")

</div>

> [@paulgoux](#):
>
> Have you tried setting the permissions in the build settings, ie settings \>build\>permissions.

 ![Screenshot_20210512_113616_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/fcdce553d165802c7d87e5b502c3d944b8a9a10e.jpeg)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 8:48am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/134 "2021-05-12T08:48:08Z")

</div>

what version of apde are you using?

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 9:08am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/135 "2021-05-12T09:08:14Z")

</div>

finally a full guide to install libraries on apde

> **[Installing Contributed Libraries](https://github.com/Calsign/APDE/wiki/Installing-Contributed-Libraries)**
>
> Source code for APDE: Create and run Processing sketches on an Android device. - Calsign/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

> [@Can't use libraries](https://discourse.processing.org/t/cant-use-libraries/6735):
>
> Hello, I really want to use libraries on Android. Although if I import them, I get a few errors in the console: name.jar is mentioned in export.txt, but it'sa big fat lie and does not exist. I followed the manual install guide. How do I install it properly and use it correctly? Btw, what’s better: Beads or Minim?

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/2342/android-pde-create-and-run-sketches-on-an-android-device/p2)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

> <https://github.com/Calsign/APDE/issues/81>
>
> So, I've read through the relevant wiki pages about libraries and I wanted to te…st the process with the ketai zip.
> 
> I downloaded it, opened up APDE, then went to Tools\>Import Library\>Manage Libraries\>Install Compressed Library, and select the ketai.zip file. Then APDE crashes, displaying "APDE has stopped working."
> 
> Ultimately, I want to add the processing Serial library to APDE so I can communicate between an arduino and my phone. \*\*Does anyone have advice on what to do OR, preferably, a simple step by step guide on how to add the serial library to APDE starting from the github page for processing libraries?\*\* I'm a little new to processing and very new to APDE, so thank you ahead of time! If you need any more info that might help, let me know
> 
> EDIT: I figured a roundabout way to add the ketai library, but I'm still having trouble formatting the serial library from the processing repository into a format that APDe will accept. IF you have any advice, I'd be grateful

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

> **[jSerialComm](https://fazecast.github.io/jSerialComm/)**
>
> jSerialComm : Platform-independent serial port access for Java

- 1 create new sketch.
- 2 change the sketch name  
 ![Screenshot_20210512_100335_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/60ae06ec87593f44b8e361394e1450335b70341c.jpeg)
- 3 change the sketch display name
- 4 change the sketch package name  
 ![Screenshot_20210512_100346_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1a6a9e60882534eb9334e4f9f0eb9bdba52623f1.jpeg)
- 5 make sure apde is not building to internal storage

 ![Screenshot_20210512_085502_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/bfae2d02343c1d2df72dace28bcee7905cd788f8.jpeg)

then

 ![Screenshot_20210512_101515_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/729806e735f16b3c14a56868ad325c0fd5584865.jpeg)

and select

 ![Screenshot_20210512_100128_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/88cabb836d4954cb74e3cf7d87252d0ec5134ae0.jpeg)

- 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

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [May 12, 2021, 9:21am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/136 "2021-05-12T09:21:01Z")

</div>

@paulgoux all my APDE libraries install this way

> [@jafal](#):
>
> Usually I follow this procedure
> 
> 1. If the library is in a ZIP or other type of compressed file, then extract it.
> 2. 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/”.
> 3. 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.

---

<div class="post-metadata">

**Author:** ![ZENAR57](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@ZENAR57](https://discourse.processing.org/u/ZENAR57)\
**Post date:** [May 12, 2021, 9:21am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/137 "2021-05-12T09:21:55Z")

</div>

> [@paulgoux](#):
>
> what version of apde are you using?

I have all versions.

 ![Polish_20210512_121836374](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c5459133037517eb2f1d2f6eb55b3ea0ef4af0a4.jpeg)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 9:25am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/138 "2021-05-12T09:25:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [May 12, 2021, 9:25am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/139 "2021-05-12T09:25:21Z")

</div>

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

 ![Screenshot_2021-05-12-12-23-42-817](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6591b35110da7136e7b3199de278ccbe281475e0.jpeg)

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 12, 2021, 9:30am UTC](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870/140 "2021-05-12T09:30:57Z")

</div>

Is that a question or a statement?

[Previous page](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870.md?page=6)

[Next page](https://discourse.processing.org/t/no-serial-library-processing-for-smartphone-help/29870.md?page=8)
