AnsweredAssumed Answered

Popup Dialog in 10.1.1

Question asked by aclarkeesri-ireland-ie-esridist Employee on Jan 29, 2013
Latest reply on Jul 1, 2013 by geonetadmin
Hi,

Thanks so much for all the hard work on the Android SDK - it has allowed us to
show the customer quite quickly an app that they would now like further developed-

I have a few questions since upgrading to the new version ...and I have been asked to post this here...


The popup is a control that takes the information from rest and constructs a dialog that the user can edit attributes - the developer writes the code behind that stores the results etc..

Previously in the last version the popup could do the following:

1. Show the Rest Attribute values
2. Go into Edit mode where the attributes can be edited.
3. Display a Toolbar that showed
     Edit mode,
     Delete a feature,
     Move a point,
     Add attachment
4. Functionality to select a photo from the photo gallery
5. Display all attachments in an image carousel
6. Worked fine with offline data


In this version - all the above except #1 and #2 seems to be missing....




Specifically the following issues.


Issue #1: Removed toolbar
Basically all the buttons from the PopupView don�??t seem to be available anymore�?�
�?� The Add attachment button
�?� and gallery viewer at the bottom
�?� the take photo button at the bottom �??
�?� the  little recycle button, move graphic button, accept button etc�?�
They are replaced in the sample code with some very simple looking buttons.

I have been told that some of this might be possible to fix with skinning - and pointers as to what we would need to do, to get back close to the previous version we had  would be appreciated -


Issue #2: Documentation
The documentation suggests we can get the old toolbar back �?? but I cannot see how.
(link)
"You can replace default toolbar of the popup viewby setting the PopupToolbar property on PopupContainer."

But there does not appear to be any property of that name and the toolbar seems to be completly removed.




Issue #3: Change to isEditable() causing problem
With the previous version - it was possible to add and edit an ArcGISFeatureLayer that was created from features passed in as JSON. ie. a disconnected feature set that has no server connection (as in the offline sample provided with the SDK).
We wrote the extra software to sync this with the server when the server was within 3G or Wifi range.

Now there seems to be a change in ArcGISFeatureLayer function
         �??public boolean Featurelayer::isEditable()�?�

In the current version only -  "isEditable always returns False when used with ArcGisFeatureLayer"�?� this possibly breaks the using ArcGisFeatureLayer for offline usage with this dialog and maybe other. This is not how it worked in the previous version.

Now �?? if the ArcGISFeatureLayer is created from an inmemory FeatureSet / JSON rather than a url �?? the resultant featurelayer isstuck as �??ReadOnly�?� as this function returning False always. In the previous version (December version) �?? Creating a FeatureLayer from an in memory FeatureSet left the data writable (and just some functions were blocked like ApplyEdits as expected)
Can we have ArcGisFeatureLayer not readonly again?



Issue #4: Change to hasAttachments causing problem
         "public boolean Featurelayer::hasAttachments()
also has the same issue as in #3
It used to perfectly possible for Popups to be displayed in the editor when ArcGisFeatureLayer was used as the source.
(They could not be stored automatically in the Feature class - but the Popup allowed them to be selected - and then we stored the attachements separately and synced them back to server when the time came.

In the current version only -  "HasAttachments always returns False when used with ArcGisFeatureLayer"�?� this breaks the possibility of using ArcGisFeatureLayer for offline usage with this dialog.
We really need this so that attachments will once again show in the Popup and we can do offline edits.



Issue #5: Small Graphic Glitch
There is a new graphic border around the Text edit controls - and on our device (Galaxy Note 2) the graphics are not in the correct place. They are too short for the textbox and appear at the bottom in edit mode. In Read mode they sometimes clip the bottom of the text making it hard to read - I'll attach screen shots of this - see the Red Circled graphic glitches in the screenshot below.


Issue #6: Extra Support Libraries
We are using the latest software on a very new device - a Galaxy Note 2 �?? and it took a few hours to realise that you had to load extra Android libraries (http://developer.android.com/tools/extras/support-library.html) onto the device to make the popup work �?? eventually found it through the forum - (thanks :)  ).

  6a. The extra libraries was not necessary with the previous version of the Esri Android SDK
  6b. all other parts of the Android SDK work fine without these extra libs �?? just the
New version of the popup seems to need them �??
  6c. this seems to increases the apk installation file a fair bit - so possibly slowing down debugging?
  6d. The docs the forums point to  seem to suggest only old Androids need these extra dlls - but this is a fairly recent device.
Can we build a certain way to not have to ship this legacy support library?
My manifest is currently set to
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />


Issue #7: Null pointer exception
This bit of code crashes the device immediately�?? worked fine in old version.
Note: The file is present and the app has full access to it via manifest file.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"></uses-permission>

Code:
Uri uri = Uri.parse("file:/storage/sdcard0/Pictures/Screenshots/IMG_edited/2013-01-16-20-25-31.png");
try{
  Options options = new Options();
  options.mode = MODE.SNAPSHOT; //Snapshot is REQUIRED for inmemory or the identify doesnt work
                ArcGISFeatureLayer fLayer = new ArcGISFeatureLayerAC(sDataLayerDef, fs, options);

                //ie - and an...offline.. featurelayer. I also tried waiting for map to initialise 
                Popup popup = featureLayer.createPopup(map, 0, graphic);

  //crashes here (it seems caused by "popup.f.h.c being NULL")
  popup.addAttachment(uri);
}
        catch(Exception ex){
  Alert("Error:"+ex.getMessage());
}

01-25 11:49:38.360: E/AndroidRuntime(22074): FATAL EXCEPTION: main
01-25 11:49:38.360: E/AndroidRuntime(22074): java.lang.NullPointerException
01-25 11:49:38.360: E/AndroidRuntime(22074):  at com.esri.android.map.popup.ArcGISAttachmentsAdapter.a(Unknown Source)
01-25 11:49:38.360: E/AndroidRuntime(22074):  at com.esri.android.map.popup.ArcGISAttachmentsAdapter.a(Unknown Source)
01-25 11:49:38.360: E/AndroidRuntime(22074):  at com.esri.android.map.popup.ArcGISAttachmentsView.addAttachment(Unknown Source)
01-25 11:49:38.360: E/AndroidRuntime(22074):  at com.esri.android.map.popup.Popup.addAttachment(Unknown Source)
01-25 11:49:38.360: E/AndroidRuntime(22074):  at ie.esriireland.npwsfieldcap.NPWSFieldcap$RunQueryFeatureLayerTask.onPostExecute(NPWSFieldcap.java:1424)
01-25 11:49:38.360: E/AndroidRuntime(22074):  at ie.esriireland.npwsfieldcap.NPWSFieldcap$RunQueryFeatureLayerTask.onPostExecute(NPWSFieldcap.java:1)





Issue #8: javaDoc
I think this broke when I upgraded to 10.1.1 (via the Help - Install Updates updater) - all the context Help is missing �?? I think it used to give some more Information and links to the docs when you hovered over functions �?? but it doesn�??t seem to do this anymore�?�
It just says �??javadoc could not be found�?� (screenshot attached below) - probably something I have misconfigured.. I can see the Javadoc is in the Eclipse folder ok - just not connected correctly.


Issue #9: Using previous SDK versions
I notice there is the possibility of using other SDKs - eg. older versions of Android SDK - but when I upgraded the ArcGis software it deleted completely the old version of the Esri Android SDK - it would have been nice to be able to compare the old and new - is it possible to have both installed and choose which SDK to use at compile time?


Issue #10: Specific Device Issues
By default on the Galaxy Note - the Popup background is white - but the Dropdown (domain) lists in the popup are all a very dark grey background and very dark black ink in colour �?? you can just barely make out the text - changing the theme of the application helped - but just pointing out the default is not possible to read.

Attachments:
No Javadoc
[ATTACH=CONFIG]21151[/ATTACH]

Old Popup Before 10.1.1 (the attachment button is not shown sorry - its at the bottom of page)
[ATTACH=CONFIG]21152[/ATTACH]

New Popup After (No toolbar - small graphic issue circled in red and no attachment button or image gallery shown)
[ATTACH=CONFIG]21153[/ATTACH]





Thanks again :)

Attachments

Outcomes