How to translate a native android sdk's usage instructions to Nativescript












0














We're having a hard time taking the first step in using a native library in NativeScript.



It's a Map library so I assume it has something to do with registering a new custom UI, but what gets me is the weird xml syntax.



The follow screenshots are from this page : https://developers.arcgis.com/android/latest/guide/develop-your-first-map-app.htm



Native instructions are for Android Studio :



enter image description here



The dependencies (Gradle) :



enter image description here



It also has a weird dependency for Java 8 features :



enter image description here



And lastly, the basic usage, which seems to require lots of platform specific native events :



enter image description hereenter image description here



For now we're only interested in an Android Proof of Concept, but eventually make and release a multi-platform plugin.



I know it's a lot of instructions and things asked for just one question, but here are our main confusions :



1) How to add the custom element to a NativeScript xml? Do we just set up the gradle imports and just add the following element directly? Also i'm assuming the android:id is unnecessary and we can just use id



<com.esri.arcgisruntime.mapping.view.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</com.esri.arcgisruntime.mapping.view.MapView>


2) How to access the above element by its ID via Javascript? More specifically how to get it using VUE? Native Example :



import com.esri.arcgisruntime.mapping.view.MapView;
MapView = findViewById(R.id.mapView);
ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
mMapView.setMap(map);


3) Are there any other steps we need to take into consideration? Specially considering we intend into making this into a full plugin eventually. Or is this more straightforward/simple than I'm making it?










share|improve this question



























    0














    We're having a hard time taking the first step in using a native library in NativeScript.



    It's a Map library so I assume it has something to do with registering a new custom UI, but what gets me is the weird xml syntax.



    The follow screenshots are from this page : https://developers.arcgis.com/android/latest/guide/develop-your-first-map-app.htm



    Native instructions are for Android Studio :



    enter image description here



    The dependencies (Gradle) :



    enter image description here



    It also has a weird dependency for Java 8 features :



    enter image description here



    And lastly, the basic usage, which seems to require lots of platform specific native events :



    enter image description hereenter image description here



    For now we're only interested in an Android Proof of Concept, but eventually make and release a multi-platform plugin.



    I know it's a lot of instructions and things asked for just one question, but here are our main confusions :



    1) How to add the custom element to a NativeScript xml? Do we just set up the gradle imports and just add the following element directly? Also i'm assuming the android:id is unnecessary and we can just use id



    <com.esri.arcgisruntime.mapping.view.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    </com.esri.arcgisruntime.mapping.view.MapView>


    2) How to access the above element by its ID via Javascript? More specifically how to get it using VUE? Native Example :



    import com.esri.arcgisruntime.mapping.view.MapView;
    MapView = findViewById(R.id.mapView);
    ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
    mMapView.setMap(map);


    3) Are there any other steps we need to take into consideration? Specially considering we intend into making this into a full plugin eventually. Or is this more straightforward/simple than I'm making it?










    share|improve this question

























      0












      0








      0







      We're having a hard time taking the first step in using a native library in NativeScript.



      It's a Map library so I assume it has something to do with registering a new custom UI, but what gets me is the weird xml syntax.



      The follow screenshots are from this page : https://developers.arcgis.com/android/latest/guide/develop-your-first-map-app.htm



      Native instructions are for Android Studio :



      enter image description here



      The dependencies (Gradle) :



      enter image description here



      It also has a weird dependency for Java 8 features :



      enter image description here



      And lastly, the basic usage, which seems to require lots of platform specific native events :



      enter image description hereenter image description here



      For now we're only interested in an Android Proof of Concept, but eventually make and release a multi-platform plugin.



      I know it's a lot of instructions and things asked for just one question, but here are our main confusions :



      1) How to add the custom element to a NativeScript xml? Do we just set up the gradle imports and just add the following element directly? Also i'm assuming the android:id is unnecessary and we can just use id



      <com.esri.arcgisruntime.mapping.view.MapView
      android:id="@+id/mapView"
      android:layout_width="match_parent"
      android:layout_height="match_parent" >
      </com.esri.arcgisruntime.mapping.view.MapView>


      2) How to access the above element by its ID via Javascript? More specifically how to get it using VUE? Native Example :



      import com.esri.arcgisruntime.mapping.view.MapView;
      MapView = findViewById(R.id.mapView);
      ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
      mMapView.setMap(map);


      3) Are there any other steps we need to take into consideration? Specially considering we intend into making this into a full plugin eventually. Or is this more straightforward/simple than I'm making it?










      share|improve this question













      We're having a hard time taking the first step in using a native library in NativeScript.



      It's a Map library so I assume it has something to do with registering a new custom UI, but what gets me is the weird xml syntax.



      The follow screenshots are from this page : https://developers.arcgis.com/android/latest/guide/develop-your-first-map-app.htm



      Native instructions are for Android Studio :



      enter image description here



      The dependencies (Gradle) :



      enter image description here



      It also has a weird dependency for Java 8 features :



      enter image description here



      And lastly, the basic usage, which seems to require lots of platform specific native events :



      enter image description hereenter image description here



      For now we're only interested in an Android Proof of Concept, but eventually make and release a multi-platform plugin.



      I know it's a lot of instructions and things asked for just one question, but here are our main confusions :



      1) How to add the custom element to a NativeScript xml? Do we just set up the gradle imports and just add the following element directly? Also i'm assuming the android:id is unnecessary and we can just use id



      <com.esri.arcgisruntime.mapping.view.MapView
      android:id="@+id/mapView"
      android:layout_width="match_parent"
      android:layout_height="match_parent" >
      </com.esri.arcgisruntime.mapping.view.MapView>


      2) How to access the above element by its ID via Javascript? More specifically how to get it using VUE? Native Example :



      import com.esri.arcgisruntime.mapping.view.MapView;
      MapView = findViewById(R.id.mapView);
      ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
      mMapView.setMap(map);


      3) Are there any other steps we need to take into consideration? Specially considering we intend into making this into a full plugin eventually. Or is this more straightforward/simple than I'm making it?







      android nativescript nativescript-vue






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '18 at 12:06









      Mojimi

      285830




      285830
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Ignore the XML example from the SDK docs, that is specific to Android's XML markup.



          You have to create a new class (let's call it MapView), extending the base class View (from tns-core-modules/ui/core/view), in the createNativeView callback return instance of com.esri.arcgisruntime.mapping.view.MapView. That's should be it, now you can register the MapView class and use it in your Vue template.



          Useful docs:




          • Building Plugins

          • Marshalling Java to JS






          share|improve this answer





















          • I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
            – Mojimi
            Nov 19 '18 at 12:31






          • 2




            If you are not planning on creating a Plugin, then use Placeholder.
            – Manoj
            Nov 19 '18 at 12:36










          • do you happen to know how to use Placeholder with Vue?
            – Mojimi
            Nov 19 '18 at 13:36










          • It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
            – Manoj
            Nov 19 '18 at 14:05













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374309%2fhow-to-translate-a-native-android-sdks-usage-instructions-to-nativescript%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Ignore the XML example from the SDK docs, that is specific to Android's XML markup.



          You have to create a new class (let's call it MapView), extending the base class View (from tns-core-modules/ui/core/view), in the createNativeView callback return instance of com.esri.arcgisruntime.mapping.view.MapView. That's should be it, now you can register the MapView class and use it in your Vue template.



          Useful docs:




          • Building Plugins

          • Marshalling Java to JS






          share|improve this answer





















          • I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
            – Mojimi
            Nov 19 '18 at 12:31






          • 2




            If you are not planning on creating a Plugin, then use Placeholder.
            – Manoj
            Nov 19 '18 at 12:36










          • do you happen to know how to use Placeholder with Vue?
            – Mojimi
            Nov 19 '18 at 13:36










          • It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
            – Manoj
            Nov 19 '18 at 14:05


















          2














          Ignore the XML example from the SDK docs, that is specific to Android's XML markup.



          You have to create a new class (let's call it MapView), extending the base class View (from tns-core-modules/ui/core/view), in the createNativeView callback return instance of com.esri.arcgisruntime.mapping.view.MapView. That's should be it, now you can register the MapView class and use it in your Vue template.



          Useful docs:




          • Building Plugins

          • Marshalling Java to JS






          share|improve this answer





















          • I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
            – Mojimi
            Nov 19 '18 at 12:31






          • 2




            If you are not planning on creating a Plugin, then use Placeholder.
            – Manoj
            Nov 19 '18 at 12:36










          • do you happen to know how to use Placeholder with Vue?
            – Mojimi
            Nov 19 '18 at 13:36










          • It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
            – Manoj
            Nov 19 '18 at 14:05
















          2












          2








          2






          Ignore the XML example from the SDK docs, that is specific to Android's XML markup.



          You have to create a new class (let's call it MapView), extending the base class View (from tns-core-modules/ui/core/view), in the createNativeView callback return instance of com.esri.arcgisruntime.mapping.view.MapView. That's should be it, now you can register the MapView class and use it in your Vue template.



          Useful docs:




          • Building Plugins

          • Marshalling Java to JS






          share|improve this answer












          Ignore the XML example from the SDK docs, that is specific to Android's XML markup.



          You have to create a new class (let's call it MapView), extending the base class View (from tns-core-modules/ui/core/view), in the createNativeView callback return instance of com.esri.arcgisruntime.mapping.view.MapView. That's should be it, now you can register the MapView class and use it in your Vue template.



          Useful docs:




          • Building Plugins

          • Marshalling Java to JS







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 '18 at 12:29









          Manoj

          4,2911920




          4,2911920












          • I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
            – Mojimi
            Nov 19 '18 at 12:31






          • 2




            If you are not planning on creating a Plugin, then use Placeholder.
            – Manoj
            Nov 19 '18 at 12:36










          • do you happen to know how to use Placeholder with Vue?
            – Mojimi
            Nov 19 '18 at 13:36










          • It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
            – Manoj
            Nov 19 '18 at 14:05




















          • I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
            – Mojimi
            Nov 19 '18 at 12:31






          • 2




            If you are not planning on creating a Plugin, then use Placeholder.
            – Manoj
            Nov 19 '18 at 12:36










          • do you happen to know how to use Placeholder with Vue?
            – Mojimi
            Nov 19 '18 at 13:36










          • It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
            – Manoj
            Nov 19 '18 at 14:05


















          I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
          – Mojimi
          Nov 19 '18 at 12:31




          I understand that's the instructions for creating a custom UI plugin, but how to use it without creating a plugin initially? Could you post an example?
          – Mojimi
          Nov 19 '18 at 12:31




          2




          2




          If you are not planning on creating a Plugin, then use Placeholder.
          – Manoj
          Nov 19 '18 at 12:36




          If you are not planning on creating a Plugin, then use Placeholder.
          – Manoj
          Nov 19 '18 at 12:36












          do you happen to know how to use Placeholder with Vue?
          – Mojimi
          Nov 19 '18 at 13:36




          do you happen to know how to use Placeholder with Vue?
          – Mojimi
          Nov 19 '18 at 13:36












          It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
          – Manoj
          Nov 19 '18 at 14:05






          It should be just the same except the syntax will be how you would call an event in Vue. Here is working sample.
          – Manoj
          Nov 19 '18 at 14:05




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374309%2fhow-to-translate-a-native-android-sdks-usage-instructions-to-nativescript%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

          Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

          A Topological Invariant for $pi_3(U(n))$