Customised settings no longer marking errors and problems - android

Until yesterday I had no problem with android studio and it's worked fine but today I have some problems with it .
For example, in my code I write " Strng s; ", as you can see I have wrong spelled the String, and android studio not tell me that this line is wrong.
or by default when you write code and use some libraries like Log or Dialog, android studio automatically import the necessary lib files but mine, it doesn't include them and also it does not mark it and tells me that I need to include the library.
so It make the coding very hard and full of problems .
How can I solve these problems?

Go File -> Settings
If you go into Code Completion, Auto Import and PostFix Completion along with setting your Code Style settings you have a lot of flexibility in what you choose the ide to show you.
In terms of you losing your settings, a file may have been deleted or over written, it's hard to say, it's something you learn to keep track of with your ides. Make a note of which folder your settings are saved to.

Related

How to edit the lib2cpp.so file of a unity build inside my Android Project

A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!

Android Studio: "Optimize Imports..." and "Reformat Code..." order imports differently

We're using the Eclipse code formatter. Unfortunately the order of our Java imports changes depending on whether you run Optimize Imports... or Reformat Code... last. One of them is alphabetical, and one of them is different (seems to do Android first, then our packages, then other Java packages).
There are a couple of ways to workaround this by having developers set up their Android Studio preferences in the same way, e.g.
Set up a rule to reformat on save, e.g.
Intellij reformat on file save
Turn on Optimize imports on the fly
:
Is there a way to do this as part of code formatting templates, instead of with per-developer preferences?

Android studio does not create files

I added a new fragment to my project in Android studio like the way I did it a couple of times before, but now it says that this file das not exist (and is read only). I cannot edit a thing in it but also do not know how to correctly close it, so I can't use the name, which I really want...
I cannot find the file anywhere within my project and it is also not listed in the project+path (Name/App/src/main/...) but in the entire windows location (E:/...).
And how can I create a permanent file, or better, why does it not work any more?
This must be a fault on your side. Are you sure you are in the right folder? This is the only explanation I could think of. So you creat the files but outside of your project's folder, so you cannnot edit them or anything else, but read them...
Bene
Make sure that you have no LINT ERRORS.
For checking it:
Go to the bottom right side of Android Studio. Tap on "Gradle Console" tab.
If you have some errors(red text) - remove them and try again.

Modifying Android source code

I am absolutely new to Android. As a research curricular project, I want to make some changes in Android's activity manager's source code. I have downloaded the source code from here and built it for emulator. Now, to start with, I want to do some very simple things e.g. adding print statements to the module that I want to modify. This is just to make sure that my changes are actually showing effect. But how can I
See the changes I made. In this case, where can I see words/sentences printed by my print statements?
Even if I make such small change, do I need to build entire code base again using "make" command? Cant I just compile that particular class or file? I tried "mmm" and "mm" but they dont seem to be working. One says "nothing to build" even if I introduce syntax error and other says "no android.mk file found"
Can I add my own method to the ActivityManager class?
Thank you...

android - Same project cannot run well

I'm developing a simple application which uses Google maps API V2, it all works fine without problems where the map displayed yesterday. Today I uses the exactly the same project, the map cannot be displayed, only the plus and minus symbol.Other parts are all fine.
Besides, it's now getting some error on xml files when i try to change any code on it, such as "Incorrect line ending: found carriage return (\r) without corresponding newline (\n)" . It's totally work fine before this.
I'm still a beginner for all these.Maybe anything wrong with my Eclipse?
It does sound like more of an eclipse/line encoding problem then an android problem.
Try opening the file's properties and then under "Resources".
You should see on the right hand side a "Text file encoding" section.
Check that these settings make sense for your platform and project.
More generally speaking, you might also wish to check your eclipse preferences.
Goto: General -> Workspace
There should be a "Text file encoding" and "New Text file line delimiter" sections.
You will want to make sure these are appropriate so this problem doesn't come back
EDIT: After changing these settings you will want to rebuild the problem (aka. Project -> Clean) to make sure it all applied

Categories

Resources