Dear All,
I'm developing an Android Application using ArcGIS Runtime SDK for Android app but I'm getting
confused about which layer type should be used. One of my colleagues suggested me I should
use a webmap in developing an Android Application. Does it always have to be a webmap or
can I simply use a feature layer? I would appreciate if you could kindly share your experiences
and suggestions or a resource on this issue. Please note that all layers are hosted in our
ArcGIS Online organizational account.
My second question is that, how I can filter layers in android app. Typically, there are a number of
layers in a webmap and what I would like to do is filter the layers so that only selected layers are
displayed. So far, the only workaround I find is to go back and select another webmap
which makes the application not easy to use. Thank you for your help in advance.
Have a great weekend...
Solved! Go to Solution.
Hi Omur,
I think I am confused as to what you are looking to do based upon the questions asked.
Are you looking to find layers from your ArcGIS Online account in Android or are you looking to create layer objects with information from your ArcGIS Online account?
If you are looking to get information from your ArcGIS Online account, you should create a Portal object and then query that Portal object for feature layers within it:
Portal | ArcGIS Android 10.2.7 API
Here is a sample for connecting to Portal and querying it:
You do not need to use a webmap when developing an application. You can load individual layers at once into a map object.
This documentation should help you on which layer type to use:
Layer types—ArcGIS Runtime SDK for Android | ArcGIS for Developers
And this documentation should help you with loading the data:
Attribute Editor | ArcGIS for Developers (Look under the onCreate method.)
featureLayer = new ArcGISFeatureLayer( "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/FeatureServer/0", MODE.SELECTION);
As for part 2 of this question, you may want to provide a section with check boxes that let you toggle the visibility on or off for each layer.
This documentation should help you figure out this portion:
Hello Alexander,
Sorry for not writing to you earlier. I really appreciate your detailed solution suggestions. I will check each link and get back to you. Thank you for your great help.
Best Regards.
Hello Alexander,
I'm sorry for not writing to you earlier. As you might remember I'm trying to develop a native android application using ArcGIS Runtime SDK for Android as I mentioned before. I checked all the links you suggested in detail but since I don't have deep knowledge on Java I'm still trying to understand that how can I add individual layers into a map object. A undergrad student in computer science program in our university help me to develop the application but he also couldn't figure out how to do that
If you don't mind my asking, could you please kindly let me know more detailed information or perhaps a sample code regarding getting feature layers from our AGOL organizational Account ? At this moment, the application gets webmaps from AGOL account.
The URL of our AGOL account is https://iyte.maps.arcgis.com . I can create an account for you if you want to look at the file I've created. Additionally, I could also share the source code if you'd like to. Thank you
Best Regards
- Omur Saygin, PHd.
Hi Omur,
I think I am confused as to what you are looking to do based upon the questions asked.
Are you looking to find layers from your ArcGIS Online account in Android or are you looking to create layer objects with information from your ArcGIS Online account?
If you are looking to get information from your ArcGIS Online account, you should create a Portal object and then query that Portal object for feature layers within it:
Portal | ArcGIS Android 10.2.7 API
Here is a sample for connecting to Portal and querying it:
Hi Alexander,
Thank you for your prompt reply. I'm afraid I wasn't clear enough in my previous
message.
Based on your question, I'm looking to get information from our AGOL organizational
account in Android. Under these circumstances, I should create a Portal object as you
mentioned and this is only solution.
Thank you so much for your patience and help.
Best Regards
- O.S.
Hi Omur,
Glad to have helped!
Best of luck with your application!
Thanks,
Alexander
Hello,
Yes, you've been extremely helpful.
May I ask you an additional question if you don't mind ?
Our university has ESRI Educational Unlimited Site License Program Level 2 and
it includes ArcGIS for Server Advanced Enterprise. So, my understanding is that I can
install and setup ArcGIS for Server if I'm not mistaken.
On the other hand, I reviewed features of AppStudio for ArcGIS and it seems
a more convenient environment compared to ArcGIS Runtime SDK for Android since
the AppStudio has productivity tools for different platforms. Would you recommend
it to build an application for different platforms (i.e. Android, IOS..) ?
Best Regards
- Omur Saygin.
Hi Omur,
As far as installing ArcGIS Server, I am not sure in that. You may want to reach out to someone in customer service.
As far as AppStudio is concerned, it is a great tool to build multi platform native applications in. However, it really depends on what you are comfortable with and what kind of audiences you want to target. It really comes down to if you would rather write your app in Java or QML.
I hope this helps!
Hi,
Regarding installing ArcGIS Server I called ESRI Turkey customer service and
they confirmed that ArcGIS for Server is the correct product.
I completely agree with you that AppStudio is really great tool to develop native
mobile applications. The choice might be subjective when it comes to being
comfortable.Personally, I find AppStudio tool user-friendly since it is relatively
easy to built an application for different platforms. Thank you for your great
support.
Regards