How to translate Java import to C# using statement - java

I'm building an Android app in Xamarin.Android. In Java terms, I need to import android.support.design.widget.CoordinatorLayout;. How can I do this with a C# using statement?
Xamarin intellisense won't let me go past using Android.Support. When I add .Design it tells me the using directive is unnecessary, and throws build errors.
Can you please help me?

It sounds like you're missing a component. Try including the Android Design Support Library component, I think it'll fix your problem.
If that doesn't work, try the steps listed in this question.

Double click on your packages folder inside your Xamarin Android project. The NuGet package search window will appear. In the search field (top right corner) type "Xamarin.Android.support.design". Select the package from Xamarin Inc.
Also helpful might be Xamarin.Android.Support.Contraint.Layout and Xamarin.Android.Support.Contraint.Layout.Solver. These are pre-release packages so you need to check the "Show pre-release packages" checkbox.

Use using Android.Support.Design.Widget; and make sure you're using the Xamarin.Android.Support.Design package from NuGet.

Related

Eclipse external java library treated as "package only containing non Java resources"

An external java library is treated as "package only containing non Java resources" (as indicated by the white icons as opposed to brown; the description in quotes is taken from here). When I try to import the library it cannot be resolved, so it seems it really isn't being recognised (in other words it's not just a case of eclipse showing wrong icon).
Two people have commented that my screenshots are not helping, so let me explain the intention behind them. The first one above is to show the difference between how my libraries are displayed. Htmlparser is a folder with .java files just like SPMF and works fine. Commons-lang and vecmath are .jars. SPMF cannot be resolved when I try to import it. The reason the screenshot is cropped this way is to highlight that all of the folders in SPMF are showing white which apparently means they are not recognized.
This is only the second time I'm using an external library, but I think I did everything the same as the first time.
This screenshot is intended to show how SPMF is added at the moment.
The library I am trying to add is SPMF - more specifically the Hierarchical Clustering algorithm. This is only a minor component of SPMF but it's the best Hierarchical Clustering solution I could find. It works fine if I just import it into a new project. So I could just bodge it by moving my code into that project if I can't get it going otherwise.
I presume that if a package can form a standalone project then it can also be used as an external library - or am I wrong?
I'm sure it's a stupid mistake I'm making but I've had no luck with google. This is the nearest I could find; Refresh seems the only applicable solution and it doesn't help.
Edit, SPMF is also available as a jar, it's missing some features but not the ones I need. I've been able to add the jar and the import the algorithm I need. It's enough of a workaround for me to move on and keep going. But it's not a solution and the question remains open.

Suggest code corrections in Idea

I've recently moved from Eclipse to Intellij IDEA for java development,
I have some code as shown in the screenshot, and as you can see there is no package called test2, Eclipse used to give suggestion if I want to create/move such a package, what is the IDEA equivalent shortcut for that option ?
Context specific actions can be brought up by alt+enter while having your cursor on the underlined part.
May I also suggest ctrl+shift+a. This brings up a search field for all kinds of menu items and settings.
Edit
Two more tips I always give IntelliJ newcomers:
Regularily check out Help/Productivity Guide. It tells you which features you don't use yet.
Install the Key promoter plugin. It tells you which shortcuts you could have used when you use an IntelliJ-Feature.

Netbeans refuses to auto suggest known classes for imports

I just discovered that my NetBeans suddenly stops importing classes that are found in the Java API but can still import classes from my external libraries. Take a look at the image below:
As you can see, List and ArrayList are classes from the java.util package but the usual suggestions for importing them are not shown here, instead it is asking me to create class. I know that I can type import java.util.List; on the top of the code but life was better before! Please I need help thanks.
I had the same problem a couple minutes ago... Terrible. The same problem has been reported here:
Bug 235712
The solution which I've found there was sufficient - simply delete the Netbeans cache...
In order to do this, go to Help ==> About . Then go to the directory with cache and delete all you find in the "index" catalog.
After restarting the NB, everything was cool.
Today I came across the same problem. It happens that it actually is very easy to exclude a class from code completion if you click in the wrong place while working.
To solve it (netbeans 8.2) go to
Tools - Options -> Editor tab
Then select Code Completion Tab
In the drop Down select JAVA (in my case it was Java)
You will find a box bellow titled Package/Classes
In the EXCLUDE tab you probably will find the packages marked to be excluded from code completion. Just remove the ones you want back.
Check under Preferences->Editor->Code Completion to make sure auto complete is on, though by your screen shot I assume that it is.
Also try Preferences->Editor->Formatting and set your Language to Java
In my case, NetBeans was refusing to suggest Scanner. As it turned out, all I had to do was remove java.util.Scanner from Options » Editor » Code Completion » Packages/classes: » Exclude. Then the autocompletion for Scanner returned.

Where can I find "Device" file to add to EclipseME java project?

I installed JavaME and EclipseME, and I'm trying to make a Hello World to my Nokia5530. But the imports are not working.
This page says that I need a "Device" file, but I don't know where to find it.. any idea?
Since it appears no on else is helping with this, I will start an answer, and put in my last comment into here.
OK, you need to install the Nokia SDK and then import it, as explained here, though your phone may not be series 60, you will need to d/l and then import the appropriate nokia sdk version: http://wiki.forum.nokia.com/index.php/Installing_Java_ME_development_tools_for_S60#Configuring_EclipseME
I haven't tried the suggestions here as I primarily develop on Windows at the moment, but the idea of using wine to install the SDK, and then move the files to an appropriate place on Linux sounds like a reasonable suggestion. I don't know if the suggestion below of compiling it yourself would be useful, but, there were some suggestions in the link below that may help you solve this particular problem.
http://www.wirelessforums.org/alt-cellular-nokia/nokia-sdk-linux-8895.html

Can I directly use Java source code directly in SCILAB, or Is there another way to connect both?

a friend of mine uses SCILAB for doing his mathematicall "homework" for his studies and he told me, that it should be possible to use Java source code diretly in SCILAB.
The background is that I presented my current Java project and I would like to plot this in 3D, but I haven't done graphical output so far. And he proposed to let SCILAB do the 3D plotting, because there are some ready to use plot scemes implented. But he couldn't tell me how to achive this, so that's why I'm here :).
So my first question is, if this is possible to directly use Java source code in SCILAB or at least to some kind of connection between both?
And how this is done! :)
Thank you in advance,
Andreas
in Netbeans first create a java project.
then go to properties of the project you have created and go to libraries..
in libraries "add jar"
now go to the scilab installed directory
scilab-->modules-->javasci-->jar
in that there will be jar file names javasci.jar
add this to library..
and you are done.
now go to your main file and check out import javasci.*;
and in main function
Scilab.exec("plot2d(1,3)");
you can see a scilab window
at least I found this http://www.scilab.org/product/man/compile_and_run_javasci.html
so it is possible, but I have some problems to get this to work in netbens and eclipse.
has anyone done this before?

Categories