I can't extend Form - java

I started using android studio recently, and I'm following this guide but I can't seen to extend form, android studio highlights form in red and gives me the option to alt+enter. Once I alt+enter to import form, it show
import java.text.Normalizer;
but the guide show
import com.google.devtools.simple.runtime.components.android.Form;

"alt-enter" will give you options that are available on your local build. The tutorial gives you the assets and if they are not properly placed in your project, then this will not work.
You should be able to manually add the import:
import com.google.devtools.simple.runtime.components.android.Form;
If that fails, then I would assume that you did not properly add the ".jar" file in the tutorial. There are several ways to add jars (like put it in the "libs" folder). Do a search and you can select what works best for you and it should fix your problem.
Once it's properly imported into your project, you should see that import as an option. If you don't but manually entering it works, maybe restart Android Studio if that happens. Either way, you should have a good build at that point, and that's what matters.

Related

Not able to import Selenium jar files

Not able to import Selenium jar files in Eclipse for some reason, while importing first time from quick fixes it works showing no error after saving the program it showing me that import is not working
Below is code:
Note: The issues arise only for Java projects only
A solution would be to use maven for the dependency management. Eventhough a quick demo with just a couple of dependecies should be ok in eclipse it is sometimes a pain in the a.
Try rebuilding the project. Build -> Build Project, and check the project setup. Eclipse gives also a error log when sth goes wrong. Have you taken a look at it? Problems View.

vscode can not use for native module?

I using react-native. When I implement native module, it pops up errors window all the place like "The import android cannot be resolved (Java)" when I import something like android.widget.Toast.
The code still run well but it cause very hard for me to developed. Any tips?
Open a new XCode window with the directory being the android folder, using code android when you are inside the react native folder. I am able to get autocomplete, intellisense and autoimport in this window.
maybe you can try to delete the caches of the project. as it was storaged under:
"C:\Users\UserName\AppData\Roaming\Code\User\workspaceStorage".
many folders under it, as a folder correspondence a project, delete the correspondence folder of this project(as you can identify it through the 'modified date').

Importing PhotoView?

Ok so I want to chisbanes PhotoView.. I'm pulling my hair out now, Been staring at the screen for over an hour and for the life of me, I cannot figure out how to get this to even import into eclipse.
I've downloaded the git so I have my PhotoView-master folder with plenty of things in there (Looks like a project tbh). But no jar?
I came across this question which was marked as answered but I simply could not figure this one out.
Android : import libraries Like PhotoView
I went through this
http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject
But once again, there's nothing even available for me to add.
Anyone know what I need to do to actually get this loaded into eclipse and ready to reference?
Cheers in advance
Ok so I managed to get it working after hours slaving away at the screen.
First you need to move everything under the java/uk folder to the src/ folder in Eclipse. Once you do it the src/uk/... should look as normal. Next you need to go the project properties, click on Android and then change the Target Build Path to match the project you will be importing the library into.
Then just follow the instructions on the android dev webpage and then you should be able to reference the required files.
Working with library is a pain in android.
Photo view is not a jar library it is a referenced library. so you have to download the zip and import it inot ecllipse. Also if the library is built using Android Studio then you have to change folders to make it work. For eg the source code in Android Studio is in java folder while in ecllipse it is in src.

Eclipse/Java newbie: package not found now, but it was yesterday

I'll be involved in Java development for the first time. The application will be built on an set of Eclipse plug-ins and packages called UDOP. This set comes with tutorials, which I'm going through.
Yesterday things were fine, and in my example code I was able to import a certain package, and extend one of the classes it contains. When I started Eclipse today, a package in an import statement has a red line under it, with a hover-message telling me that the import cannot be resolved. The target platform is correct, and my dependencies match what the tutorial wants. I've run Update Classpath.
Details:
the import statement is
import com.tdkc.udop.extensionpoints.views.ViewPartBase;
The red squiggly line is under com.tdkc.udop.extensionpoints.
com.tdkc.udop is set as a dependency.
The Target Platform is .../UDOP_SDK,
and under that I can find the file .../UDOP_SDK/plugins/com.tdkc.udop_1.7.0/com/tdkc/udop/extensionpoints/views/ViewPartBase.class
com.tdkc.udop appears in the Package Explorer, and from within the P.E. I can navigate down and see ViewBasePart.class.
Although I'm new at Eclipse and Java, I do have moderate experience with c++ and Objective-C and Cocoa.
What are possible causes for an import not to be found? What should I check? Thanks.
If nothing has changed since the last time everything was peachy, it might just be a matter of doing a Project -> Clean and then selecting Clean all projects like so:
Finally, click on OK and Eclipse should clean out all the projects and build everything.
On the project in question (Left side of Eclipse in "Package Explorer"), right click on the project name and select "Build Path" > "Configure Build Path...".
On the left side, select "Java Build Path", then the tab "Libraries". From there, "Add JARs..." and point to the JAR file that contains your class. From there try and build/clean.
If that import statement is what you've used, the syntax is wrong. It should be:
import com.tdkc.udop.extensionpoints.views.ViewPartBase;
Move your cursor to the error line(com.tdkc.udop.extensionpoints. in your case) then Eclipse will show you the list from which you can get rid of that error. Scroll down find Fix Project Setup and then Eclipse will suggest jar files which can be added to solve dependency problem. add those dependency by clicking OK.
and error will disappear.

How to run the source code for com.android.browser?

I downloaded the source code from github.com for standard android browser:
https://github.com/android/platform_packages_apps_browser
I opened the project in Eclipse. It showed me a lot of mistakes, mostly related to not connected libraries, but there are errors related to the fact that the class is connected but the corresponding method that is invoked in the class doesnt. Incidentally, it should be noted that when opening the project through File -> New -> Android Project -> then put the tab Create project from existing source and selecting the column Location path to the source com.android.browser, it is not selected version of Android, under which the program is written in the graph Build Target and have it set itself, I tried to choose one by one all and still having the same error.
Here is a partial list of classes that are not found:
import android.net.WebAddress;
import android.app.DownloadManager;
import android.os.ServiceManager;
import android.text.IClipboard;
import android.os.ServiceManager;
import android.text.IClipboard;
import android.speech.RecognizerResultsIntent;
etc.
The same methods were not found or variables connected to the following classes:
Browser.getVisitedLike (cr, url)
Browser.BookmarkColumns.THUMBNAIL
Browser.HISTORY_PROJECTION_THUMBNAIL_INDEX
etc.
I tried to look for com.android.browser on other sites, everything that I found showed me the similar pattern. Can someone explain what the problem is, because all of the standard libraries and classes exist but the project is not created?
I tried to use the Hidden API, as shown on this page:
http://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/
downloaded from there the platform Hidden API, tried to compile them, some bugs got solved, but more than half the errors still remain.
Please help me figure out how to compile browser from the source code.
The browser project is designed to be built in the context of the entire Android Open Source Project framework. It will not build with just the client App SDK that you have installed.
If you wish to build this browser, you will need to download the complete Android OS project to provide the correct environment.
You may want to look for a different browser (such as Firefox) which is open source and is not so tightly integrated into the OS.

Categories

Resources