activity_main.xml

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoLo_1693126
Level 3
Level 3
First like received First like given

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.

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

View solution in original post

1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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