---
title: PluginImpl
url: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture/pluginimpl'
markdown: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture/pluginimpl.md'
date: '2026-09-25'
description: 'This class is necessary to register a new plugin. After the plugin is installed, it advertises that is a plugin, registers plugin as a new plugin.'
taxonomy:
  category:
    - docs
  devtype:
    - private
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Operating Systems ](https://www.twelvetone.tv/docs/operating-systems)     [ Vaandroid ](https://www.twelvetone.tv/docs/operating-systems/vaandroid)     [ Vaandroid Developer Guide ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide)     [ Vaandroid Architecture ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture)      PluginImpl    

# PluginImpl

This class is necessary to register a new plugin. After the plugin is installed, it advertises that is a plugin, registers plugin as a new plugin.

#### Table of Contents

- [Superclass](#superclass)
- [Variables](#variables)
    - [PluginImpl](#pluginimpl)
    - [BundleContext](#bundlecontext)
    - [VaandroidOsgiPluginImpl](#vaandroidosgipluginimpl)
- [Methods](#methods)
    - [@Activate activate](#atactivate-activate)
    - [@Deactivate deactivate](#atdeactivate-deactivate)
    - [getInstance()](#getinstance)
    - [getContext()](#getcontext)
    - [@override getLabel](#atoverride-getlabel)
- [See also](#see-also)

# Superclass

VaandroidOsgiPluginImpl

# Variables

## PluginImpl

- static, private, instance

## BundleContext

- public, context

## VaandroidOsgiPluginImpl

- plugin

# Methods

## @Activate activate

- activates this plugin

## @Deactivate deactivate

- deactivates this plugin

## getInstance()

- returns the instance PluginImpl defined in the class
- instance is used to....

## getContext()

- returns the context BundleContext defined in the class.
- Context is used to....

## @override getLabel

- changes the label of the application

# See also

[Creating A Vaandroid Plugin](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-a-vaandroid-plugin)

Code

```
package tv.twelvetone.vaandroid.plugin.project_name;

import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import tv.twelvetone.vaandroid.core.api.runtime.VaandroidOsgiPlugin;
import tv.twelvetone.vaandroid.plugin.osgi.api.VaandroidOsgiPluginImpl;

@Component(service = VaandroidOsgiPlugin.class)
public class PluginImpl extends VaandroidOsgiPluginImpl {
    static private PluginImpl instance;
    public BundleContext context;
    private VaandroidOsgiPluginImpl plugin;

    public PluginImpl() {
        instance = this;
    }

    @Activate
    protected void activate(ComponentContext componentContext) {
        context = componentContext.getBundleContext();
    }

    @Deactivate
    protected void deactivate(ComponentContext componentContext) {
        context = null;
    }

    public static PluginImpl getInstance() {
        return instance;
    }

    public static BundleContext getContext() {
        return instance != null ? instance.context : null;
    }

    @Override
    public String getLabel() {
        return R.getString(R.string.app_name);
    }
}

```

 [ ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture/vaandroid-architecture/view-registry) [](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/rebuilding)

---

## Navigation

- Parent: [Vaandroid Architecture](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture.md)
- Previous: [Vaandroid Architecture](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/vaandroid-architecture/vaandroid-architecture.md)
