Over the past few years, ArcGIS Online has become a giant hub for people to share everything “geo”. This includes items such as maps, packages, data, services, csv files, and more recently, documents.
Apps vs Code Samples
You can upload many different types of items to the ArcGIS cloud, so it’s important to point out that “apps” are quite different from “code samples”. Apps are generally applications such as configurable templates and solutions that you share with others. Some app items just contain URLs to apps hosted somewhere else, while others contain pre-compiled ready-to-use apps that you can download and install on your computer or device, e.g. ArcGIS for Android.
Code samples, however, are just items that you create when you upload .zip files that contain your custom code, project files and directories.
Finding Code Samples
Now here’s the real secret! Check ON the “Show ArcGIS Desktop Content” and click the “Date” link to sort code samples with the newest on top. Presto!
Now add some keywords to refine your search. Try these:
GeoGeek Tip: Is there an easy way to find the latest code samples that have been uploaded to ArcGIS Online? Yes! Because every custom search is just an HTTPS REST request, you can just bookmark it and refresh your browser to see the newest code samples at any time in the future.
Sharing Code Samples
Log into ArcGIS Online and go to the “My Content” tab. NOTE: You’ll need an account to do so.
Click “Add Item” and choose your .zip to upload.
Once you get the .zip, use the “Contents” and “Language” pulldowns to specify “Code Sample” and the language the app is written in. Go ahead and add some tags too.
Share your code: Once the item is created, use “SHARE” to share the code sample with “Everyone” in the world, or just with a Group you own.
GeoGeek Tip: Should I use ArcGIS Online or GitHub to share my code? Great question! If you are looking for a simple way to upload a .zip file and share it with your private AGO organization, and you’re not worried about version control, then ArcGIS Online might be a good way to go. However, if you want to to publicize your code, use version control and accept code contributions from the community, then GitHub is a better tool. If you are unsure which way to go, the just add your code to ArcGIS Online and then add a link to the GitHub repository where you can manage it and accept contributions. We do this all of the time!
That’s it folks!