0

I have gotten all my Tournaments setup, Callbacks going ect... but I have one problem, and it is a big one: How do I initialize?

Okay, I can init for Android, no biggy, but I am looking to let this application run on both Android & iOS. So... I don't know what to do. Does not look like it is possible, but then again, maybe it is and I am blindly looking over where to do so.

Here is the page that teaches you how to Init for android & iPhone SEPARATELY, not together: https://www.nextpeer.com/how-to-make-a-basic-integration-with-nextpeer/

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Cooper Scott
  • 651
  • 8
  • 18
  • Create a common interface with two implementations, one for Android and another for iOS. Review factory and strategy design patterns. – Luiggi Mendoza Oct 12 '15 at 17:23
  • 1
    Please don't rollback the edit. I removed the non-relevant parts of the post to make the question clear, concise and to the point. Things like if you're new to the technology is irrelevant, stuff like *idk* should be written properly as *I don't know*. And on... – Luiggi Mendoza Oct 12 '15 at 17:25
  • I'd do that... just, I don't know how? All I need to do is run 1 line of code to init for Android, and one line of code to Init for iPhone. Could you walk me through the steps? (Hoping this is an easy process and you can explain to me how to do it... All understood if you don't want to or can't) @LuiggiMendoza and whoops, I didn't mean to roll it back – Cooper Scott Oct 12 '15 at 17:38

1 Answers1

0

Like this in pseudo code;

public interface Resolver {
    void init();
}

Android implements Resolver {

    Android() {
        new AndroidApp(new LibGDX(this));
    }

    init() {
        // Code here
    }
}

IOS implements Resolver {

    IOS() {
        new IOSApp(new LibGDX(this));
    }

    init() {
        // Code here
    }
}

LibGDX {

    LibGDX(Resolver resolver) {

        resolver.init();
    }
}
SolarGrade
  • 48
  • 4
  • This is great and all...but I don't know Psuedo and have no idea how to implement this into my program – Cooper Scott Oct 12 '15 at 18:58
  • Pseudo is not a specific language :D It is rather something like "ok I don't know the Java/C++/whatever but avoiding syntax it will be something like...' – m.antkowicz Oct 12 '15 at 19:36
  • Psuedo just means the logic of any language, it is no language per se. This is how you do it and the only feasible way to do it currently. – SolarGrade Oct 12 '15 at 19:36
  • Thanks for clearing that up! @m.antkowicz & SolarGrade. This is like my 6th month of programming or somewhere around there and still learning. I unfortunately was unable to implement this into my code, although I am sure what you are saying is right, I am just unable to implement this, so I will go ahead and mark as answered. Thanks – Cooper Scott Oct 13 '15 at 05:01