To quote the Eclipse Concierge project page, "Concierge is a small-footprint implementation of the OSGi Core
Specifications R3 standard optimized for mobile and embedded devices". It was initially developed by Jan S Rellermeyer. Given below is a basic guide for running concierge.
1. Get the latest concierge source from http://git.eclipse.org/c/concierge/org.eclipse.concierge.git
2. Run the ant program inside the concierge root directory to build the concierge framework bundle.
3. By default concierge runs with no shell, to run concierge with a shell you will need the shell bundle which can be downloaded along with the previous release version of concierge available here: http://sourceforge.net/projects/concierge/files/.
4. To instruct concierge to launch with a shell you will need a startup properties file. Follow the instructions here : http://concierge.sourceforge.net/properties.html.
5. Now you can run the concierge bundle you built in (2) and use the launched framework to install and run other OSGi bundles.
Here is a list of shell commands for Concierge taken from http://sourceforge.net/p/concierge/code/HEAD/tree/trunk/bundles/shell/src/main/java/ch/ethz/iks/concierge/shell/Shell.java#l495
bundles
services
properties
filter
install
start
stop
uninstall
update
headers
restart
quit
exit
printenv
Wednesday, May 14, 2014
Learning OSGi
It's the 10th anniversary of GSoC and as a part-time masters student I have been selected to participate in the 'Kura' project for eclipse. The project I am working on is an OSGi based project that provides a framework for running M2M applications. This will be my first time working in depth with OSGi so I have a lot of reading to do! Given below are the resources I am using:)
Friday, March 21, 2014
Debugging exported eclipse plugins
When working in eclipse plugin development one thing you come across often is the plugin runs as expected when debugging from the Plugin Project, but when you install the exported plugin things just don't work. Reasons for this could be anything as simple as not specifying external jar files in the 'Runtime' tab of the plugin.xml file to something as unexpected as a runtime exception. The easiest way to debug such issues is to launch eclipse with the console running.
Command to launch eclipse with console:
eclipse -debug builder.options
Now all plugin log messages and exception messages will be displayed in the console.
For more details on debugging eclipse plugins for the end user please see:
http://www.ibm.com/developerworks/rational/library/06/0221_rossner/
Command to launch eclipse with console:
eclipse -debug builder.options
Now all plugin log messages and exception messages will be displayed in the console.
For more details on debugging eclipse plugins for the end user please see:
http://www.ibm.com/developerworks/rational/library/06/0221_rossner/
Cordova plugin to display image files full screen inside your iOS/Android app
A while ago I blogged about a customized HTML5 canvas/js implementation for full screen image display inside your cordova app. The advantage of this method was that it retained the application header and footer, however the drawback was that pinch zoom did not work well under device orientation changes. For anyone who doesn't want to deal with the complexities of a canvas based pinch zoom capable js solution a much simpler solution is to utilize iOS and Android native capabilities to launch the image in the default image viewer, from inside your application.
iOS
Inside a cordova plugin for ios implement the following call UIDocumentInteractionController.
NSString *fullPath = @"specify file path here";
NSURL *URL = [NSURL fileURLWithPath:fullPath];
if (URL) {
UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
[documentInteractionController setDelegate:[[[UIApplication sharedApplication] keyWindow] rootViewController]];
if (![documentInteractionController presentPreviewAnimated:YES])
NSLog(@"Failed to open document in Document Directory");
}
Also let your cordova applications main view controller implement the UIDocumentInteractionControllerDelegate.
Android
Inside a cordova plugin for android implement the following call to an intent
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.parse(filePath), "image/*");
context.startActivity(intent);
You will need to implement threading to prevent the UI thread from hanging.
For details on setting up a Cordova plugin inside iOS/Android refer to http://devgirl.org/2013/07/17/tutorial-how-to-write-a-phonegap-plugin-for-android/
iOS
Inside a cordova plugin for ios implement the following call UIDocumentInteractionController.
NSString *fullPath = @"specify file path here";
NSURL *URL = [NSURL fileURLWithPath:fullPath];
if (URL) {
UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
[documentInteractionController setDelegate:[[[UIApplication sharedApplication] keyWindow] rootViewController]];
if (![documentInteractionController presentPreviewAnimated:YES])
NSLog(@"Failed to open document in Document Directory");
}
Also let your cordova applications main view controller implement the UIDocumentInteractionControllerDelegate.
Android
Inside a cordova plugin for android implement the following call to an intent
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.parse(filePath), "image/*");
context.startActivity(intent);
You will need to implement threading to prevent the UI thread from hanging.
For details on setting up a Cordova plugin inside iOS/Android refer to http://devgirl.org/2013/07/17/tutorial-how-to-write-a-phonegap-plugin-for-android/
Subscribe to:
Posts (Atom)
