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

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.

Related

How to import apache.jena into Visual Studio Code?

I am getting started with Jena and semantic technologies (I am taking a class on the topic). The lecturer recommends using Eclipse as IDE, but I would like to use Visual Studio Code. How can I import apache.jena? I would like to get information/error messages as you would with any other library.
I have had amongst VSCode's extensions, but did not find any support.
I include "import org.apache.jena.rdf.model.;" and get a "not found" error when I try to compile - unless I also include "-cp "/path/to/apacha/jena/on/my/computer/:." when compiling and running the program.
The goal is to be able to compile and run without having to include a path to the library and if possible, for VSCode to have an understand of the library (giving me warnings, suggestions, error messages osv.)
Use Java in VSCODE. You need to install the Extension Pack for Java, and the documentation contains more information.
Use VSCode to open the Java project folder, expand the project structure and display it on the JAVA PROJECTS panel.
Click the plus icon next to Referenced Libraries to add a .jar file reference. Of course you need to download the Jena library on your machine first.
Or use the following configuration in setting to add reference.
"java.project.referencedLibraries": [
"/path/to/jena/lib/*.jar"
]

Cannot figure out error importing jme3 in eclipse

**UPDATE:
I closed and re-opened eclipse (which I've done before), and was presented with a new "quick fix" solution of moving the library to the module path (which it has been in before), and now I can reference it, but now
import com.jme3.app.SimpleApplication;
says
The package com.jme3.app is accessible from more than one module: jme3.core, jme3.desktop
my module-info now have warnings as well:
module-info.java:
module vast {
requires jme3.core; //Name of automatic module 'jme3.core' is unstable, it is derived from the module's file name.
requires jme3.desktop; //the same(ish)
requires jme3.lwjgl; // and so on
}
I'm going to fiddle around a bit and see what I can figure about those
**
So, I've decided to migrate one of my projects from LWJGL3 to JME3 (using Eclipse). I followed the advice of Setting up JME3 in Eclipse, specifically downloading the library, extracting it to a lib subfolder in my project, I then added the contents of the library to a User-Library (using Add JARs, since they are in my project), and added the library to my classpath. I know eclipse sees the library (code suggestions), but I keep getting access errors.
Setup:
Arch Linux (latest)
Eclipse IDE for Java Developers (2019-12 (4.14.0))
Here's the code (small test class to make sure it runs before I refactor):
Test.java:
package lab.stone.werlious.vast;
import com.jme3.app.SimpleApplication; //the type com.jme3.app.SimpleApplication is not accessible.
public class Test extends SimpleApplication { //SimpleApplication cannot be resolved to a type
}
module-info.java:
module vast {
requires jme3.core; // jme3.core cannot be resolved to a module
}
I've tried many different combinations of adding the library (modulepath, classpath, user library, external JARs, internal lib JARs), and referencing it. I keep getting errors, even though SimpleApplication suggests importing com.jme3.app.SimpleApplication, which suggests adding requires jme3.core to module-info.
I am not using maven or gradle (detest those), and prefer to do things locally. I also prefer eclipse over jme3 sdk. Can someone tell me how to properly import this library (without maven or gradle)? and how to properly import it in my code? I didn't have this issue adding LWJGL3 to eclipse before, and currently jme3 is added the same as lwjgl3 in my source project (jars in lib folder in project, lib folder added as user library, user library added to classpath).
Thank you all for your help
As a side note, because I'm sure someone will mention it, I've been on various forums for about 2 hours trying to figure this out, including stackexchange. I can't find a similar issue with a solution that works for me.

The import org.eclipse.ui.internal.ShowViewAction cannot be resolved

I can not figure out what I am missing solve this import error. I have org.eclipse.ui_3.107.0.v20150507-1945.jar included in my build path, but it does not seem to be what is required. I've tried including all the other org.eclipse.ui.* jar files in my build path but none seem to be resolving the import error. Does any one know what is needed for this?
I'm a relatively new java developer, but have run into the "The import * cannot be resolved" quite a bit and the only way I've found to fix it, if it can't be auto resolved with eclipse's quick fix, is to try and guess what jar needs to be added to the build path. Is there a more reliable method or is trial and error what it comes down to?
This is an internal class (the package name includes 'internal'). You should not be trying to use it. Internal classes are often created / changed / deleted without warning between Eclipse releases.
See Eclipse API Rules of Engagement for more information about the Eclipse API.
This particular action existed in Eclipse 3.x but is no longer present in Eclipse 4. The action essentially calls IWorkbenchPage.showView, you will have to write your own action to do the same.

I can't extend Form

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.

Idea + Play Framework - cannot resolve method/symbol

I use IntelliJ IDEA 12, Play 2.2.0, I have Scala plugin installed, Play 2.0 support plugin installed.
I created java play application via termina (play new). Andas you can see in this pictures I always get this error: "cannot resolve method ok()" or "cannot resolve symbol at"
http://sluchatka.kvalitne.cz/pics/1.png
http://sluchatka.kvalitne.cz/pics/2.png
I searched the web for this problem the whole day, but I didn't find solution.
Can you please help me?
The first problem (unable to resolve reference to template) is because your template probably has not been compiled by the moment (and thus IDEA does not see compiled template and can't resolve reference to it).
I usually develop Play apps having ~run command launched in Play console. So that any changes to templates are immediately compiled and changes detected by IDEA.
As for the second one it seems like a deficiency in Play IDEA plugin. It does not work seamlessly within templates I should say. Lots of glitches. The best way I found is to have ~run launched so that small problems are detected immediately.
According to intelliJ support it is better to import the command line created play 2 project using the IDE import project wizard instead.
File -> Import Project
Select play2 project location
Import as SBT project
This was due to the "play idea" command being outdated or not fully compatible with the current play 2 and scala plugins for intelliJ.
A bonus is that errors start to appear properly, we had trouble with that earlier.
I was having a similar issue with Play 2.4.2 and Intellij 14.1.4. I could run the basic "play-java" example/starter app in Intellij, even though the editor showed errors like "cannot resolve method ok()".
Here's what solves the problem for me:
Before starting, make sure your project is not open in Intellij.
Delete the ".idea" folder from your existing app, OR just create a new app using "activator new".
On the command line, cd to the app's folder and compile using "activator compile".
In Intellij, File -> Open, and select your app's folder. For the SBT import options, I left the boxes unchecked (e.g. "Use auto-import", "Create directories for empty content roots automatically", etc.) but I don't think it matters.
Once everything finishes loading, you shouldn't see the errors any more.
This click in the Project Structure is your answer.

Categories

Resources