I'm working on a Xamarin.Forms app in C# for iOS and Android. I also have the source code for another app that's written for Android devices in Java. This other app is a fully developed app on its own and has its own pages and UI designed already. Would it be possible to run this app within my project, at least just for Android?
For example, let's say I have a button in my app that, when clicked, leads to a new page within the app that starts running the Java app. From there, it's as if users are simply using the Java app, only that there's a back button on the top of the page that leads the users back to the main page of the Xamarin.Android app.
I've looked into Binding a Java Library but it seems like that's primarily for Java libraries rather than full-on applications.
From what I could tell you can look into creating a AAR file of the existing Java code:
https://developer.android.com/studio/projects/android-library
Then add the new AAR (with the Java code & resources) to your existing Xamarin project:
https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/binding-an-aar
Using Intents on both sides:
https://developer.android.com/guide/components/intents-filters
https://developer.xamarin.com/api/type/Android.Content.Intent/
I would start with a simple Proof of Concept:
write a simple Xamarian app with a button to launch the Java Android
Activity via intent
write a Android app with a button to launch the Xamarian activity via an intent (the back stack for the integrated app may be tricky).
Build an AAR out of the Java Android side.
Integrate the AAR into the Xamerian app.
Related
Could I create an Android app with the ability to control another android applications? For example to press and click on things in another android app while my hypothetical application would be running?
Straight to the point, Im trying to run a small program of unity within an android application created on android studio.
The android application has its own functionality. Eg. after opening the maps API(in android studio), I want to click on a location and then want a small program of unity scene(augmented reality) to start. I want help and I don't have any idea how to do this.
This is the unity application that I want to integrate within my android App. I want to make a unity plugin that can run within an android application instead of creating the entire application in unity.
https://www.youtube.com/watch?v=gNwduUQrlJs&t=6s
I'm afraid you can't do that. What you can do is to create another unity application which will have just the functionalities you want after clicking map location. If you install such app on your Android device, you can then trigger opening this unity app from your Android app by using custom uri schemes. But there is no way to create Unity 'plugin' to launch within android application.
I have a android application written in java and I am a android programmer. I have few swf files that needs to be displayed in android app. With earlier versions I was able to display using webview but with post kitkat this is not possible as per multiple search across google.
If we use flash to publish Air APK project it runs the swf perfectly. Can we extract the same code to display our swf in java program as I cannot move away from java programming as there are other features around the program.
Please help as Adobe themself are successfully displaying .swf on kitkat.
I am new to android and java development although I am an expert with IPTV and I have made the biggest Greek and Cyprus IPTV but since there is a lack of Greek IPTV android apps I decided to make one application.I found IPTVCore on playstore which is made by the developer of the IPTV app.In the description it has a link on an app that uses iptv core github
I downloaded the zip changed the icons and renamed the files. In MainActivity.java I removed the first comments and added my playlist url and changed package name.
I have android studio and eclipse with android addons.
How to make it an apk?
If you mean to simply be able to load it onto a devices to test then both Eclipse and Studio will allow you do this when you elect 'Run' and have a device attached via the USB (with USB debugging enabled). This will actually install the apk on your device so you can test it.
If you mean actually making the apk available for others (via the play store for example) then you should look and the Android publishing documentation:
http://developer.android.com/tools/publishing/publishing_overview.html
In very broad terms, you develop the app, build it, test it etc and then when it is ready for release you build it for release (remove all debug code, test data etc), sign the app, and release it via a marketplace like Play Store, or avi email or your own web site.
One important thing to remember is to version the app properly - the is important for all the obvious reasons (users or support wanting to know the version) but also because the marketplace update mechanisms may use it to check what versions can be updated etc.
Update - answering the question in the comment below:
There are two approaches suggested in the Readme file with the project:
To build you custom IPTV app you can do one of the following:
Clone iptv.example project, change app name, launcher icon, and
package name.
Blockquote
Create new Android project with empty activity and use
the code from MainActivity.java
The second one might actually be simpler for you if you know how to create a simple Android project - just do that and then replace the MainActivity code in the newly created project with the code in the MainActivity file (the only java source file) in the githib project you have downloaded.
I am working on a Unity Project that will be exported to ios and android.
I have a native objectiveC and Android Java code that consists of 2 views (basically a login flow). Both have same logic. What I need to do is the following:
When the app runs, it will run the Native views and code (objectiveC or Java depending on the platform).
Then the user will go through the flow, and once it is completed, I will need to report back to the unity code, and open a scene from it.
Any indications on how can that be achieved, without having to add them after generation of each code?
Because otherwise I would have to put my native code in, every time I generate a new project.
I did some research and came across the "extern" capability, but can it be used to open views from storyboards or android xml files? and trigger logics?
Thank you