Import doesn't work. Android Studio, SDK, Linux - java

I have two example imports.
import android.os.MessageQueue;
import android.os.PerformanceCollector;
Both files, after tracking them down, is in Android/Sdk/sources/android-19/android/os. MessageQueue.java and PerformanceCollector.java.
In my Android Studio->Project Structure->SDK Location, Android/Sdk is marked.
MessageQueue works. PerformanceCollector gives "Cannot resolve symbol 'PerformanceCollector'".
Cleaning/invalidating caches/restarting/reimporting did not work. Can someone suggest what might be the cause of this? It would be appreciated.

I don't know why I didn't find the PerformanceCollector class in Android Documentation
but you can use this code. Just create a new class in your application
PerformceCollector Source code

pskink was correct. The reason I was seeing an error was because the class "PerformanceCollector" was hidden by {#hide}. However, having done further research from there I have found that this isn't an issue at all.
How can Android project compile when imported class is missing in SDK?
- From reading the answer to this question, I have found that the error will not appear when running the application at runtime, so the fatal error I am getting has nothing to do with the issue I asked this question about. It was unrelated, as I now know what the real cause was.
So, pskink answered with a comment and not a proper answer, so I can't mark him/her as being correct. So, this will do. Thank you all who've read my question and so on.

Related

I can't find a solution for "The type org.newdawn.slick.opengl.Texture is not accessible"

I'm trying to learn how to make a 3d game engine in java following the tutorials from ThinMatrix (loving them so far). The problem is that one of the libraries from slick-utils seems to be missing? or corrupted? or not supported? I don't really know and I'm a total begginer in LWJGL, OpenGL and big java projects. I searched the error and nothing seems to work or the solutions are too problem specific, ie. related to an error in the coding rather than in the libraries.
There's not much code to show, I add the import in the class and the IDE prompts me with the error on the title: "The type org.newdawn.slick.opengl.Texture is not accessible".
On the comments of the video there was a "solution" that seems to have worked for at least 5 people, but for some reason it doesn't work for me.
The problem in the solution code (that avoids using slick-utils) is that there's a MemoryStack class that I can't seem to find anywhere, I serached the text that the IDE prompts me but it was fruitless...
This is what I searched for: "MemoryStack cannot be resolved", and for the life of me I can't find how to import, resolve, or do anything, really.
I'm really frustrated and google isn't my friend today, it seems.
I think there may be a problem with the LWJGL libraries that I'm using (I don't remember if I'm using LWJGL2 or 3, I believe 2 because the tutorials are from 2014 and 3 didn't exist yet? Idk), but I can't figure out what's the problem and all the hints that the IDE trows at me are leading me to flat out dead ends.
Thanks so much for reading, and helping me if you can! I can show the code but I don't think it matters that much, as the problem seems to come from the slick-utils library being corrupted or something, or that I don't understand how to add it properly to my project.
This should be the minimum reproducible example:
import org.newdawn.slick.opengl.Texture;
This is the first question I make so feel free to tell me if I'm missing something or whatever! :)
It's often the case that googling specific parts of a new error message will find other people who have had the same problem. When I google that class name, I find someone who had the exact same problem that you did, many years ago. The thread shows where to find the library which has that class.
https://gamedev.stackexchange.com/questions/35047/where-can-i-find-the-library-for-org-newdawn-slick-opengl-texture

android eclipse using method HdxUtil.GetPrinterPort

I'm new here.
I need help, right now I'm coding for android and involved in 'have to connect to printer' thing.
I already import the HdxUtil library, but I don't seem to found method HdxUtil.GetPrinterPort();
does anyone ever see this problem or familiar with it?
thank you

net beans Modules can't start

So I downloaded net beans C and C++ pack, and when I first opened it, it showed this warning message:
It works, but I want to fix this problem because it might do some problems in bigger programs I will create.
I have also tried to go to the link that was in the warning message that I posted here, but I really did not understand anything in there so it didn't help at all.
So if anyone knows what the problem is, and how to fix it, please tell me.

Error while implementing Google Play Games

I am getting an error on an import statement that I am using in order to try and implement Play Games with my app.
-The import com.google.android.gms.games.GamesClient cannot be resolved
I have BaseGameUtils referecncing google-play-services_lib, and my project references BaseGameUtils as a library.
It's my understanding that GameClient was to have been deprecated as of February 7, 2014 but when looking at Google's sample code (e.g. ButtonClicker) it still uses this import and some of the method calls from the import.
I got the code I am using from Google's GitHub sample app repository for the ButtonClicker2000, some of that code has been recycled and used in the program I'm having errors with as well.
This is all the info I can think to provide, if anything more would help please let me know.
I was struggling with the ButtonClicker2000 example for a couple days and I was having the same problem as yours.
I think the problem in the sample code is having some lines being not updated. If you look at that page, you can easily see that the updated versions of those lines are lying there. However the codes in GitHub page are not updated completely.
Because GamesClient class is removed permanently, those statements
GamesClient.EXTRA_PLAYERS
GamesClient.EXTRA_MIN_AUTOMATCH_PLAYERS
GamesClient.EXTRA_MAX_AUTOMATCH_PLAYERS
GamesClient.EXTRA_INVITATION
GamesClient.STATUS_OK
must be replaced with
Games.EXTRA_PLAYERS_IDS
Multiplayer.EXTRA_MIN_AUTOMATCH_PLAYERS
Multiplayer.EXTRA_MAX_AUTOMATCH_PLAYERS
Multiplayer.EXTRA_INVITATION
GamesStatusCodes.STATUS_OK
Also that line can be removed:
import com.google.android.gms.games.GamesClient;
There is no need for importing GoogleApiClient because it is already imported in GameHelper.java.
After changing these lines manually and importing Multiplayer and GamesStatusCodes classes, I was successful to compile the code. I hope that solves your problem as well.

Issue with eclipse; a java null error that I cannot solve

Okay so here's the jiff of it, I was changing the android API in the Android Manifest and the Android Manifest from the "bin" folder. I changed the API from 10 to 12 manually by removing the 0 and adding a 2. Now, when I go to save the project its giving me this error found in the image:
This is incredibly and extremely annoying not being able to find the problem. Yes, I am aware that there are other questions with this matter but I can't find anything that is useful/fixing my problem so I'm asking for help here. If anyone could help me fix my problem that would be beyond awesome! Also, if needed I can put some code. Something to take note is that there aren't any errors coming up in the LogCat but just this annoying pop-up.

Categories