Sample Code Snippets - Android SDK | Zoho Creator Help

Sample code snippets


Note: Zoho Creator's Mobile SDK is currently a Beta feature. We do not recommend using it for apps in the production stage.

Java

Below are the code snippets that demonstrate how to use the different methods of Zoho Creator's SDK for Android:

To fetch the sections present in a Creator app


In the below snippet, Zylker_Orders is the target Creator application's link name:
  1. try {
  2. // your code goes here

  3.      ZCApplication firstApp = appList.get(0);
  4.      List<ZCSection> sections =
  5.      ZOHOCreatorUtil.getApplicationDetails(firstApp);
  6.  } catch (ZCException e) {
  7.          e.printStackTrace();
  8.          // Handle Error
  9.  }

To fetch a form's meta information

In the below snippet, Orders is the target form's link name:
  1. try {
  2.     ... // your code goes here
  3.     ZCSection firstSection = sections.get(0);
  4.     ZCComponent firstComponent =
  5.     firstSection.getComponents().get(0);
  6.     if(firstComponent.getType().equals(ZCComponentType.FORM)){
  7.         ZCForm form = FormUtil.getForm(firstComponent);
  8.     }
  9. } catch (ZCException e) {
  10.     e.printStackTrace();
  11.     // Handle Error
  12. }

To fetch a report's meta information

In the below snippet, All_Orders is the target report's report name:
  1. try {
  2.     ... // your code goes here
  3.     ZCSection firstSection = sections.get(0);
  4.     ZCComponent firstComponent =
  5.     firstSection.getComponents().get(0);
  6.     if(firstComponent.getType().equals(ZCComponentType.REPORT)){
  7.         ZCReport report = ReportUtil.getReport(firstComponent);
  8.     }
  9. } catch (ZCException e) {
  10.     e.printStackTrace();
  11.     // Handle Error
  12. } catch (CloneNotSupportedException e) {
  13.     e.printStackTrace();
  14. }

Kotlin

To fetch the sections present in a Creator app

To fetch a form's meta information

To fetch a report's meta information

In the below snippet, All_Orders is the target report's report name:

  1. try {
  2.     ... // your code goes here
  3.     val firstSection: ZCSection = sections.get(0)
  4.     val firstComponent = firstSection.components[0]
  5.     if (firstComponent.type == ZCComponentType.REPORT) {
  6.         val report = ReportUtil.getReport(firstComponent, 50)
  7.     }
  8. } catch (e: ZCException) {
  9.     e.printStackTrace()
  10.     // Handle Error
  11. } catch (e: CloneNotSupportedException) {
  12.     e.printStackTrace()
  13. }




    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                    Manage your brands on social media

                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                        Zoho Marketing Automation

                                          Zoho Sheet Resources

                                           

                                              Zoho Forms Resources


                                                Secure your business
                                                communication with Zoho Mail


                                                Mail on the move with
                                                Zoho Mail mobile application

                                                  Stay on top of your schedule
                                                  at all times


                                                  Carry your calendar with you
                                                  Anytime, anywhere




                                                        Zoho Sign Resources

                                                          Sign, Paperless!

                                                          Sign and send business documents on the go!

                                                          Get Started Now




                                                                  Zoho TeamInbox Resources



                                                                          Zoho DataPrep Resources



                                                                            Zoho DataPrep Demo

                                                                            Get a personalized demo or POC

                                                                            REGISTER NOW


                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now







                                                                                            You are currently viewing the help articles of Sprints 1.0. If you are a user of 2.0, please refer here.

                                                                                            You are currently viewing the help articles of Sprints 2.0. If you are a user of 1.0, please refer here.



                                                                                                  • Related Articles

                                                                                                  • Sample code snippets

                                                                                                    Below are code snippets that demonstrate how to use the different methods of Zoho Creator's SDK for iOS: To construct the FieldAccessPath To fetch a form object To fetch the choices from a field To submit a form To set a field's value To upload a ...
                                                                                                  • Sample iOS Application for users

                                                                                                    We have created an application using our Mobile SDK for your better understanding of the different methods and their usage. To install the app, you need to do the following: Prerequisites Creating the Zoho Creator application Registering your app ...
                                                                                                  • Sample iOS Application for customers

                                                                                                    Customers refer to people or entities who are external to your organization. For example, the vendors, retailers, logistics partners and customers that your organization does business with. By design, you'll have to create a customer portal to allow ...
                                                                                                  • Understand snippets

                                                                                                    Snippets are components that let you add short, custom codes to your page. Conventionally, snippets are stand-alone, re-usable code pieces that can add additional functionality. Types of snippets in a page: ZML snippet HTML snippet Embed For example, ...
                                                                                                  • Understand HTML snippets

                                                                                                    Snippets are stand-alone, re-usable code pieces that can add additional functionality. An HTML snippet is a small portion of source code in HTML. They can be used to build different elements (like a list view, different styled buttons, text display, ...
                                                                                                    Wherever you are is as good as
                                                                                                    your workplace

                                                                                                      Resources

                                                                                                      Videos

                                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                      eBooks

                                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                      Webinars

                                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                      CRM Tips

                                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                                        Zoho Show Resources