I'm trying to implement this https://github.com/mik3y/usb-serial-for-android/blob/master/UsbSerialExamples/src/com/hoho/android/usbserial/examples/SerialConsoleActivity.java in my project but there is something wrong with this sample.
Line 121:
sDriver.setParameters(115200, 8, UsbSerialDriver.STOPBITS_1, UsbSerialDriver.PARITY_NONE);
Why I can't see this method setParameters()?
I had the same problem when I tried to use the example project. The problem I had was that I was using usb-serial-for-android-v010.jar that you can download from the git repository. I think it was created using an older version of the project and doesn't support some of the newer features like setParameters. If you downloaded the example project there should be a folder inside called UsbSerialLibrary. Import that into your IDE and add it to your build path: (Eclipse) Properties>Java Build Path>Projects>Add. This should let you use setParameters.
Also, the API was recently refactored so you may want to look at that.
Related
I have downloaded calendar project from https://github.com/android/platform_packages_apps_calendar and now I'm trying to run that project. I imported the project to eclipse via new --> Android project from existing source, it imported successfully but I'm getting a red exclamation mark in project, like this:
When I went to properties > Android I'm seeing this:
It looks like the project is using some libraries but is not able to find in the workspace. How can I fix this?
You may to add the following dependencies as well.
https://android.googlesource.com/platform/frameworks/ex/
https://android.googlesource.com/platform/frameworks/opt/colorpicker/
https://android.googlesource.com/platform/frameworks/opt/calendar/
https://android.googlesource.com/platform/frameworks/opt/datetimepicker/
https://android.googlesource.com/platform/frameworks/opt/timezonepicker/
I was able to build the AOSP Android calendar.
Ye Lin Aung give you almost all the neccesary, but you will need also "chips" library. This library is not included in the last master aosp necessary packages , but its in their repository in the old versions.
You can find the neccesary libraries in the next repository:
https://gitlab.com/Purcallas/AOSPCalendarExtensions/tree/master
Or in the Google repository (as say Ye) you can find chips and common values:
https://android.googlesource.com/platform/frameworks/ex/+/ics-mr1
remove all the library from here and import each and every one in your project workspace and then after add the library.
I would like to compile the sample provided by Sony for his SmartWatch. I followed the instructions in this page. But when I added the the SmartExtensionUtils project I saw lot of errors like: com.sonyericsson.extras.liveware.aef cannot be resolved to a variable. Instead this import com.sonyericsson.extras.liveware has no problem.
Did someone find and solve this issue?
In order for the EightPuzzleGame to compile, you need to add the following library projects that are available in the SDK:
SmartExtensionAPI
SmartExtensionUtils
SmartExtensionInternalUtils
In your case, it is the API project that is probably missing. You can see what library projects that are missing by checking the project properties. Example:
What you need to do is go to the properties page of the SmartExtensionUtils library and in the library box add SmartExtensionAPI as a dependency
This is a link to my desktop screenshot. SmartExtensionAPI and utils are in the project list (left side) but the EightPuzzleExtension does not find them
You don't need SmartExtensionInternalUtils project. When you create project from existing source, check Import project into Workspace. In this way EightPuzzle, SEAPI and SEUtils will be in the same directory and you'll not have no errors :)
I had this problem too. What i did is to solve it, is to import from the Sony samples in the Sony add-on SDK 3.0 the SmartExtensionAPI first and than SmartExtensionUtils. If these samples are build correctly the other samples will build correctly as well.
Go to File|Import, choose SmartExtensionAPI as your root directory and click finish. Maybe you have to change the compiler compliance level to build it correctly. After this do the same for SmartExtensionUtils.
Help needed!!!! Stuck for 2 weeks on this and help needed.
I've recently imported the facebook sdk for android and its projects into my workspace. It shows up errors and the problems:
Archive for required library: '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar' in project 'FacebookSDK' cannot be read or is not a valid ZIP file
And the samples get errors along the line of:
The container 'Android Dependencies' references non existing library '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar'
The things I have done following the other discussions without any success are
cleaned project
set the Facebook SDK as library
looked at the build path section and added external jar consisting of facebook/libs
imported fb sdk like 20 times and into different folders.
made sure my java compiler was 1.6
HELP would be very greatly appreciated!!!!
Take the lastest version of android-support-v4.jar (in your sdk environement : sdk/extras/android/support/v4/android-support-v4.jar) and replace in your project and library project do not create conflict.
The steps to importing a library are:
Download the library
Place the library in the libs folder of the project.
Build the project
Do Not attempt to import the library using some import wizard.
I suspect either your download was corrupted, and you need to do it again, or you put the file into the wrong directly.
I think your problem is that the android.support.v4 versions are different, take the one from your project and replace the one in the Facebook sdk lib folder, it should dismiss the clash.
As per your question, I think you are not able to compile once you add the SDK to your project. Do you get an error saying unable to run as library?
If so that means you have included this as library and create your project as a library to be used further. It is a common mistake that I have seen many people do when they try to import a library to use and tick mark the checkbox is Library. This actually means you want this project to be treated as a library for future use. Just try to add the SDK and do not tick mark the checkbox and this project will run fine.
Many forums will just tell you to tick that checkbox and you will be stuck on this error for long time.
For any .jar file related issues you have to make the .jars files compatible as there hashing a problem and the two jars are not compatible with each other (a version issue).
I want use ActionBar for my application but i found it can't use for android < 3.0.
I found this https://github.com/johannilsson/android-actionbar to solved my problem but I get error at
import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.Action;
import com.markupartist.android.widget.ActionBar.IntentAction;
Give ActionBarSherlock a try. I use it for one of my projects and after some reading of the docs and the samples it just worked. The samples are easy and straight forward, you should be able to extract what you need from them.
To see what it's able of just download the sample app from the market: Sample App (requires at least Android 1.6)
You should add the code to a library, and add the library to your project.
To do this in Eclipse create a new project, using the same package name as the github project (so com.markupartist.android.widget). In the properties select the project to be a library under the Java Build Path tab. Then, in your project, go to its properties, and select the library.
I think your including files are missing (JAR libs) , Click on error icon and then select fix project setup.
I spent around 10 hours trying to fix this problem. All the above ans does not work. Actually what is missing is android support library. To fix this, right click on project, >Android Tool> Add Support Library. Hope this save alot of time for other who came across this. just add support library both on your ActionBar library and the current project.
I am working on a custom Android library. I start off with a java project (in Eclipse) with another UI testing Android project.
In my UI testing project, I reference the library project in build path, and everything is good and I can test the library codes in the UI.
Later on, I decided I need to have the 'Gen' code (for custom styles attributes), so I try to change my library to an Android project (via Android-tools -> convert.. ), and disasters happens! After fixing up all the compile time problems, it finally 'let' me start the UI testing application, and bangs! When I try to create any objects from the library class, it said (in the Log) that Class not found.
Two questions:
Any idea how to fix this? I tried but seems it is for referencing another .apk that need to install separately.
If I just keep it to be java project (not android) for my library, can I use the resource generator? and how?
PS: the dependency (my library) is installed before the UI test application, according to the Console of Eclipse said.
Update: I tried to compile the library project to jar and reference it from the UI testing, and in this way, it works. But I don't want to use this approach since it is very slow in terms of testing.
for those who are doing same mistake like me
when library project is an android project
got to
properties > android > click add button at bottom of the popup inside
library section
and add project, instead of
properties > java build path > project > add
later approach is for pure java projects only .
Finally I found the answer to my own question. This is actually mentioned in official documentation.