Select to view content in your preferred language

Offline works in ios but not android

14253
75
04-22-2014 04:59 PM
CharlesDawley
Occasional Contributor
I have a collector map that works fine in online/offline mode on my iphone.

When I try and use the offline mode on my android tablet the features do not appear.
But when I use the map in online mode the map works as expected.
Tags (2)
75 Replies
RussRoberts
Esri Notable Contributor
What errors are you seeing? I have had other people able to use it without any issue. Are the file directories formatted correctly?

Russ
0 Kudos
MeganPerry1
New Contributor III
Hi Russ,

I am not a programmer so maybe I am entering in something wrong here is my code... am i missing anything?  I do really appreciate your help on all of this.  Thanks!

>>> #!/usr/bin/python

# Import sys, getopt, arceditor, arcpy modules
import sys, getopt, arceditor, arcpy

def main(argv):
   input_gdb = 'C:\Users\Kyle\Documents\Bioko Island\GIS1\GIS1'
   output_gdb = 'C:\Users\Kyle\Documents\Bioko Island\APP Data.gdb'
   try:
      opts, args = getopt.getopt(argv,"hi:o:",["ifile= C:\Users\Kyle\Documents\Bioko Island\GIS1\GIS1","ofile= C:\Users\Kyle\Documents\Bioko Island\APP Data.gdb"])
   except getopt.GetoptError:
      print 'test.py -i <input_gdb> -o <input_gdb>'
      sys.exit(2)
   for opt, arg in opts:
      if opt == '-h':
         print 'test.py -i <input_gdb> -o <output_gdb>'
         sys.exit()
      elif opt in ("-i", "--ifile"):
         input_gdb = arg
      elif opt in ("-o", "--ofile"):
         output_gdb = arg
   print 'Input gdb is: "', input_gdb
   print 'Output gdb is: "', output_gdb

   Temp_xml = "temp.xml"

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

   # Export XML Workspace Document
   arcpy.ExportXMLWorkspaceDocument_management(input_gdb, Temp_xml, "DATA", "BINARY", "METADATA")

   # Import XML Workspace Document. This assumes that the outputfile geodatabase is EMPTY.
   arcpy.ImportXMLWorkspaceDocument_management(output_gdb, Temp_xml, "DATA", "")

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

if __name__ == "__main__":
   main(sys.argv[1:])
  
SyntaxError: multiple statements found while compiling a single statement
>>>
0 Kudos
RussRoberts
Esri Notable Contributor
Change the file directories from '\' to '\\' and see if you can get it working.
0 Kudos
MeganPerry1
New Contributor III
That didn't work either.  I think it has something to do with this line:

import sys, getopt, arceditor, arcpy
0 Kudos
RussRoberts
Esri Notable Contributor
are you using arceditor or arcinfo? If you are using arcinfo you can just enter in that instead of arceditor and try rerunning it.

Russ
0 Kudos
JeganS
by
New Contributor
Hi Megan,

I am assuming that the .geodatabase file that you copied from the Android device and the File geodatabase that you created using ArcGIS Desktop are present in the following folders

.geodatabase file location:
C:\Users\Kyle\Documents\Bioko Island\GIS1\GIS1

File geodatabase location:
C:\Users\Kyle\Documents\Bioko Island\APP Data.gdb

Try the following code and check if you are able to retrieve the data from the .geodatabase file. The 'input_gdb' parameter in the code refers to the .geodatabase file that you copied from the Android/iOS device. I assumed that you renamed the .geodatabase file to GIS1.geodatabase. In case if it has a different name, please edit the code before running it.

#!/usr/bin/python

# Import sys, getopt, arceditor, arcpy modules
import sys, getopt, arcpy

def main(argv):
   input_gdb = r'C:\Users\Kyle\Documents\Bioko Island\GIS1\GIS1.geodatabase'
   output_gdb = r'C:\Users\Kyle\Documents\Bioko Island\APP Data.gdb'
   try:
      opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
   except getopt.GetoptError:
      print 'test.py -i <input_gdb> -o <input_gdb>'
      sys.exit(2)
   for opt, arg in opts:
      if opt == '-h':
         print 'test.py -i <input_gdb> -o <output_gdb>'
         sys.exit()
      elif opt in ("-i", "--ifile"):
         input_gdb = arg
      elif opt in ("-o", "--ofile"):
         output_gdb = arg
   print 'Input gdb is: "', input_gdb
   print 'Output gdb is: "', output_gdb

   Temp_xml = r"C:\temp.xml"

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

   # Export XML Workspace Document
   arcpy.ExportXMLWorkspaceDocument_management(input_gdb, Temp_xml, "DATA", "BINARY", "METADATA")

   # Import XML Workspace Document. This assumes that the outputfile geodatabase is EMPTY.
   arcpy.ImportXMLWorkspaceDocument_management(output_gdb, Temp_xml, "DATA", "")

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

if __name__ == "__main__":
   main(sys.argv[1:])


Hope this helps. Let me know if you still experience any issues.
0 Kudos
MeganPerry1
New Contributor III
Hello,

This is the new error I am getting, sorry to be such a pain but I am determined to figure out what I am doing wrong!  Thanks so much

Runtime error  Traceback (most recent call last):   File "<string>", line 40, in <module>   File "<string>", line 31, in main   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 1089, in ExportXMLWorkspaceDocument     raise e ExecuteError: ERROR 000808: Invalid dataset type
0 Kudos
JeganS
by
New Contributor
Hello,

This is the new error I am getting, sorry to be such a pain but I am determined to figure out what I am doing wrong!  Thanks so much

Runtime error  Traceback (most recent call last):   File "<string>", line 40, in <module>   File "<string>", line 31, in main   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 1089, in ExportXMLWorkspaceDocument     raise e ExecuteError: ERROR 000808: Invalid dataset type


Could you upload your .geodatabase file to any file sharing website like Google Drive or Dropbox and give me the link to download it. This would help us execute the script at our end utilizing your data and figure out what is causing this issue.

Thanks!
0 Kudos
MeganPerry1
New Contributor III
Have you had a chance to look at our database?

Thanks!
0 Kudos