Performance Issues on Esri Android SDK

3157
3
06-20-2015 04:25 AM
SalihYalcin
New Contributor III

Hello everyone,

We're developing Esri Android SDK and Esri iOS SDK based apps. Using some functionality and using some code blocks. But at the Esri Android SDK based side, app is working slowly. We use same internet connection, same ArcGIS server and same approach to develop mobile app. But android app works like disappointment.

In order to show you this issue we created new project. It contains 1 basemap (ArcGISTiledMapServiceLayer) and 2 button and 1 layer, when we click the button one app is adding layer when we click button 2 app removelayer,  when considering  even this simple app iOS side work faster 2 or 3 times than android.

I'll give simple code blocks.

Android side ;

public class MapMainFragment extends Fragment {

private static MapView mMapView = null;

public ArcGISDynamicMapServiceLayer mDynamicLayer;

Button mButtonAdd, mButtonRemove;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

  Bundle savedInstanceState) {

      final View rootView = inflater.inflate(R.layout.fragment_main_map, container, false);

      mMapView = (MapView) rootView.findViewById(R.id.map);

      mButtonAdd = (Button) rootview.findViewById(R.id.buttonadd);

      mButtonDelete = (Button) rootview.findViewById(R.id.buttonremove;

      mMapView.addLayer(new ArcGISTiledMapServiceLayer(getString(R.string.citymap_url)), 0);

      mDynamicLayer = new ArcGISDynamicMapServiceLayer(getString(R.string.layer_url)); 

      mButtonAdd.setOnClickListener(new View.OnClickListener() {

                 @Override

                        public void onClick(View v) {

                         mMapView.addLayer(mDynamicLayer);

                  });

    mButtonAdd.setOnClickListener(new View.OnClickListener() {

               @Override

                      public void onClick(View v) {

                          mMapView.removeLayer(mDynamicLayer);

              });

}

iOS Side;

MainViewController.h

@property (strong, nonatomic) IBOutlet AGSMapView *mapView;

- (IBAction)btnZoomAdd:(id)sender;

- (IBAction)btnZoomRemove:(id)sender;

MainViewController.m

@interface MainViewController (){

  AGSTiledMapServiceLayer *baseTiledLayer;

  AGSDynamicMapServiceLayer *dynamicLayer}

  baseTiledLayer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:baseurl];  

[self.mapView insertMapLayer:baseTiledLayer withName:@"City Map" atIndex:0]; activeBaseLayer =@"City Map";

dynamicLayer = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL: urldynamic];

- (IBAction)btnZoomIn:(id)sender {

       [self.mapView addMapLayer:dynamicLayer withName:Name];

}

- (IBAction)btnZoomOut:(id)sender {

     [self.mapView removeMapLayerWithName:Name];

}

As you see in code blocks nothing diffrent from each other but Android side works like a turtle, how Can I handle this situation ? How can I run my android app like a cheetah. I need advices. Thanks for all

Dan O'Neill​,

Tero Rönkkö

Will Crick

0 Kudos
3 Replies
DanO_Neill
Occasional Contributor III

Can you send some performance metrics?  Is there a reason you are using Android Fragments in this performance test?  Is there a reason you are not extending the HelloWorld sample with your buttons and dynamic service to optimize your testing?  What are the service layers you are using?  Looking at your current code, you could optimize your event listeners implementation by having one listener for two buttons or using the onClick attribute for each button in your layout xml (assuming you have a typo in the code). 

0 Kudos
SalihYalcin
New Contributor III

Thank you dan I'll give aile real metrics about performance issue. But here week finished. I'll give this information at the monday morning.

Anyway, I want to ask one more question. Simple Esri Android Sdk based android app that no extra code in it size is about 31 MB. Is there a way to reduce apk size ? Eg. Removing unused classes ?

0 Kudos
DanO_Neill
Occasional Contributor III

Ok, look forward to your metrics.  Concerning APK size, unfortunately there isn't much you can do about the size of the APK currently.  We are looking into modularizing the SDK in future releases.

0 Kudos