Im trying to modify an existing project, the BluetoothLeGatt example, to 
turn it into ArduDroid, which is this app used to interface with Arduino 
via BT.  The ArduDroid looks like this:

<https://lh3.googleusercontent.com/-Ey0-8ov5hEE/VwWjVeipYYI/AAAAAAAAD0U/VaLd1flEUV8rqYL39F9n8JBl6NCD6JHlw/s1600/ardudroid.png>

I have already figured out how to design this far.  The original app 
consisted of:

DeviceScanActivity.java as the main activity which only had an optionsMenu 
with 2 buttons (scan and stop)

DeviceControlActivity.java

BluetoothLeService.java

SampleGattAttributes.java

These came with the following xml layout files:

listitem_device.xml

actionbar_indeterminate_progress.xml

gatt_services_characteristics.xml

I added these 2:

ArduDroidActivity.java

activity_main.xml

So far ArduDroidActivity.java only calls 
setContentView(R.layout.activity_main).  I am calling it from a button in 
the DeviceScanActivity, by adding a sendMessage() method which creates an 
Intent and starts the new activity.  The problem so far is that I cant see 
the button.

I wasnt sure how to add the button, I figured I could just throw it into 
the listitem_device.xml so I added these lines:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
    <TextView android:id="@+id/device_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="24dp"/>
    <TextView android:id="@+id/device_address"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="12dp"/>
    <!--ADDED BUTTON-->
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/button_send"
        android:onClick="sendMessage" />
</LinearLayout>


But when I run the app I cant see the button.

Any ideas why?

Im hoping I can call my new activity_main.xml so that I can access all the 
buttons and sliders in order to send commands to a bluetooth module on an 
arduino.


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c4759381-b317-46c4-90be-0557f1f0ddb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to