androidionic-frameworkionic-webview

Can I call native android activity from Ionic WebView?


I need to build a Ionic Webview from where I need to call some native android activity. Is this possible?

I have developed set of pages in android native activity. Now I want to create a homepage in ionic webview from where i need to call my android native activities that i have written previously. Is this possible?

Background Information: I have developed an android app. I want to slowly migrate to Ionic framework. Thus I wanted to convert few parts of the app like some of the native android activity to ionic webview.


Solution

  • you might want to look at capacitor https://capacitor.ionicframework.com/. You can use plugins to easily call your native activities. Essentially the steps are as follows:

    1. You create a class that extends the capacitor Plugin class
    2. You then use Intent to call your native activity
    3. You then register the Plugin with Capacitor

    The details can be found here https://capacitor.ionicframework.com/docs/plugins/android.