We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have the ketai library and wrote this: import ketai.ui.*;. Then this: import android.view.MotionEvent but the console prints me: No library found for android.view. The label above the console prints me:"The type android.view.MotionEvent cannot be resolved. It indirectly referenced from required .class files". How can I fix this? Do I have to download something? If I have to download, how can I download it?
Answers
@infsys== can you send your code??? - There is some problem with your import but i have to see...
Code from the book Rapid Android Development by Daniel Sauter that I used for learning:
http://forum.Processing.org/two/discussion/8045/how-to-format-code-and-text
Thanks. Paste, select, then c button. I edited the code. :D
On Android Mode the label says "Error from inside the Android tools, check the console." But in the console prints: java.io.FileNotFoundException: C:\Users\Carlos\Documents\Processing\modes\AndroidMode\icons\icon-96.png (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(Unknown Source) at processing.app.Base.copyFile(Base.java:2698) at processing.mode.android.AndroidBuild.writeRes(AndroidBuild.java:807) at processing.mode.android.AndroidBuild.createProject(AndroidBuild.java:169) at processing.mode.android.AndroidBuild.build(AndroidBuild.java:91) at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:227) at processing.mode.android.AndroidEditor$16.run(AndroidEditor.java:513) [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin [echo] C:\Users\Carlos\Desktop\Processing-2.2.1\tools/../modes/java/mode/ecj.jar [echo] org.eclipse.jdt.core.JDTCompilerAdapter
-set-mode-check:
-set-debug-files:
-check-env: Android SDK Tools Revision 24.3.3 Installed at C:\Users\Carlos\AppData\Local\Android\android-sdk
-setup: [echo] Project Name: GestureChap2 Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup: Using latest Build Tools: 22.0.1 [echo] Resolving Build Target for GestureChap2... Project Target: Android 5.0.1 API level: 21 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\res [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\rsObj [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\rsLibs [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\gen [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\classes [mkdir] Created dir: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\dexedLibs [echo] ---------- [echo] Resolving Dependencies for GestureChap2... Library dependencies: No Libraries
[subant] No sub-builds to iterate on
-code-gen: Merging AndroidManifest files into one. Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 3 source files to C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\bin\classes
v cannot be resolved
1 problem (1 error) BUILD FAILED C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\build.xml:15: The following error occurred while executing this line: C:\Users\Carlos\AppData\Local\Temp\android1452769842111108320sketch\build.xml:28: Compile failed; see the compiler error output for details.
Total time: 5 seconds
@infsys:::
tested the code --- not any problems with import ----your error is described in the console message::
a) what is "X", what is "Y"; change X for x and Y to y
b) "v" is never typed or defined; try "float v = px -py" or something like this ( i cannot guess because i know "onFling()" bt never seen onFlick(); with onFling() px && py are velocity for the gesture:: could it be that "v" is here for "velocity"???
after that no more errors for me...
--- it seems also that one icon is not present in your android mode folder but that is not very important for the moment, probably the laucher icon
Yes. X to x, Y to y and an additional parameter float v for velocity. I never thought those were the errors. I have to be careful with the syntax. I thought it was the import. There is no yellow line indicating the errors in Android Mode. Thanks. This code will be helpful for the games: for ex. I was using mouseClicked() but now I have real options for Android mode.
@infsys: forget on mousePresssed() & so on:: you are on a smartphone && there are a lot of gestures (more than in your code)... happy to help.