I'm trying to integrate Google Sign-in into my app, and I'm following this tutorial. However, I'm trying to add the configuration file to my project, and the tutorial says that I should use this command:
$ move path-to-download/google-services.json app/
When I open the terminal in Android Studio and write the command it says:
'$' is not recognized as an internal or external command
I've also noticed that it's similar to Command prompt (I'm using Windows). Can I just copy the .json file and paste it in my app folder?
I believe $ (dollar sign) is indicating a start of new line in Unix based OS terminal. In Windows OS, the command should be
MOVE [Source] [Target]
For more information, check this link.
Or you can just copy and paste it in your app folder. That will be suffice as well as.
'$' is the user prompt, You should omit the '$' and the command should work
Related
I have made a bash file which makes a code command similar to that of VS code's code command.
I want to launch the SPCK editor to the specific project folder I want instead of opening the app from start. I want to know the activity class name or something like that for it. Can anyone help?
Try inputting cd storage/shared/android/data/io.spck/files in your termux terminal or if you had installed the spck editor in another space disk use the termux-setup-storage to select the storage and run the first command. Then to select your project's name cd projectName. You can now call your preferred command to install packages into the selected project file, you can input ls to see the whole spck files.
I am developing an application using ionic framework.
The app creates files (*.json) and stores them in /data/user/0/ when i verify whether they exist or not, the result was true which means the files exist in the mentioned directory and I can access and modify their content without problem, but when I check the directory with a file manager or from the computer, no result, the directory is empty.
Could someone tell me what should I do?
use adb to copy the file. Even if it's in root dir, u should have access to it via adb.
Do adb pull data/user/0/filename.json path_on_ur_comp.json.
this will copy the file to the directory you define in the 2nd parameter.
// EDIT:
adb is part of the Android SDK, stands for Android Debug Bridge.
You can use this for MANY MANY different reason but of course, the "main" reason is to debug Android devices. You can use it to transfer files in your case.
In Windows, it's located here:
C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools\adb
In Mac, it's lcoated here:
/Users/USERNAME/Library/Android/sdk/platform-tools/adb
Depending on which OS you use, open that either with Terminal (Mac) or Command Prompt (Windows).
Once you do that, run the following command:
For Mac:
adb pull data/user/0/filename.json /Users/USERNAME/Desktop/somefile.json
For Windows:
adb pull data/user/0/filename.json c:\Users\USERNAME\Desktop\somefile.json
This will copy the file and put it on your desktop
I have a C command line executable that I have successfully compiled for Android. I can copy the executable and launch it with Android Terminal Emulator on my Android ICS phone by doing the following:
execute "export TERMINFO=/etc/terminfo"
execute "mount -o remount rw /sdcard"
launch the executable from the sdcard
Step one is necessary because the command line application makes use of the ncurses library and if i do not set TERMINFO then I get an error when I try launch the application. If I leave off the second step then I get an "Access denied" when I try launch the command line application from the sdcard. So, provided I manually do these steps I can launch the command line executable.
Now what I am wanting to do is to wrap this command line executable inside a standard Android application. The source for Android Terminal Emulator is open source and so I can use that to open an EmulatorView inside my Android application. My question though is how do I go about including the native executable inside the apk, deploying it to the device in a location where my application will have rights to execute it in the EmulatorView. I am a bit concerned about whether I will be able to get over the rights issue so that the native command line executable can be launched.
I do know about the Android NDK, but would prefer not to have to re-write a working command line application so that it can be included as a library. I am specifically looking at keeping the C executable source as it is and executing it from the wrapper application. Does anyone know whether this is possible and if so how I would go about doing it?
If you copied the native file under your data folder where you should have appropriate permission, and then use Runtime.exec to execute your file.
You can create a bin folder (or any name) and copy your file under
Process exeProcess =
Runtime.getRuntime().exec("/data/data/YOUR_PACKAGE/bin/EXECUTABLE_FILE");
You can use the object exeProcess to read the data from your executable file.
I am trying to familiarise myself with using adb from the command prompt.
My adb.exe is installed at:
C:\Program Files(x86)\Android\android-sdk\platform-tools
I have tried starting off by typing in cd:C\ to take me to the C drive
Then I have typed in the path quoted above, sometimes putting Program Files(x86) in quote marks,
other times inserting % in between Program and Files.
But always I get the same answer - "The system cannot find the path specified".
Even when I type the path and then put in “adb devices” I get nothing.
I have tried inserting each of the following in the path in system variables as follows:
;C:\"Program Files(x86)"\Android\android-sdk\platform-tools\
C:\"Program Files(x86)"\Android\android-sdk\platform-tools\
;C:\Program Files(x86)\Android\android-sdk\platform-tools
And then typing “adb devices”.
The message is the same – “adb is not recognised as an internal or external command, operable program or batch command.
You can call adb directly from the directory you are currently in: "C:\Program Files(x86)\Android\android-sdk\platform-tools\adb.exe" (With quotes!) You can also navigate to the platform-tools directory and then call adb.exe, use cd .. to go to a directory level up, you can hit TAB to let windows list the appropriate directories, this works also if one or more characters are entered.
Btw, just added "C:\Program Files\Android\android-sdk\platform-tools" to my PATH and it works just fine! Separate the entires with a semicolon.
for using a 64 bit os try going step by step,
type in command prompt
cd "C:\Program Files (x86)"
you will enter C:\Program Files (x86)directory
then type
cd Android\android-sdk\platform-tools
It's the spaces that are messing people up. Windows users need to remember one important thing when dealing with command lines: do not install the utilities to folders where there's a space in the folder name - it will save you a lot of hassle which sometimes can't even be solved by using quotes.
For example, I've installed the Android SDK to C:\Android\android-sdk-windows
To open a command prompt, I have a shortcut to ("target") C:\Windows\System32\cmd.exe
And the "Start in" path is C:\Android\android-sdk-windows\platform-tools
now all I do is double-click the shortcut and I can dive right in to ADB
I am newb To Android.I just to check out few applications in my Desktop and have downloaded some sample applications. However, they are in the format .apk.
Please let me know the procedure to import this file into Eclipse which helps me to run the application.
Regards,
Serenity.
If you want to test the downloaded *.apk try installing it in the emulator. Copy the APK file into platform-tools directory, navigate to platform-tools directory. Execute
adb install filename.apk
If you want to view the source code of the *.apk. Try this link How to View the Source Code of an Android *.apk
If you wanna run the application you don't have to import it into Eclipse but instead you have to install it on your phone.
If you wanna see the source code of the apk file, you need a decompiler. There are some available in the Internet, however, all of them I have seen doesn't work 100% (e.g. they can extract the resources but not the *.java files, and so on)...
But you have to note that using decompilers could not be legal in some cases
You cannot "import" them to Eclipse as they are binary files. But, you can test the applications using the Android Virtual Device:
http://developer.android.com/guide/developing/tools/avd.html
In order to use it you will have to install the Android SDK and configure a Virtual Device:
http://developer.android.com/sdk/index.html
Once you have installed and configured the virtual device, you just have to install you aplications using the adb tool:
adb install applicacion.apk
Also, if you are using WinRAR or other zipping programmes, right click on the .apk file with your mouse and open with winrar/winzip/e.t.c. then surf to the .xml files then edit them via notepad easily.
If adb complains you have multiple devices, do
adb devices
Notice the serial number of the one you want, and then
adb -s SERIAL -r filename.apk
File -> Import -> Android Code into Workspace -> (Select Root Directory (folder) of the Application you are importing) -> Check the (Copy projects into workspace [checkbox]) -> Click Finish [En Twitter puedes preguntar][DS]
If you want to test the downloaded *.apk in the Emulator --> install it in the emulator.
How to install .apk file into Emulator?
Ans: Copy the *.apk file into SDK->platform-tools directory (where you'll find adb.exe file),
navigate to that directory through command line on your windows PC.
And then Execute:-
adb install filename.apk
If you want to view the source code of the *.apk.
Try this link How to View the Source Code of an Android *.apk
Compress .apk with winrar, open it in winrar and click on apk file. It will show the content just click on extract. Now you have a complete directory structure of a source file. Try to repeat the import steps as suggested above.