1 Reply Latest reply on Aug 17, 2019 9:56 AM by DheerajK_81

    activity_main.xml

    JoLo_1693126

      BLE101robot I am trying to follow and copy.  I am on the Andriod side now.  It seem that the code in git, bleapp/AndroidStudio/BLE101_robot/app at master · cypresssemiconductorco/bleapp · GitHub , is missing "activity_main.xml" file.

       

      Better yet, where can I find a complete BLE101robot Andriod code?

       

      Thanks.

        • 1. Re: activity_main.xml
          DheerajK_81

          When creating an Android App, you can choose to use a different name than the default "MainActivity". Based on what name you give, both the java and the xml layout file will have the same name. For example, if you name the activity as "SampleActivity", the layout will have the name "activity_sample" by default.

           

          For example, you will notice in BLE Robot Source Files that there is no "MainActivity.java" file. Hence, there won't be an "activity_main.xml".

           

          To find out which activity is launched first, you need to check the AndroidManifest.xml file.

           

          Here, you need to check for the intent filter which reads MAIN and LAUNCHER as shown below:

          <activity android:name=".ScanActivity">
            <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            </activity>
          

           

          So, ScanActivity is actually the MainActivity or the activity that's going to be launched first.

           

          Therefore the code is actually complete and there are no missing files. Hope this clears things out

           

          Regards,

          Dheeraj

          1 of 1 people found this helpful