I'm writing an app that needs to load dinamically plugins from external libraries.
My first idea was -with very little immagination- to use Java's ServiceLoader and googling a little bit I found documentation that states that this kind of action is supported by Android: http://developer.android.com/reference/java/util/ServiceLoader.html
However I really don't understand where to place my META-INF folder (I'm used to Maven, but I can't use it in this occasion).
Could someone tell me where to place the META-INF folder and what to do to have it working in the usual way?
Stefano
Related
I'm working on a project that requires to add some features to an existing java application using Netbeans. After searching the net, i founded that I should use "plugins". I didn't hear of plugins before.
I have a java application that I should download it from the net, then lets say I have to add a button, when clicked, calls a function that is written in some class in the application. In other words I want to make a new class that is able to access the classes and functions that are written in this application.
What I understood from searching the net is that:
-In the downloaded project's folder there is a folder named plugins.
-This folder contains zip files that contains classes and other stuff.
-I should make a plugin and add it to this folder in order to add a specific feature to the application.
That's what I know, if there is something wrong in what I said, I'll be thankful to correct to me.
Now, my question is that I want a link or website that can teach me how to create and add a plugin to an existing java application. Thank you :)
That entirely depends on the java application you're talking about. Not every application has a Plugins functionality. And not every Java Application uses the same Plugin API. The best bet is to go to the site of the App you're talking about and see if they offer a documentation about their Plugin API.
This is a bit of a basic question/s and pertains to project structure. It's just a basic concept I have missed in android. (as a result of being self taught).
With an app that has many classes, activities and fragments, it's becoming busy in both the java and res folders.
I am unsure what is the best way to proceed with managing larger projects.
For instance, if I have a various sections, bluetooth, wifi, gps, etc. And for many of these they are reusable code "packages" or "modules" (I am not sure of the correct word).
How should I go about formatting my project?
Using packages?
Is there a dll concept equivalent?
There is this question here:
Is there any DLL or DLL like concept in Android?, but it doesn't really help clarify this issue for me.
Any feedback is appreciated.
How should I go about formatting my project?
It depends on your needs. If you want to move some part of logic to a library, you can do that by creating an android library project. See Library Module section: https://developer.android.com/tools/projects/index.html
Is there a dll concept equivalent?
If you want to have a compiled version of that library project (like DLL) you can generate a .jar file. Refer this link: How to create jar for Android Library Project
So, you can link android library project directly, or, compile it first, and then include as a .jar file.
I need to run code samples that are on this page:
https://cloud.google.com/appengine/docs/java/datastore/queries
I've been able to locate jars for all but the following:
com.google.appengine.api.datastore.Query.Filter;
com.google.appengine.api.datastore.Query.CompositeFilter;
com.google.appengine.api.datastore.Query.CompositeFilterOperator;
Can anyone point me to where they are located?
I'm also a bit concerned that because I'm getting jar files individually
that I might run into some compatibility issues. Is there one
location that has jars for all the samples on the page I mentioned above?
Thx,
Steve
You need to download the GAE SDK and include it on you project. All those classes are included in there.
GAE is a pretty complex PAAS product. You'll need to setup the whole platform in order to use it, you cant just use some bits of it on its own.
I am a newbie to Android development so apologies if i am missing something obvious here. I am using Eclipse to put together a simple Android program that will consume a couple of Rest web services. I am attempting to use the Resting API to accomplish this.
I have copied the Resting JAR file into the libs folder of my project and its in the build path however I can't reference any of the Resting classes, i attempt to include the appropriate imports but they fail to resolve.
Has anyone got a complete sample of using Resting to consume a restful web service? Should I look to use a different library perhaps? Simplicity is key for me so the lighter the library the better.
Thanks hugely for any advice you may have
I think the resting jar file may be an archive file which in turn contains all the jar files required to use resting. You need to open the archive using a tool like winrar, extract all the jars inside, put them in the lib folder of your project and reference.
Resting seems fairly simple and lightweight. Mostly, one step.
I haven't used Resting API but I have used Jersey and it is easy to use. Give it a try. As per the referencing things, things should resolve once you add the dependencies. You might need to read a bit how Eclipse handles that.
Resting sample code:
List products = new RestingBuilder("http://myapis.com/productservice",Product.class)
.setPort(8080)
.setVerb(Verb.GET)
.setTransformationType(TransformationType.JSON)
.setConnectionTimeout(3000)
.build();
I am writing some applications that require to have a Help Contents system tied to it. I came across JavaHelp which seems perfect for what I need.
The issue I am having is that when you download JavaHelp, it comes with its own bin folder which looks like you are suppose to use separately. However, I am pretty sure if I just copy some of the JAR files I should be able to just place them in the hierarchy in my Eclipse and use it in the project.
What JAR(s) would I need to copy so I can use JavaHelp in my application?
Update
I got JavaHelp working rather easily. I had issues with the built in Eclipse Help though. But I appreciate both of your answers!
If anyone is interested in knowing how to add JavaHelp to your project (doesn't have to be Eclipse specific), I will be more than happy to provide the answer here.
The JavaHelp README details the redistributable jar files that are supplied in the download. Select the jar that suits your needs and add it to your Eclipse project.
While JavaHelp is a good api, Eclipse has its own api for help, and (IMO) it's a much better option for SWT based applications. See this developerworks article on developing help using the Eclipse help system.
If you're actually creating a swing application, and want to package java help with it, you'll need to create the help documents (help topics, helpset file, map file, TOC, index, full-text search db) and then package those files into a jar for distribution with your application. See the JavaHelp Users Guide for details.
For running the help viewer from the Eclipse IDE (and from your application at runtime), all you need is the jar file jhall.jar from the JavaHelp distribution.