Moving the default folders(.AndroidStudio2.X and .gradle ) to D disk: - android

I want to move Installed AndroidStudio from C: disk to another.
I've successfully(by standard way) .android folder, sdk folder(with it's environment variable) and installation path. However, I cant handle these ones:
c:\users\user\.AndroidStudio2.2
c:\users\user\.gradle
when I move these folders to d:\myfolder and changing every occurrence of c:\users\user\.AndroidStudio2.2 to d:\myfolder\.AndroidStudio2.2 (with TextCrawler), and changing .gradle location in AndroidStudio, it doesnt help.
In C:\user\user there is still created (upon running AStudio) .AndroidStudio2.2 folder. And running Emulator causes errors, because it cant find anything options in C:\users......
plus, I have uncommented and set the path values (in installation/bin/idea.properties) to d:\myfolder, but still no help.

Having dome something similar in the past, I find that moving drives on most software applications is still a big pain. However, I found that creating symlinks was helpful, as the software will "think" it's accessing the files at a location, but in reality they are stored in another.
I successfully did this in the past with Visual Studio and the concept is pretty much the same with Android Studio. You need to create a symlink as follows:
mklink /J "d:\myfolder\.AndroidStudio2.2" "c:\users\user\.AndroidStudio2.2"
Now when Android studio read or write the contents in c:\users\user\.AndroidStudio2.2, it will be in reality going to your d drive, which provided that it's accessible by the c drive, should make it all work.
You should be able to do that with the other folders as well. The benefit of doing it this way is that you're not constrained to the path the file is stored, which means that if you change computers or decide to store everything on the c drive again, you can just remove the symlink.
Hope this helps you.

Related

Error in path updating android sdk components

A few days ago I decided to change the Windows 10 username, unfortunately I discovered after that that there was a bug that left the user without access on some computers. After I managed to access the computer I created a new user (in addition to the adm). However, Android Studio is downloading to an old user folder (pictured: Ronaldo, which no longer exists). In Android Studio the configuration of the SDK folder is right, it even shows all the previous packages installed, but to update it always tries in the old folder. I have already deleted all known folders (in appdata/local/roaming and others), looked at the windows registry, reinstalled Android Studio and nothing. Always the same problem.
All possible solutions I found were in the sense of access permissions, setting the location of the sdk directory, but nothing like that.
Thank you.
enter image description here
Start Regedit.exe, go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio and make sure that the SdkPath and UserSettingsPath values are pointing to the new user profile, and not C:\Users\Ronaldo (SdkPath can be empty)
Also worth looking in the file(s) in %userprofile%\.android\studio\installer

Android: viewing files from Windows explorer

I have just made an application that uses a SQLite database, and I finally managed to export the database file onto the computer without having to root the Android device. The method I am using is mostly from code I found on various Stack Overflow question/answers. I am basically saving the database file to the public Download folder.
When I look on the Android device using a file explorer, I can see the correct SQLite file in the correct folder (Download folder). However, when I open up the same folder in Windows Explorer from my PC, I can not see the file in the exact same folder.
Now here is the strangest part: When I copy or move the file (using the Android device), even if I am copying and/or moving the file TO THE EXACT SAME SPOT, as soon as I have finished doing this the file instantly becomes visible in Windows Explorer.
I do not want the user to have to do this manually every time, so does anyone know of any way to make sure that the file will be visible right away? Thank you in advance!
Things I have tried so far:
Show hidden files and folders in Windows Explorer
Programmatically moving the file to a new folder within the application itself (the move to the new folder works, but the file still remains invisible in Windows Explorer until manually moving/copying the file again)
Searched StackOverflow for similar issues and have been unsuccessful.
And if anyone wants to see some of my code, let me know and I will post it, but I am thinking that this is less to do with my code and more to do with Android/Windows interaction. And this is where I got my move folder function from: stackoverflow.com/questions/4178168/how-to-programmatically-move-copy-and-delete-files-and-directories-on-sd
Thank you!
I had a similar issue and it was not visible in Windows because I hadn't given it a file extension.
Give it a file extension if you haven't already.

Is there a way to add such folder in Android project that do no get compiled up to **apk**

I was looking for a way to add some such folder in my Android Project that do no get compiled up to my apk file.
Why I need it :-
We need to maintain proper documentation for project (that actually
everybody needs to ;) nothing new),
but I find it very irritating to look out for that documentation
folder again and again.
.
I am open for any way i can make dcocumentain folder easily one
click accessible (I am already doing it thru taskbar sortcut. ) But
I want it to get the ease of version control thru Eclipse likewise we
do it for our project
IDE :- Eclipse
I got a way myself :-
I had an idea that if I create a folder in my application project with
some anonymous name that actually android has not listed in its
directories ("I am talking about the default one like "res", "src",
"anim"......)
Then either it should "raise an error" or should "ignore" it while compiling to form apk file
luckily it ignores any such folder. now i can put all the documentation in my project.
NOTE:-
My answer empirically driven
I had tested it by creating a "Docs" folder and then copied 1 GB of
random data (includes almost all type of files we came across from
multimedia to zipped ones).
Then I build the apk and the size of the apk was in-effective of all
this..
but when i copied the same data to assets it was showing a huge change
in size of my apk file..
Consider using Javadoc in addition or, if possible, instead of any other documentation.

Android jni lib not found when moving app to system app

I've been not able to solve my problem, I look around and I couldn't find a good solution.
The things is that I have an Android app that must be system app. I have my own devices so I'm able to install them on system app.
I'm doing this using a pre-installed app on system app. This app takes the .apk file from assets save it on the data/data and the move it to system/app/ folder.
Everything goes good, except when I launch it, it gets an exception java.lang.ExceptionInInitializerError, this means that the jni lib is not found. Probably because it has not been installed in the /system/lib directory.
Anyone know how can I solve this?
I know one solution is to look for the jni lib in the system and move it to system/lib but I would like to avoid this.
thank you.

Trouble adding raw resource

I'm walking through a small example to hit https web services. It requires building a keystore and placing the resulting bks file into the /res/raw directory. Simple enough. However, I can not access the file through R.raw...
I placed the file into the /res/raw directory, refreshed my project in Eclipse, navigated to the /res/raw directory in Eclipse and confirmed that it showed up in the project. However, when I type R.raw. in my file, the resulting list of possible filenames is empty.
I've tried cleaning and rebuilding, but the project still has no clue what R.raw.mycert is.
What am I doing wrong?
The answer to this question can be found here:
R.raw.anything cannot be resolved
When Eclispe is starting to behave weirdly, my last trick is to remove the project from the workspace and add it again... Try also to quit and restart eclispe
Good luck!
Try this -- find your EclipseWorkspace.
There should be a 'res' directory. So open it.
You will likely NOT find a 'raw' subdirectory.
So create a 'raw' directory, and drop your file into it. (I suppose these have to follow the rwx permissions under Linux that the others follow. I did this in Windows.)
Close the project, then open it again. See if 'res.raw.yourfile' shows up in the package explorer (it should).
I also discovered that 'R.raw.yourfile' is now noticed, and you should find an entry in 'gen/*/R.java' for this.
I think there's a bug in the gen compiler, or maybe Eclipse configuration. gen seems to be very picky about just what kind of resource it wants to look at, and is also doing some name mashing. For example, R.string.xxx finds a string by name xxx, even though the string resources are under 'res.values.string.xml'. So there's clearly a lot of magic going on, maybe special kludges known only to the gods in Mountain View.
Why this fix broke it loose I have no idea.

Categories

Resources