Hi, I'm trying to create an application for iOS and Android that will be developed for different final users. This app is pretty much the same except, for now, for an url where the application get the data and the name and logos. Right now the architecture for the app is this:
AziendaX is the name of one of the final users and AziendaY is the other. For iOS in AziendaXiOS and AziendaYiOS these project will contain the url of the app and the logos, this will reference the library iOSLib that contains the code that was not possible to develop with Forms.
On CompanyAiOS i have this app delegate class:
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = iOSLib.Application.OnFinishedLaunching ("http://10.211.55.5/Testing/CompanyX/");
return true;
}
}
And inside iOSLib.Application I do this:
public class Application
{
private static string _companyUrl;
public static UIWindow OnFinishedLaunching(String companyUrl)
{
_companyUrl = companyUrl;
iOSLib.Application.Init ();
var window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = iOSLib.Application.GetRootViewController ();
window.MakeKeyAndVisible ();
return window;
}
public static void Init()
{
Forms.Init ();
Xamarin.FormsMaps.Init();
}
public static UIViewController GetRootViewController()
{
return App.GetMainPage (_companyUrl).CreateViewController ();
}
}
Now I'd like to do the same for Android, can someone help me with this?
In AndroidLib I have this :
public class Activity : AndroidActivity
{
Bundle _bundle;
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
_bundle = bundle;
}
public void GetMainPage (string url){
Xamarin.Forms.Forms.Init (this, _bundle);
Xamarin.FormsMaps.Init(this, _bundle);
SetPage(App.GetMainPage ("url"));
}
}