10 Replies Latest reply on Nov 28, 2013 7:54 AM by snockmindone

    Attachments with ArcGIS Mobile

    m.glasesri-de-esridist
      I am looking for hours for a possibility synchronizing attachments with arcgis server and could not find anything useful.

      What I need is:
      We have to sync CAD documents to clients. Therefore I want to use the ArcGIS Mobile Sync mechanism.
      For 9.3 I could find some classes for attachments (ESRI.ArcGIS.Mobile.MobileServices.AttachmentInfo and ESRI.ArcGIS.Mobile.MobileServices.FeatureAttachmentManager). I do not know how this is what I am looking for, but this classes are not existing in Mobile 10 any longer, so it make no sense to go deeper in it.

      So: What is the way to adminster attachments on ArcGIS Mobile 10?
        • Re: Attachments with ArcGIS Mobile
          m.glasesri-de-esridist
          Less knowledge so far ... as I expected.

          Now I tried to create a new feature class and added a Blob field where I want to save my attachments. Also I added a Raster field for testing.
          Then I tried on the client to save data to this fields. In the Raster field I could not save binary data, only bitmap. So, photos can be saved.
          But - where is my Blob field? If I look my layer's table, the Blob field is missing!? No idea why.
          I added two Blob fields for testing, both were not present on mobile client. Could Mobile 10 not work with Blob?

             FileStream fs = new FileStream(@"C:\temp\MapCaches\Mobile10Tests\zeitplan.pdf", FileMode.OpenOrCreate, FileAccess.Read);
             byte[] data = new byte[fs.Length];
             fs.Read(data, 0, Convert.ToInt32(fs.Length));
             fs.Close();
          
             Bitmap bitmap = new Bitmap(@"C:\temp\MapCaches\Mobile10Tests\bild.jpg");
          
             var table = ((FeatureLayer) mobileService2.Layers["Attachments"]).GetDataTable();
             var row = table.NewRow();
             row["Raster1"] = bitmap;  //-> works
             row["Binary1"] = data;     //-> no Binary1 field found!
             table.Rows.Add(row);
             table.SaveInFeatureLayer();
          • Re: Attachments with ArcGIS Mobile
            AkhilP
            Hi,

            I read this post, at first I didn't understand what you mean by "Attachment". Now it seems like you want to simply attach an image/photo to the feature you are collecting.

            1) In ArcCatalog you can Add a Raster field (you have already done) in which you can add an image to your feature. The image attached in the field is of a Bitmap variable.
            I believe you got a handle of this. But are you stating this doesn't work for some reason? Can you elaborate some more as to if or if not this Raster field is working for you?


            2) The second way to have "attachments" is blob fields, also added through ArcCatalog. According to the documentation I found/lack there of, the name of the blob field must be "Picture_<something>".

            You can find my post inside the thread here with the name of Photo in Mobile 10, something like that.

            However, I tried this and it did not work, even with the proper naming convention of "Picture_<something>" I still couldn't see that field in the attribute entry in ArcGIS Mobile 10.

            Either we may be doing something wrong or this feature seems to not work correctly or at all.

            Also by using the blob field and the naming convention, you would be allowed to attach as many image/photos you want to the feature. However with the raster field you will only be allowed 1 image/photo per feature. (Provided that the blob field thing worked)
            • Re: Attachments with ArcGIS Mobile
              jchen-esristaff
              If you found blob filed missing from your mobile cache, one possible reason is that the blob field is not "checked" in your mxd. In ArcMap, if you bring up the layer property and go to "Fields" tab, make sure your blob field is checked. Mobile service will only ship those fields that are checked to client. By default the blob field is checked off in mxd.

              Less knowledge so far ... as I expected.

              Now I tried to create a new feature class and added a Blob field where I want to save my attachments. Also I added a Raster field for testing.
              Then I tried on the client to save data to this fields. In the Raster field I could not save binary data, only bitmap. So, photos can be saved.
              But - where is my Blob field? If I look my layer's table, the Blob field is missing!? No idea why.
              I added two Blob fields for testing, both were not present on mobile client. Could Mobile 10 not work with Blob?

                 FileStream fs = new FileStream(@"C:\temp\MapCaches\Mobile10Tests\zeitplan.pdf", FileMode.OpenOrCreate, FileAccess.Read);
                 byte[] data = new byte[fs.Length];
                 fs.Read(data, 0, Convert.ToInt32(fs.Length));
                 fs.Close();
              
                 Bitmap bitmap = new Bitmap(@"C:\temp\MapCaches\Mobile10Tests\bild.jpg");
              
                 var table = ((FeatureLayer) mobileService2.Layers["Attachments"]).GetDataTable();
                 var row = table.NewRow();
                 row["Raster1"] = bitmap;  //-> works
                 row["Binary1"] = data;     //-> no Binary1 field found!
                 table.Rows.Add(row);
                 table.SaveInFeatureLayer();
              • Re: Attachments with ArcGIS Mobile
                jchen-esristaff
                Hi Esri.Ger.Mag,

                We've been working on attachment support and that's why you see some attachment API exposed at 9.3.1 on mobile SDK. However at 10 final release the attachment support is not fully implemented so we decided to keep it internal.

                FYI.

                -Jay


                I am looking for hours for a possibility synchronizing attachments with arcgis server and could not find anything useful.

                What I need is:
                We have to sync CAD documents to clients. Therefore I want to use the ArcGIS Mobile Sync mechanism.
                For 9.3 I could find some classes for attachments (ESRI.ArcGIS.Mobile.MobileServices.AttachmentInfo and ESRI.ArcGIS.Mobile.MobileServices.FeatureAttachmentManager). I do not know how this is what I am looking for, but this classes are not existing in Mobile 10 any longer, so it make no sense to go deeper in it.

                So: What is the way to adminster attachments on ArcGIS Mobile 10?
                • Re: Attachments with ArcGIS Mobile
                  jchen-esristaff
                  Hi AkhilP,

                  I tried to reproduce the issue of mobile application at 10 doesn't show blob field that has field name starting with "picture_", but with no avail. Both Windows and Windows Mobile application treat them as picture and offered options to take a photo (WM only) or browse to select a photo.

                  By default blob field will be not be shipped to mobile client. You can manually change this by taking a looking at the Fields tab on the layer's property dialog. Make sure the blob field is checked.

                  Let me know if this still doesn't work for you.

                  -Jay

                  Hi,

                  I read this post, at first I didn't understand what you mean by "Attachment". Now it seems like you want to simply attach an image/photo to the feature you are collecting.

                  1) In ArcCatalog you can Add a Raster field (you have already done) in which you can add an image to your feature. The image attached in the field is of a Bitmap variable.
                  I believe you got a handle of this. But are you stating this doesn't work for some reason? Can you elaborate some more as to if or if not this Raster field is working for you?


                  2) The second way to have "attachments" is blob fields, also added through ArcCatalog. According to the documentation I found/lack there of, the name of the blob field must be "Picture_<something>".

                  You can find my post inside the thread here with the name of Photo in Mobile 10, something like that.

                  However, I tried this and it did not work, even with the proper naming convention of "Picture_<something>" I still couldn't see that field in the attribute entry in ArcGIS Mobile 10.

                  Either we may be doing something wrong or this feature seems to not work correctly or at all.

                  Also by using the blob field and the naming convention, you would be allowed to attach as many image/photos you want to the feature. However with the raster field you will only be allowed 1 image/photo per feature. (Provided that the blob field thing worked)
                  • Re: Attachments with ArcGIS Mobile
                    jchen-esristaff
                    Hi Esri.Ger.Mag,

                    Just want to follow up with you on your use case. We are working on attachment support and would like to learn a bit more details on how your user uses attachment. As I understand, you need to save CAD document as an attachment and ship it to client.
                    - Are your clients using tablet mobile application or windows mobile application?
                    - Once attachment is shipped to client, they need to view it? If so, they need to have appropriate application installed on their tablet/wm device? And only need to view or also needs editing capability?
                    - What kind of CAD document are we talking here?

                    Thanks for your input.
                    -Jay

                    I am looking for hours for a possibility synchronizing attachments with arcgis server and could not find anything useful.

                    What I need is:
                    We have to sync CAD documents to clients. Therefore I want to use the ArcGIS Mobile Sync mechanism.
                    For 9.3 I could find some classes for attachments (ESRI.ArcGIS.Mobile.MobileServices.AttachmentInfo and ESRI.ArcGIS.Mobile.MobileServices.FeatureAttachmentManager). I do not know how this is what I am looking for, but this classes are not existing in Mobile 10 any longer, so it make no sense to go deeper in it.

                    So: What is the way to adminster attachments on ArcGIS Mobile 10?
                    • Re: Attachments with ArcGIS Mobile
                      m.glasesri-de-esridist
                      Hi Jay,

                      thanks for reply!

                      If you found blob filed missing from your mobile cache, one possible reason is that the blob field is not "checked" in your mxd. In ArcMap, if you bring up the layer property and go to "Fields" tab, make sure your blob field is checked. Mobile service will only ship those fields that are checked to client. By default the blob field is checked off in mxd.

                      Correct, that was the problem. After checking the blob fields I could see and edit the fields.


                      We've been working on attachment support and that's why you see some attachment API exposed at 9.3.1 on mobile SDK. However at 10 final release the attachment support is not fully implemented so we decided to keep it internal.

                      Thanks for information. That is interesting to know. So there is a good chance, that in 10.1 we will see attachment support?


                      Just want to follow up with you on your use case. We are working on attachment support and would like to learn a bit more details on how your user uses attachment. As I understand, you need to save CAD document as an attachment and ship it to client.
                      - Are your clients using tablet mobile application or windows mobile application?
                      - Once attachment is shipped to client, they need to view it? If so, they need to have appropriate application installed on their tablet/wm device? And only need to view or also needs editing capability?
                      - What kind of CAD document are we talking here?

                      Thanks for your input.

                      I will help where I can! It is in my interesting, too.
                      The decision, which plattform to use is not yet made. But it seems to get Windows Mobile 6.5. For Windows Phone 7 I think we will not have support yet. Perhabs we need a second plattform, too. This will be a Windows Desktop, but it is not clear yet.
                      Our customer has technical documents and has the demand showing these files on mobile devices.
                      Our advantage is, that he has no specification, what format to use. So we will take pdf file format to show on mobile devices. To view these files I think we will use an external pdf viewer.

                      If you have any more questions or want to know more details, please call.

                      Greetings,
                      Max
                      • Re: Attachments with ArcGIS Mobile
                        AkhilP
                        Hi AkhilP,

                        I tried to reproduce the issue of mobile application at 10 doesn't show blob field that has field name starting with "picture_", but with no avail. Both Windows and Windows Mobile application treat them as picture and offered options to take a photo (WM only) or browse to select a photo.

                        By default blob field will be not be shipped to mobile client. You can manually change this by taking a looking at the Fields tab on the layer's property dialog. Make sure the blob field is checked.

                        Let me know if this still doesn't work for you.

                        -Jay


                        Thank you Jay, I'm pretty sure that placing the checkmark in the field will work, but at the moment my client currently wants one image, and the Raster field is working fine for now. I have a presentation to make about the mobile application (tablet) and if my superiors want multiple photos attached, I will then look into re-adding the blob fields.

                        Thanks,

                        Akhil P.
                        • Re: Attachments with ArcGIS Mobile
                          badgerseatfrogs1
                          Does anyone know if this is attachment functionality is now working in 10.1 as promised?
                          • Re: Attachments with ArcGIS Mobile
                            snockmindone
                            Does anyone know if this is attachment functionality is now working in 10.1 as promised?


                            Did you find something that works?