Can not open draw9patch.bat normally - android

i installed the newest version of Android SDK,and use SDK Tool Revision 20.0.3, and then i double click the 'draw9patch.bat',i hope it can show me an UI,unfortunately, the bat file just run flashing past, does not show the UI. And then i try to double click 'hierarchyviewer.bat', the program doesn't show an UI either. I don't know why and i can get the ways to solve this problem from the Internet, so i turn to your guys for help.

Make sure you set environment path for java . Open command prompt and navigate to android-sdk\tools\lib folder and type java -jar draw9patch.jar press enter . now you could get see UI screen if no problem with this .jar file .

Probably, "find_java.bat" and it's associated crap exe are failing miserably at doing the one thing it's supposed to do. I don't know how it's supposed to work or why it's failing, and I don't really care. Java is installed and this exe is a failure - so purge the damn dependency and be done with it. Who knows, maybe find_java.exe is some damn NSA virus - never worked for me before (maybe it can't find 64-bit Java... worthless rubbish).
Ahem, yeah, anyway...
Go to draw9patch.bat and change these three lines:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
to this (use your Java path):
set java_exe=C:\Program Files\Java\jdk1.7.0_21\bin\java.exe
Then you should even be able to run draw9patch.bat with another bat file wherever you want to place it for convenience, by doing something like this inside the new bat:
call "C:\Program Files (x86)\Android\android-sdk\tools\draw9patch.bat"
No idea why this 'answer' wasn't here a year ago. Open a command prompt... please. :P

Related

Using arcoreimg from command line

I need to evaluate the image quality of several images using the arcoreimg tool to process a failed build in Unreal using blueprints.
I'm running on a Mac, but far more familiar with a PC. I've tried the following:
./arcoreimg eval-img --input_image_path=/Users/scull/Documents/Proj/Content/images/s_recog_turl.png
No such file or directory
I have located the ptdbtool_macos_lipobin tool in the ~Library and tried running it from there but to no avail:
/Users/Shared/Epic Games/UE_4.21/Engine/Plugins/Runtime/GoogleARCore/Binaries/ThirdParty/Google/ARCoreImg/Mac
Can anyone point out where I'm going wrong?
To my future self:
Use
./ptdbtool_macos_lipobin eval-img --input_image_path=/Users/scull/Documents/Proj/Content/images/s_recog_turl.png
Looks like someone at Android forgot to rename the executable to arcoreimg.

System can't find specifed path ndkbuild in android

I want to build an ocr app in android.For that i am using tessaract library.I am following this turorial ocr tutoial it says follow below steps
Download the NDK & extract to C:\ drive-Done
Set NDK Path & Android SDK path to PATH variable in Enviorment Variable.-Done
Download tessaract library and extract it to C:-Done
open command line & go inside tessract folder ibn downloaded library.-
Write ndk-build-Not Done
When i write ndk-build it says the system can't find the specified path.
Please tell me how to resolve this issue.I have already spent lot of hard time on this.
Thanks in advance.
If you re-read the link you posted, you may notice this line from the author:
Attention: if you fail at any of the above steps, you are not ready for this shit yet. Better grab an introduction to android development course, read a book, then come back to this tutorial. You’ll just waste time and nerves and you’ll bitch about it in the comments that this crash, this doesn’t work. (PS. no, I will not send you the source code on your email, stop spamming k thx.)
You should seriously consider his advice - working with the Android NDK only gets more difficult from here.
You're probably getting that error message because cmd couldn't find the ndk-build program, which is located inside the root of android-ndk-r10e. Possible causes:
You made an error when editing your PATH variable - make sure each file path is separated by a semicolon and that you provided the full path to your NDK install.
Your PATH is too long - the max length is 260 characters. See this page for more info. tl;dr: prefix \?\ to your PATH to get around this length limit.
You had cmd open when you set the variables - try restarting the cmd
program or even restarting your machine.

which adb.exe to chose?

Im having trouble getting adb to work, i keep getting ''adb' is not recognized as an internal or external command, operable program or batch file', I found out i need to set my system path so i tried to locate adb.exe
I found it in three folfder:
C:\Users\Sven\AppData\Local\Android\sdk\platform-tools
C:\Users\Sven\AppData\Local\Android\sdk1\platform-tools
C:\Users\Sven\AppData\Local\Android\sdk2\platform-tools
How do i know which one to add to PATH? the date created looks almost the same.
Doesn't make much difference..
You can use whichever you like..I would suggest- C:\Users\Sven\AppData\Local\Android\sdk2\platform-tools since this looks to to be latest if you go with "sdk2"

missing a command building android kernel

I have been trying to build an android kernel for a certain device, the Huawei Vitria, they finally uploaded their kernel source about 2 months ago so I try to build it the normal way which fails so I fix the main errors I see and get the kernel to build finally but, then I notice one error while building. I look into this file and see that they are using a weird way of building I think instead of the normal defconfigs, using a generic defconfig then a configuration file to configure their devices ontop of that(they've done this before but not to this extent), which leads me to think I'm missing a command to select the device config ontop of the defconfig to set up the drivers, but don't know what command was used.
So might there be a way to find out the command by looking at these two files
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product.pl
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product_id.pl
thanks
I'm not sure how much help this is, but the first command seems to want to be called with a parameter of a path to an XML file.
./parse_product.pl /ab/cd/hw_xxy_configs.xml
PRODUCT: xxy
reads: '/ab/cd/hw_xxy_configs.xml'
It pulls out some data from that file and pastes it into a .c file which presumably goes into the build configuration.
So, you're looking for an XML file containing your product-name.
The second file calls the first repeatedly to generate a set of .c files. Now - this second script takes an XML file as an argument, but I'm afraid I can't tell what it might be called. The file looks like it should contain product names and board-ids if that is any help.

Hunting a memory leak with Eclipse and Mat, stuck converting the hprof file

This seems to be a question asked many times. I'm using Eclipse to write an Android app, in OS X. So far, no problem, except the app crashes sometimes, and I want to see whats going on so I can fix the problem. (Its probably related to bitmaps or variables not recycling correctly. But I don't know where else to start to look into it.)
I used the DDMS tool (in eclipse) to create a dump file. Then I downloaded the MemoryAnalyzer application to open it. Here is where I have been stuck for an hour: I have to convert the file first because Eclipse writes the hprof file in a different format. How do I convert it?
The answers to this question, error openning HPROF file, directly address my question. The top answer is the same as the reference for the hprof-conv tool.
The hprof file you get from Android has android specific format. You should convert hprof >file take from Android OS into standard hprof format. For this you can use hprof-conv tool >that is located at AndrodiSDK/tools/hprof-conv.
For example:
hprof-conv android.hprof mat.hprof
And then open mat.hprof in Memory Analyzer.
I have a couple problems with this.
when I open the hprof-conv tool, it shows a handful of lines about it then says "[Process completed]". And there is no place to enter any text. The only relevant info on the screen is this:
Usage: hprof-conf infile outfile
I'm in Terminal, so I open "new command..." or tried using the shell thats also open. Then when I run "hprof-conv dump1.hprof dump1a.hprof" I get the error "command not found". So I think I'm off track. I also tried "hprof-conf", instead of "hprof-conv", the way it suggests in point 1. Same error. Also tried various paths to the file, no change.
if I was on the right track, how do I correctly point this command to the file location? I have it on my desktop, and its named dump1.hprof. I'm not very experienced with Terminal.
Thanks in advance for an answer, or perhaps another suggestion on how to hunt down a memory leak.
If you are on mac add a ./ before the command :
./hprof-conv infile.hprof outfile.hprof
Hello and sorry for a late response. I just went through exactly this problem and wrote some instructions here: http://spragucm.wordpress.com/2013/11/21/debugging-android-project-ddms-heap-dump-in-eclipse/
Method 1: Use the Standalone MAT
go into c:...\sdk-tools\tools and copy hprof-conv.exe
go to whatever folder you saved your dump1.hprof file and paste the .exe file
open a terminal and change directory to the folder with your dump and .exe file (e.g. if folder is c:\Users\YourName\DumpFolder then type cd c:\Users\YourName\DumpFolder)
When you're in the folder type the following in the command prompt and hit enter: hprof-conf infile.hprof outfile.hprof
NOTE: If you get an error about directory not found, you're not in the correct directory in the command prompt
The outfile.hprof file should be in the same folder as the other files.
Method 2: Using MAT in Eclipse
Install the plug-in for MAT in Eclipse
Select to get heap dump as before
Go to Window->Open Perspective->other->Memory Analysis
Look through your tabs for a window with a blue disk icon in top left and expand the tab (this will have some crazy name on it with a very long string of numbers)
Done...you are looking at the heap dump in Eclipse

Categories

Resources