I have just started using selenium to do some HTML parsing in a java project, but for some reason, when I try to run it in an Android environment, I get a ClassDefNotFound error.
I set up my classpath the same way for both java/android projects and have the correct standalone jar.
Is there any reason why Android cannot accomplish this even with the supplied library?
Also I am using Eclipse, developing on Android API 16.
Thanks!
Try moving the .jar to yourproject/libs/. ADT scans this folder ('libs', not 'lib') for libraries, and sometimes gets confused if they're added manually from somewhere else.
Don't forget to refresh the folder in the package browser after you add it.
Related
I am trying build an android application that scans for the available access points and saves it in an array.
I was able to do it using eclipse and android studio but I am unable to do it from droidscript application.
I went through WiFi demos in droidscript to no success.
Just wanna know how can I achieve this using driidscript app.
You probably need to create a DroidScript plugin to do that. You should be able to just paste your Java code into the plugin template. Note: The latest alpha of DroidScript makes it really easy to do that as it can generate the AIDE code for plugins automatically.
I've been searching the web for half a day now but I just can't figure out how to create a new Android Library with Android Studio.
I've tried doing things like this: How to create a library project in Android Studio and an application project that uses the library project
But when I enter the New Module menu it just says "Nothing to show".
I can't find out why or how to fix it.
Is there a way to manually add a library? If so, how?
I'm trying to add an import method to my app so users can import a preferably rar file or just a folder to be used in the app.
TL;DR: How can I add the option Android Library to my New Module menu inside Android Library?
EDIT: To clarify things; I've made a web app in which u can create your own click/touch-able interface. The projects u make with that app can be exported to a rar file which is basicly a webpage with html, css and javascript that runs the project. I can run that webpage in my android app just fine but I need other users to be able to import the files somehow. So I was thinking about using a file manager so users can import the files into the app. I'm working with this one a.t.m. https://code.google.com/p/afiledialog/ but it needs to be a library.
Updated my Android Studio today and guess what, it's fixed!
So anyone who has this problem just update asap. Tried this on Mac and Windows and it now works on both.
PS: I'm on version 0.2.6 now (version of august 24). Guess I was one day too early with the question :P
I would like to test my library in an android application, but I would like to avoid compiling and moving around .jar files.
In Xcode for iOs development, it's possible to add your library project in your workspace inside your other project (a test app) and when you run your test app, it builds the library and links everything up correctly.
Can I do this for Android development in Eclipse? How can I do this?
I tried to add a library but it seemed very manual which isn't ideal on time.
The important thing here is that I do have Android references and dependancies, so i can't just unit test the library by itself. I am also creating an SQLite database which I would like to inspect during development.
I guess you are asking about Android Library projects, otherwise you can just test your library using JUnit.
In such case, the post android: testing library projects gives you a step by step guide on how to proceed to test the Android Library project in a stand-alone fashion. Think it can also be tested through the tests belonging to the Android project that uses the library.
You can test your library code using RoboElectric that allows you to test without the need of deploying an android emulator.
Or you can set your library project as an Android library project and put the test in the first project. link
In latest android SDK tools you do not need to add jar in build path, they will be added automatically.
you can put you jar file in libs folder of your project, But it will defiantly be compile before running.
I am new in android framework development .
I try to add a service in platform/base and then I make the whole platform folder follow a post online.
Now i don't know how this change can be applied to android application. Do I need to get a new android.jar package for the application?
Thanks
update --------------------------------------------
currently I have the android source code and modified its framework by adding a testservice.java following this : Android-Adding SystemService
Then I need to write a test app to use this testservice. But I don't how to add an app to that modified android source code. I try to following this:set up the Eclipse IDE for Android platform development to add app src path to eclipse build path , I doesn't work.
before this i use eclipse and ADT to write android apps, i am wondering is there any way to write an app in the modified android source code ?
Thanks
I copied an app under [androidroot]/packages/apps/ folder and rename it and modify some code . Then it shows in application list. It works!
But the problem is the directory structure is strange , very different from the one I create from the eclipse + sdk .
So is there anyone know how to develop apps under a modified android framework.
Thanks !!!
I see a quick and dirty solution: replace the corresponding android.jar in the install SDK location (for example $ANDROID_HOME/platforms/android-8/android.jar if you deriver from Android 2.2).
Also you may try to spoof a separate platform revision in $ANDROID_HOME/platforms. Something like android-99 to avoid clashes with the actual future platforms.
Though all of these are dirty tricks this may work for quick testing of your platform code without much pain.
It is exactly the same as the project you create using eclipse. What's more all you need is to write a makefile in the directory.
Then mmm framework/res framework systemserver
bw
I've already written a game engine in java using eclipse and opengl es, I had one project (an android project) which contained both of my packages
com.logic.engine
com.logic.testapp
I wanted a way to keep my engine and test app seperate, I've made an earlier post about how this is done, and I figured out how to reference one project in the build path of another (or just creating a jar file).
My problem is that, lets say I now have my engine all wrapped up in an android project com.logic.engine, and now someone would like to use this engine to create a game, so they create an android project com.someclient.game, well now because we have one android project referencing another, it crashes everytime.
Now obviously i need the android sdk in my engine package in order to reference things, but its also required on the client app, since the activity is what is actually being run by android.
I guess my question is, how can i create a project for my game engine without it being an android project, but still referencing the android sdk, and without causing it to crash the client app using it?
edit:
note: the client app utilizes the engine flawlessly when its in the same project folder, it isn't until the engine is referenced from another project containing the android sdk that it crashes, so im 99.9% positive it has nothing to do with my code
Your game engine project should be an Android library project. See Working with library projects.
Use an Android library project.
Just a fix for the two links above that no longer work
Android Library Project
Example Library Tut