Use .aar file in Ionic application - ionic-framework

I have a Java package .aar file. I need to use it in Ionic application. I try to create a Cordova plugin and add an aahe file in it.But don't have proper idea about it.
Do anyone suggest how to do it?
Any link?

Related

How to use flutter plugin, that I created, in my flutter app as local plugin

I have created a flutter plugin for android and ios and I want to use that plugin in my flutter app locally. I don't want to upload it to pub.dev but to use it locally in my flutter app. I searched a bit and I found that I can use external packages locally but I didn't find anything about a plugin. These are directories under my plugin package all_pdf_tools:
Out of these which directory do I need to move to my flutter app directory and then how should I declare it to use it in my pubspec.yaml and then how can I use my plugin's methods in the flutter app.
Thank you.
Make sure that your Flutter app and plugin are in sibling folders.
The add a dependency in pubspec.yaml of your Flutter app:
dependencies:
all_pdf_tools:
path: ../all_pdf_tools
This tells your Flutter project to look for your plugin at the relative path, rather than in pub or a local git repo.
(If you look in all_pdf_tools/example/pubspec.yaml you'll see this is how the example app refers to its plugin by using path: ../)

How to add google tag manager in flutter app?

I'm trying to use Google Tag Manager in flutter application. Is there any plugin or package which helps to write GTM code in flutter?
I had the same issue a month ago.
I added the GTM dependencies as I would do with a normal android app.
It doesn't matter if it is a Flutter app, you will have an app/android folder in your project in which you can add graddle dependencies.
This is a screenshot of my app/android folder and the .build.graddle file with the gtm dependency added (and also other google analytics ones).
I recommend to follow this steps for android and this for iOS.
If you want to add Google Tag Manager in flutter web project just navigate to web folder in your project and open index.html file. Then copy any paste the required code snippets from Google Tag Manager web container and paste them accordingly that index.html file. Follow this link to get read the full documentation of adding Google Tag Manger to web project.

Add Ionic 3 Plugin from Github Fork

I want to add a plugin from a github fork of the InAppBrowser. This is the fork I want to use. I know how to add the plugin. I simply use Ionic Cordova plugin add https://github.com/al1lhomme/cordova-plugin-inappbrowser
But how can I import it to the modules.ts? I think it is necessary to add it to npm correct? I think I have to install the npm module to import it in my modules.ts file.
I tried to use cordova.plugins.InAppBrowser but it doesn't work.
Thanks to everyone.
You never add the Plugin to the Module. What you add to the Modules.ts is the native Wrapper from Ionic. You can use Plugins without this Wrapper, but they are developed for an easier use. I don't know if they work with Forks, normally they are developed to work with the original plugin.
So try to just add the Plugin via
ionic cordova plugin add path_to_fork
And use it without the Wrapper, as described in the Plugins Read Me

Eclipse import Phonegap project

I have the HTML/JS/config.xml files of an app that was built using online phonegap build. How can I import these files into a project that I can work on with Eclipse/Phonegap CLI ?
The documentation here is all you need, just follow the steps.
http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface
First you will need to create a new project using your existing HTML/JS/CSS/icons
put your files in a folder, let's say c:\oldproject
create a new cordova project using the CLI and tell it to import your existing files (replace foldername, com.test.app and TestApp with proper values)
cordova create foldername com.test.app TestApp --copy-from=c:\oldproject
Replace phonegap.js reference with cordova.js
In index.html, replace the inclusion of phonegap.js with cordova.js (note that you may choose to use phonegap CLI instead of cordova CLI to create/build the project, in that case, you could continue to use phonegap.js)
Then put back the config and add plugins
replace the generated config.xml in the project with the one of your old project
If your config.xml contains plugins (lines begining with <gap:plugin) you will have to use the CLI to add each plugin.
For example if you have the line
<gap:plugin name="org.apache.cordova.file"
you would have to call
cordova plugin add org.apache.cordova.file
Then you have to add the android platform and build the project.
cordova platform add android
cordova build android
Now your project is ready to be imported in eclipse.
Please note that I don't really see any interest in using eclipse now that you can build projects using CLI. (I personnaly use a text editor that handles javascrit much better than eclipse and then do everything with the CLI).
Final warning
If you edit code in eclipse, you will be editing files in platforms/android/assets/www/, not in /www folder.
If you use the cli commands cordova build android or cordova prepare android, the CLI will take the content of the root www folder and put it in platforms/android/assets/www, so all your changes will be lost.
So if you choose to use eclipse to edit javascript/CSS, you will have to choose either save your changes to the root www folder before you use the CLI or stop using the CLI (so if you want to add a plugin you'd have to use plugman).

are you unable to use plugins in build.phonegap.com since version 3.0?

I was using build.phonegap.com in it's simplest way. That is: no sdk and no phonegap framework installed on my computer; no git or svn repository used. I just upload a zip with my html, css and js files.
But now I need to use the File plugin.
I found several posts (here and elsewhere) taking about using the CLI to add plugins and to build remotely since phonegap 3.0 (which doesn't use the config.xml to add plugins anymore, but instead it uses the CLI).
If you just used to upload a zip file to build.phonegap.com, are you now unable to use plugins since phonegap 3.0??
If that virtue is gone, what is now the simplest way for doing it? I currently use Aptana 3.0. Do I have to install Eclipse and install the phonegap framework? Do I have to create git of svn repository? Is that now the simplest way for using plugins in the cloud-based build service?
Is there a way to use the build.phonegap.com service with phonegap 2.x?? I have not found it yet.
This is taking me out of schedule for the imminent delivery of an ongoing project.
Please advise.
Put the config.xml in the www directory. And then upload only www.zip on build.phone.com.
In phonegap 2.x plugins like File were part of the core, so there was no need to include them through the config.xml file.
In phonegap 3.x every plugin has to be included through the config.xml file. BUT for plugins to work, the root index.html header must have a
<script src="phonegap.js"></script>
phonegap.js is provided (kind of injected) by the build.phonegap.com service, so I don't have to have it on my source code.
The script tag was the only thing I was missing.