Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:01:52+00:00 2026-06-12T23:01:52+00:00

We are successfully runnning Apache Felix 4.0.3 on Android (2.1) and can deploy/remove Bundles

  • 0

We are successfully runnning Apache Felix 4.0.3 on Android (2.1) and can deploy/remove Bundles at runtime. For dependeny management between OSGI Bundles we use the Felix DependenyManager.

Now we want to to send data from running OSGI Bundles to the Android GUI and display it.

How can we accomplish this task ? Is there some kind of callback we could use ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:01:53+00:00Added an answer on June 12, 2026 at 11:01 pm

    Assuming that by ‘send data’, you mean interacting with the services that bundles provide, there is nothing special about this: just make sure you keep hold of the BundleContext instance that your Felix instance gives you, and use it to request services. The way you bind your data, is then totally up to you, just as it is in any other Java project.

    Just showing data

    As a rather contrived example, you can do something like

    Map<String, Object> config = new HashMap<String, Object>();
    /// make settings here, including providing the bundles to start
    Felix felix = new Felix(config);
    
        felix.start();
    
    BundleContext context = felix.getBundleContext();
    
    // now get some service! Remember to do nullchecks.
    ServiceReference<PackageAdmin> ref = context.getServiceReference(PackageAdmin.class);
    PackageAdmin admin = context.getService(ref);
    ExportedPackage[] exportedPackages = admin.getExportedPackages(felix);
    
    // use the result to update your UI
    TextView field = (TextView) findViewById(R.id.textfield);
    field.setText(exportedPackages[0].getName());
    

    to set up the framework, get some service, and put update the UI with some data.

    Binding

    There is no default callback you can use, but one trick I particularly like is to make UI elements aware of their OSGi environment; in that way, you can make them ‘listen’ to changes in your framework. Below is a simplified view of what I use, I prefer delegating the complicated stuff to the Apache Felix Dependency Manager.

    For instance, say you have some listener interface.

    public interface ClockListener {
        public void timeChanged(String newTime);
    }
    

    and you have some service that regularly calls all services that implement this interface with the current time. You can now create a TextField that updates itself every time this method is called. Something like,

    public class ClockTextField extends TextView implements ClockListener {
        public ClockTextField(Context context) {
            super(context);
        }
    
        public void timeChanged(String newTime) {
            setText(newTime);
        }
    
        public void register(BundleContext bundleContext) {
            // remember to hold on to the service registration, so you can pull the service later.
            // Better yet, think about using a dependency management tool.
            bundleContext.registerService(ClockListener.class, this, null);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am successfully running Parallel FPGroth Algorithm of Apache mahout on top of hadoop.
I have the following script running successfully. However if I try to use a
My map task completes successfully and I can see the application logs, but reducer
I've installed WAMP successfully and it works as expected until I've tried to use
How can I set where Perl looks for modules in Apache httpd.conf file on
I have been running Apache and PHP successfully for a while and would now
I am successfully running Bluetooth-SPP applications relying on http://bluecove.org/ That is Java to Java.
I have developed a view based project in Xcode. It is successfully running in
I am having trouble deploying express app on nodester. After successfully running the default
I am using Struts application while running welcome page is run successfully after that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.