|
POST
|
Hi Patrick, The Android API jars have already been optimised with Proguard during production, so we do not recommend any further optimisation. Esri uses Proguard for obfuscation purposes but we have deliberately not applied optimisation to this process, due to the concern that this can lead to bugs that are hard to solve. More information can be found here: http://tools.android.com/recent/proguardimprovements "Dalvik performs many of its own optimizations, and some of the optimizations performed by ProGuard are incompatible with Dalvik, so to avoid hard-to-figure-out bugs (and because the net performance gain is usually small), the default configuration turns off optimization." Hope this info is somewhat useful, perhaps you can post back with more info on the size limits you are trying to hit? Regards Shelly
... View more
04-01-2014
12:38 AM
|
0
|
0
|
1083
|
|
POST
|
Hi Mike, I appreciate it can be really frustrating trying to understand a new system, hopefully we can help out with this simple request though. Many years ago, his organization created a bike route map for his region. He has exported it, send it to me and said, "Put this on the Android app I'm having you develop." His export resulted in the following files: .dbf, .shp, .prj, .spn, .spx, .xml, and .shx files. What you have there is a shapefile - historically a rather old Esri format for geogaphic data - the 'shapefile' means basically at the very least the .shp, .shx and the .dbf files together (the other files are used by some bits of the system and not by others, but generally it does no harm at all to keep them all together when sharing them around - in particular the .prj is important to define the coordinate system of the shapefile, but you shouldn't need to explicitly be concerned with that). Its still in frequent use in many systems, and did become somewhat of a de-facto standard, but it's an old format and has certain limitations. In any case, a shapefile can contain a single 'layer' of data from a map. The Android SDK does not support loading and displaying shapefiles, so that's one obvious problem you have right there. Although we may add support for different data formats as we release new versions of the SDK, typically the SDK has been focused around displaying services - you can find out more about the sorts of things that are supported now here:https://developers.arcgis.com/android/guide/map-layer-types.htm#ESRI_SECTION1_56C39AB97812490786CC069DB09818EB Many years ago, his organization created a bike route map for his region. So here, your 'map' can refer to many different things. Esri's platform includes ArcGIS Online - this is the cloud part f the system, and stores maps as 'webmaps' - they only contain data from services, not local files. However, one useful thing is you can upload shapefiles to ArcGIS Online and then add them to a map. If your shapefile is not too big (not more than 1000 features) then using a completely free public account for ArcGIS Online, you could upload the shapefile - this will convert the features in the shapefile into features that get stored in the map online (it's stored as JSON). Then you can easily load this map using the WebMap class in the Android SDK, from where it resides online. A limitation would be that free accounts can only share data publicly - e.g. anyone could look at this data if they searched for it, although they would not be able to change anything, but they could save their own separate copy of it. Alternatives exist for paid subscriptions to ArcGIS, but that's probably getting a bit over complicated at this point for you. Also, all this assumes your device will be showing online data - it's not on the device itself. If the user however has a paid subscription for ArcGIS (which many esri users do have - if he pays maintenance for ArcGIS Desktop, then he should have as part of the desktop maintenance), then it's worth investigating what the paid subscriptions offer, possibly starting here: http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm). I just imported a shapefile and shared it in this map that I shared publicly: http://www.arcgis.com/home/webmap/viewer.html?webmap=c40369868c22454ebac5c2f241d50704 - you should be able to use this to test out what I described. Look at this sample for how to load a webmap - it actually includes a lot more code than you need but you can see the code that uses a webmap URL to create a MapView - https://developers.arcgis.com/android/sample-code/webmap-popup-viewing. Then if this works for you, you can make your own Esri account yourself, or have your user save the data to their own account. Other ways to work around the lack of shapefile support exist, especially if you have some flexibility with how your data can be exported, but using a webmap might be the easiest place to start. Hope this info helps some, do post back if you have other questions about it.
... View more
03-26-2014
05:21 AM
|
0
|
0
|
767
|
|
POST
|
sometimes, the callout is hidden while the map zooms and pans to the selected point and once the animation has stopped, the callout appears at the intended point.This is the expected behaviour. But occasionally the callout shows on the map as the animation starts and moves along the map as the map pans to the point. I have a little more information on the callout issue you mention. So as you note, the expected behaviour with the 10.2.2 release, when the map is animating, is that the callout is temporarily hidden, and when the animation completes, the callout will be drawn again, and should have automatically updated to the correct location. Which means the best way to arrange your methods is like your second code snippet, with the call to show the callout first, and then the call to zoom. It sounds like this expected behaviour is what you are seeing most of the time. However, the occasional problem of the callout showing on the map during animation sounds like a bug, but I've not been able to reproduce when using zoomToScale - can you figure out any particular situations where this happens, to help us repro and investigate this? Do you see this on all devices, or only certain ones, or only with certain types of animation/zoom?
... View more
03-18-2014
05:19 AM
|
0
|
0
|
1616
|
|
POST
|
Hi Mike, I have not seen this issue specifically, but I can suggest a few things I would try. Make sure you're setting map extent or zooming in and out to the levels that you actually exported to the TPK. Also check you you did load the layer correctly - check the layer got initialized for example using MapView.getOnStatusChangedListener. Try loading an existing TPK file into your map with the same code - e.g. http://www.arcgis.com/home/item.html?id=4497b7bb42e543b691027840d1b9092a. Or try making an ArcGIS Compact Cache output instead of a TPK to see if that makes any difference. If yo have no luck I would post your generated TPK here so we could try loading it and see if we have same problems. Regards
... View more
03-18-2014
02:07 AM
|
0
|
0
|
1267
|
|
POST
|
map.setExtent(someFixedExtent);
map.setRotationAngle(0); Use case: To reset the extent and rotationangle. If these statements are called together and the map rotation angle was greater than 0, the map does not set the correct extent. If you call setRotationAngle and then call setExtent, with no animation at all, you will get a different eventual map extent compared to that which you get if you call setExtent and then call setRotationAngle, which makes sense, as a rotated envelope would result in a different extent for the map. Perhaps the extent you want to set would be better represented if you change the order of the calls, as below, and make sure the first call is not animated, so that the map is immediately set to 0 degrees rotation, and then the extent is set based on that 0 rotation: map.setRotationAngle(0, false);
map.setExtent(someFixedExtent); If you want to have both animating, and the calls to happen in turn, then your workaround makes sense to me. I dont have any specific comments on the callout issue, but will udpate this thread if I find anything useful out. I think we can improve the documentation of these methods that may have animation, so I will add an issue to better document this for the next release. UPDATE - a colleague just reminded me that it's not just the setRotationAngle method that you can turn animation off, there is also an animate parameter in setExtent too, so you can turn off the animation for that specific method as well.
... View more
03-17-2014
06:31 AM
|
0
|
0
|
1616
|
|
POST
|
Hi Dan, You should be able to use the setRotation method on the MapView to set the rotation angle of the map. https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/MapView.html#setRotationAngle(double) You can see an example of this in the Map Rotation sample - this sample sets a listener so that a single tap on the map will re-set the rotation angle of the map back to 0. There are overloads of this method available with alternative parameters.
... View more
02-03-2014
01:35 AM
|
0
|
0
|
1416
|
|
POST
|
Hi Raz - all questions are welcome, experts or beginners! The simple answer is you need to change your latitude,longitude coordinates to the same system that is used in the map, then your point should show up where you expect it to be. Try changing the line that adds the graphic to this, where the points are projected, and then used in the graphic: Point pt = GeometryEngine.project(locx, locy, mMapView.getSpatialReference());
Graphic g = new Graphic(pt, symbol); Some more background on this - when you create a map, the spatial reference is automatically set, and matches the spatial reference of the first layer that you added. A spatial reference defines what system of coordinates are used for that map - there are thousands of systems, but typically most people only have to think about one or two. In the Hello World sample, the MapView has the 'Topo' basemap set in the layout, main.xml. All of Esri's basemaps use a system called Web Mercator Auxilliary Sphere which does not use latitude,longitude, it uses a grid of meters. So your lat,long coordinates dont match with the basemap in the place you'd expect. You can use the Project method on the GeometryEngine class to change between the common systems: https://developers.arcgis.com/en/android/api-reference/reference/com/esri/core/geometry/GeometryEngine.html#project(double,%20double,%20com.esri.core.geometry.SpatialReference) In the code above, the project method is assuming you have latitude,longitude coordinates using the WGS 84 coordinate system, which is one of the most common. It depends where you got the coordinates from as to what system they might use, but there's a fairly good chance this is suitable. The second parameters indicates that you want to project to the system used by the MapView. you set the attribute initExtent. what does it mean?!?! (initExtent = "-19332033.11, -3516.27, -1720941.80, 11737211.28") So this is just some coordinates of xmin,ymin etc but using the web mercator auxiliary sphere system, not latitude and longitude.
... View more
01-22-2014
06:24 AM
|
0
|
0
|
877
|
|
POST
|
Yep it certainly looks like a very early version - the current release would be Implementation-Build: 10.2 I think (there have not been 10 major versions, but at some point the version numbers changed so they matched other Esri software, so it became 10.x version and forwards). There could be a whole lot of changes between the version you have and the current version though so worth investigating before you know if it's best to move or not - could be a good idea to upgrade if you intend your app to have a lifespan of a few more years.
... View more
01-16-2014
04:21 AM
|
0
|
0
|
1757
|
|
POST
|
how can i set an id to a graphic? You dont need to set an ID, because this happens automatically when you add the graphic to the layer. in my graphics layer, i only have the method Graphic[] getGraphics() I wonder what version of the ArcGIS Runtime SDK for Android you are using? Perhaps things have changed since the version you are using, as you mentioned that the code is inherited from someone else? I dont know much about the older versions of the API, I was using the latest version, e.g. see the API documentation here: https://developers.arcgis.com/en/android/api-reference/reference/com/esri/android/map/GraphicsLayer.html
... View more
01-16-2014
01:32 AM
|
0
|
0
|
1757
|
|
POST
|
Hi Raz, is this thing possible? any suggestions on how to approach the problem? Indeed it is possible. I would try something like this: 1. Use the setOnSingleTapListener method on the MapView to find out when a user taps on the map. In that method you will be passed a location in pixels (x and y parameters). 2. Pass these to the getGraphicIds method on the GraphicsLayer that you have, and this will find the unique IDs of the nearest graphics. You may want to experiment with the different overloads of this method - you can choose different tolerance distances for the tap location, and limit the number of results returned. 3. From that graphic ID that gets returned, you can then use the GraphicLayer.getGraphic method, to return the Graphic that was tapped on/near. At this point you can get any information from that Graphic you want. 4. Then you can pass this information to your second Activity via an Intent. For example, in the activity that has your map view (MapViewActivity in the the code below: map.setOnSingleTapListener(new OnSingleTapListener() {
@Override
public void onSingleTap(float x, float y) {
int[] ids = graphicsLayer.getGraphicIDs(x, y, 10, 1); // experiment with tolerance and num of results params here
if (ids != null && ids.length > 0)
{
Graphic foundGraphic = graphicsLayer.getGraphic(ids[0]);
if (foundGraphic != null) {
Intent intent = new Intent(MapViewActivity.this, GraphicActivity.class);
intent.putExtra("graphicInfo", String.valueOf(foundGraphic.getId()));
startActivity(intent);
}
}
}
}); Then in your second activity (called GraphicActivity in this example), you can get back the info from the Intent and show it somehow - just showing the ID in this example here: public class GraphicActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the message from the intent
Intent intent = getIntent();
String message = intent.getStringExtra("graphicInfo");
// Create the text view
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText("GraphicID = " + message);
// Set the text view as the activity layout
setContentView(textView);
} Hope this helps,
... View more
01-16-2014
01:10 AM
|
0
|
0
|
1757
|
|
POST
|
Hi, You can set an initial extent within the layout XML - this is ideal if you want to hard-code this to something specific known in advance, e.g. <com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
mapoptions.MapType="topo"
mapoptions.ZoomLevel="13"
mapoptions.center="33.666354 -117.903557" >
</com.esri.android.map.MapView> You can see this done in the Hello World sample code in the SDK - note that you likely want to zoom in as well to center on some part of the world, and this is done here by setting a zoom level. If you want to do this programmatically instead, first you must make sure that your coorinstae are the correct way around - look at the Point contructor and you will see that the Point constructor takes X, Y coordinates in that order, and X = latitude, Y = longitude. So your point creation would need to be: Point esri4326 = new Point(-117.903557, 33.666354); In the onCreate of an activity, the MapView may still be initializing itself, so this may be why the map did not zoom/center at that point possibly. What worked for me adding a listener for when the basemap layer is loaded and then I used zoomToResolution, which allows you to set the center point and to zoom to a specific resolution in the same method call, for example as shown below (you can probably work out a more appropriate way to check the basemap layer is loaded, e.g. cast source parameter to an ArcGISTiledMapServiceLayer and check it's name, or position in the map perhaps, below is just an example of something that worked in this case): mMapView.setOnStatusChangedListener(new OnStatusChangedListener() {
private static final long serialVersionUID = 1L;
public void onStatusChanged(Object source, STATUS status) {
if (OnStatusChangedListener.STATUS.LAYER_LOADED == status && (source instanceof ArcGISTiledMapServiceLayer)) {
Point esri4326 = new Point(-117.903557, 33.666354);
Point esri102100 = (Point) GeometryEngine.project(esri4326, SpatialReference.create(4326), SpatialReference.create(102100);
mMapView.zoomToResolution(esri102100, 2000);
}
}
}); Note that in theOnStatusChangedListener onStatusChanged callback I originally tried this below; however I found this wasn't working for me, although I am not sure why: if (OnStatusChangedListener.STATUS.INITIALIZED == status && source == mMapView)
// Failed to set map zoom / resolution here Hope this helps,
... View more
12-19-2013
06:25 AM
|
0
|
0
|
974
|
|
POST
|
Hi, I'm guessing that you may have started by following this tutorial, as the names and code suggested here is consistent with your code: https://developers.arcgis.com/en/android/guide/hello-world.htm. The "import" line that you suggested looks correct, and you should find that this runs OK and creates a simple app with a single layer of streets in it. One difference however is that in your onCreate, the mMapView variable is set twice - first a new MapView is created in code, and then secondly a MapView is retrieved from a layout by ID. Possibly this is just an error when you cut and pasted the code sample from the tutorial. As described in this tutorial, the simplest way to get started would be to use the second approach, where a MapView is added in the layout, and then you get a reference to the MapView from the layout by it's ID. So you can remove the line "mMapView = new MapView(this);".
... View more
12-17-2013
02:41 AM
|
0
|
2
|
1778
|
|
POST
|
Hi Max, When trying to load your add-in locally, does it not show up at all in the Operations Dashboard app? E.g. when you hit Debug in Visual Studio, and the Operations Dashboard starts up, is the widget not listed in the Add Widget dialog? There is a few troubleshooting tips for this problem here: http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/Troubleshooting/0170000000n8000000/ I normally found the most common problem was the path - e.g. the add-in project had moved locations. Second most common was accidental deletion of the required Export attributes. Post back if none of these help, or if you're unsure about the last tip (using Fuslogvw).
... View more
09-12-2013
12:27 AM
|
0
|
0
|
877
|
|
POST
|
Hi, The Troubleshooting help topic describes a few different reasons you can get this message - you have already ruled out a few of these as you say the service is usable in other clients, so perhaps it is a tiled service with a different spatial reference to the basemap you're using? http://help.arcgis.com/en/arcgisexplorer/help/#/Troubleshooting/01560000004p000000/ "the service may be a tiled map service published using a spatial reference (coordinate system) which does not match the current map, and therefore cannot be added to the current map. This message may also be shown if the service is a WMS service which does not support an appropriate coordinate system to match that of the basemap. In this case, you may be able to create the map using the ArcGIS.com map viewer, and then open the map in Explorer Online." Hope this helps,
... View more
07-25-2013
01:20 AM
|
0
|
0
|
819
|
|
POST
|
Hi Melissa, You may want to use the Query widget - you can add a query widget that lists predefined queries that your users can pick from. What might be useful in your case is if you specify that the user enters their own value to search for when they run the query; as the author of the query, you specify the data source and the attribute to search on. This help page might be useful: http://resources.arcgis.com/en/help/operations-dashboard/#/Configuring_a_query_widget/02m70000001m000000/ "If you want the user to be prompted for a value, check the Prompt for value check box, and type the default value in the Value box. You should also enter a Prompt and a Hint for the user when the query is executed; the prompt will be displayed as a message in an input dialog box, and the hint will be shown as a ScreenTip for the input." You are correct that the search box (the place finder) is not searching data sources in the map - it is using a global place finding service. Hope this helps, Shelly
... View more
07-19-2013
12:07 AM
|
0
|
0
|
836
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 6 hours ago | |
| 1 | 6 hours ago | |
| 1 | 05-15-2026 09:40 AM | |
| 1 | 01-03-2024 10:08 AM | |
| 1 | 01-02-2024 08:09 AM |