![]() There should be a basic code like the following.Now double click on the java “Fpgalover_USB_Serial.java” which is under the main folder into the java folder.Now we have a basic layout to start coding.The second textField id, change it to “rxText”.The one above the btSend, change its id by the name “txText”.Locate one of them above the button btSend, and the other one below the button btSend Now, search on the palette, under TextFields, the option “Plain Text”, and add 2 of those into the layout.Now go to the view “component tree” and remove the TextView is in there.Rename it with the name “Send” on properties, and change its ID name as well with “btSend”.Now it is time to add a button, so select from the palette the widget “Button”, and drag and drop it on the cellphone’s screen. ![]() Then double click on the activity layout, and your Android Studio’s perspective will be changed to: ![]() So expand the folder “src”, which is located within the folder “app”, and find the GUI layout which is located on “/src/main/res/layout” as you can see in the following image.Now it is time to customize you GUI before coding this example using the USB-serial Library.After adding it, you must wait until your app is updated and refreshed, then you are going to be able to see into the jar you just pasted on the folder lib.After pasting it, right-click on the file “usbserial.jar”, and choose “Add As Library…”.Paste on this folder the jar you downloaded.Now expand the folder “app”, and there should be a folder called “Lib”.Now if we expand the folder “FPGALover_USB_Serial” we are going to observe in detail all our project directory.We are going to click on the tap “app” and select the folder “Lib”.After creating the new project, it is gonna appear something like the following.Now, open Android Studio, let’s begin by creating a new project.After you have installed Android Studio, you need to download this JAR file, which contains the driver to access FTDI Serial devices.First, you need to have installed Android Studio 2.1 or superior, in this case I will work with Android 2.1.2.However, it is not always handy for beginners to have an explained and detailed tutorial about it, which drives me to write this simple but useful tutorial that you might find useful for your class projects or whatever your idea could be. As everyone knows, we are used to using UART/Serial protocols to create communication channels between our programable devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |