It am sub-dividing an app I have into "platform" and "app" layers so that I can distribute the platform as a jar for use by partners - while protecting my IP.
I now have two Eclipse projects. Building has no ability to compile any resources into a jar, so I moved all resource references into the app project (the platform project gen/ directory is empty). I compiled the platform and then manually used the jdk to to jar it, imported that jar into the app project, marked the jar for export in the app project, and successfully compiled and installed a test app:
public class NotifyService extends Service {
...
@Override
public void onStart(Intent intent, int startId) {
myNotify(intent.getIntExtra(EXTRA_ICON),...));
}
private void myNotify(int iconResource, String s1, String s2, String s3) {
Context c = getApplicationContext();
if (H.VERBOSE) Log.d(TAG, "myNotify()"); //$NON-NLS-1$
Notification n = new Notification(iconResource, s1, currentTime);
Intent nextStep = new Intent(Intent.ACTION_VIEW,Uri));
PendingIntent pending = PendingIntent.getActivity(c, 0, nextStep, 0);
n.setLatestEventInfo(c, s2, s3, pending);
mgr.notify(1, n);
}...
The test activity launches as expected and I get the LogCat() message from this service. But no notification is shown and no error is logged - its just silent. ...
Anyway, I want partner apps to make use of my platform which connects to services, content providers, the web, the works. Anyone offer some guidance?
UPDATE!
Hah... typical... when I moved all the resources out of my platform and into my app I did not properly pass these down from the app layer. Thus, the code example I gave had no error. Using an intent rather than linking decouples "arguments passed" from "arguments expected" of course - and the compiler does not complain. With a corrected app, this works.
Though I'd think creating a binary distribution platform is not uncommon, I'm not finding much doc on it so I'll keep adding any significant findings as I open the doors ... hope it's of use to someone.