cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

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
Reply
1 Solution
Moderator
Moderator

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
Moderator
Moderator

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