I have been getting help from this forum to learn processing, it's about time i try to give something back.
Android and processing have been a heavy learning curve... but i still do a lot of work in DOS (believe it or not..) so the command line is not a foreign concept.
I have been using the
information here to export my packages..... I found myself doing the same command over and over.
Sooooooo. BATCH FILE! yaaayyy!
anyway,
Copy the below code and save it as .bat
This batch file is set up to run in the sketch directory.
Export Android Project in Processing.
Move or copy the batch file into your sketch directory.
Run the batch and follow the on-screen prompts.
Your signed APK should end up in anrdoid\SignedAPK
Suggestions? Let me know and i can see about adding functions....menu options, extra features... whatever. I will give it a go.
*Edit - Still playing with the program. Just figured out that it doesn't like spaces in the name of the final output. I think that's a function of the zipalign program so i can't do much about it but warn everyone.. I just use underscores as spaces much like you have to do for the sketch folders......
*Edit 2 - update code to run from sketch directory instead of android directory. Easier if you need to redo the export from processing.
@Echo off
cls
ECHO.
ECHO.
ECHO You should ensure your SET PATH commands are set up already to access
ECHO the keytool, ant, jarsigner, and zipalign executables
ECHO.
ECHO To use this batch:
ECHO Please Export Android Project from within processing. (Ctrl+Shift+E)
ECHO.
ECHO This batch file should then be ran from the sketch directory
ECHO.
ECHO The current directory is:
ECHO.
ECHO %~dp0
ECHO.
ECHO.
Pause
CLS
ECHO.
ECHO.
set /p varSketchName="Please eneter the name of your sketch:"
ECHO.
set /p varSketchAlias="Please enter an Alias for your sketch:"
ECHO.
ECHO.
ECHO Generating key file or verifying key if one exists
My app is to control my television. What i want now is to be able to swipe my finger to the side and have the page slide over and show me another set of buttons. I don't think i will have an issue making the second page itself... my questions is more so about the process of create the actual transition and base of the second page.
my current program:
ArrayList buttons; // define ArrayList that will hold instance of ImageButton Class
import hypermedia.net.*; // UDP Library Name
UDP udp; // define the UDP object
String ip = "192.168.5.200"; // the remote IP address
int port = 8888; // the destination port
String message;
int RVal = 0;
int GVal = 0;
long timer;
int difference;
void setup() {
size(800, 1280); //resolution of Galaxy Note
background(0, 0, 0); //Black Background
orientation(PORTRAIT); //Haven't set up the icons for screen rotating so fix it to portrait
Got some advise from this forum a week or two ago. I was advised the G4P Library does get along with android so my existing TV controller sketch would never get along with android. APWidgets was the next suggested. I wanted to maintain the same look though.
I ended up with the attached image as the look for my android app. (the white box is just there to try and see if the boxes are calling the right function, the off button is under there) It's very similar to my pc interface, just a little different spacing. I added two APButtons to the sketch to try and see if i could add a button, make it 0 alpha and set the button over the top of an image. Therefor the end result would be a "clickable image". I ended up with gray buttons that cover up my image. Any ideas on making the hit boxes transparent?
Code below. Any suggestions as to why the on onClickWidget() function doesn't resize the box or send the UPD code?
Thanks very much for all assistance.
import apwidgets.*;
import hypermedia.net.*;
int rectSize = 100;
PImage ae;
PImage discovery;
PImage nick;
PImage cartoonnetwork;
PImage disney;
PImage history;
PImage pbs;
PImage spike;
PImage usa;
PImage tnt;
PImage trutv;
PImage xbox;
PImage poweron;
PImage poweroff;
PImage downarrow;
PImage uparrow;
PImage leftarrow;
PImage rightarrow;
PImage mutebutton;
APWidgetContainer widgetContainer;
APButton aeButton;
APButton discoveryButton;
UDP udp; // define the UDP object
String ip = "192.168.5.200"; // the remote IP address
int port = 8888; // the destination port
void setup()
{
size(480, 800);
orientation(PORTRAIT);
background(0, 0, 0);
aeButton = new APButton(68, 206, 100, 80, "words");
discoveryButton = new APButton(358, 313, 100, 58, "testing");
widgetContainer = new APWidgetContainer(this);
widgetContainer.addWidget(aeButton); //place button in container
widgetContainer.addWidget(discoveryButton); //place button in container
Accidently posted int he wrong thread a bit ago. Apologies.
I made an app that controls my TV via UDP using an arduino mounted behind my tv.
It have the windows version of the app working fine. It opens every time and does it's job. I would like to convert this to an android app. I made the normal changes for Android such as removing the size() call and this kind of stuff. I used the Gui Builder library to do the interface. Seems as though the error is coming with the code in the gui tab.
Gui Code:
void createGUI(){
G4P.setColorScheme(this, GCScheme.BLUE_SCHEME);
G4P.messagesEnabled(false);
TNT = new GImageButton(this, null, "TNT_logo_1999-150.jpg", 1, 77, 303);
TNT.addEventHandler(this, "TNTClick");
Disney = new GImageButton(this, null, "200px-DisneyChannel2010-150.jpg", 1, 285, 293);
Disney.addEventHandler(this, "DisneyClick");
ChDown = new GImageButton(this, null, "green down arrow-125.jpg", 1, 176, 692);
ChDown.addEventHandler(this, "ChDownClick");
VolDown = new GImageButton(this, null, "green left arrow-125.jpg", 1, 88, 561);
VolDown.addEventHandler(this, "VolDownClick");
VolUp = new GImageButton(this, null, "green right arrow-125.jpg", 1, 311, 562);
VolUp.addEventHandler(this, "VolUpClick");
ChUp = new GImageButton(this, null, "green up arrow-125.jpg", 1, 176, 467);
I have two working processing sketches that send UDP packets to my Arduino to control a servo.
One is set up so i press the Z and M key to move the servo back and forth.
the other is two buttons on a gui that serve the same purpose.
This works ok for controlling one item incrementally. Eventually this will end up being a control system for a robot. I want to be able to send an int or a long via UDP. Even if i have to pull them on the remote end by reading and bit shifting the individual bytes.
Mostly i would like to be able to send values from the processing side rather than having everything converted to it's ASCII values.
I know there has to be a way. I am just not experienced enough to figure it out.
Can't compile. Trying to learn App Development using processing and this is kicking my butt!
processing 1.5.1
AndroidSDK re-downloaded today
downloaded Apache ant and installed to tools folder
looks like all the paths are correct in the error. The files are where they are supposed to be for everything after AntClassLoader
what am i doing wrong. I have been scavenging google all night, uninstalled and reinstalled all kinds of stuff, tried moving files and modifying things as directed by various forums.....
When i try to run in emulator i get:
BUILD FAILED
C:\Users\MyName\AppData\Local\Temp\android8734534149726631889.pde\build.xml:15: taskdef class com.android.ant.SetupTask cannot be found
using the classloader AntClassLoader[C:\AndroidSDK\tools\lib\anttasks.jar;C:\AndroidSDK\tools\lib\common.jar;C:\AndroidSDK\tools\lib\sdklib.jar;C:\AndroidSDK\tools\lib\androidprefs.jar;C:\AndroidSDK\tools\lib\mkidentity.jar;C:\AndroidSDK\tools\lib\commons-compress-1.0.jar;C:\AndroidSDK\tools\lib\httpclient-4.1.1.jar;C:\AndroidSDK\tools\lib\httpcore-4.1.jar;C:\AndroidSDK\tools\lib\httpmime-4.1.1.jar;C:\AndroidSDK\tools\lib\commons-logging-1.1.1.jar;C:\AndroidSDK\tools\lib\commons-codec-1.4.jar;C:\AndroidSDK\tools\lib\manifmerger.jar]