Modify build in terminal command - android

I want to modify this build in terminal command of android
screenrecord
Is there a way to replace the command once I compiled it or do I have to compile a full custom android version
If it is possible to replace it how would I do this?

I don't think this is the correct site to all this question. However if you're on Ubuntu, take a look at http://packages.ubuntu.com/search?keywords=gcc-arm-linux-gnueabi

screenrecord uses non-public APIs, so you can't build it with the NDK. You need to have a full build tree to get the necessary headers and libraries. Once built, though, you should be able to run it on a device with the same version of Android (i.e. if you have a 4.4 tree, it should work on any 4.4 device), but that's not guaranteed.
Note that screenrecord has been updated from the version you linked; the Android 5.0 version is here.

Related

How to Use OpenCV Wait Key With Chaquopy

I am attempting to use Chaquopy to port a computer vision application to android. When I try to run my script the following error occurs on the following line:
cv2.waitKey(100)
The error which prints to the embedded python console is:
java.chaquopy.CQPEnv.check_exception
com.chaquo.python.PyException: error: OpenCV(3.4.2) /home/smith/git/chaquo/python/server/pypi/packages/opencv-python/build/3.4.2.16/cp36-cp36m-android_15_armeabi_v7a/src/opencv/modules/highgui/src/window.cpp:698: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'
I have installed openCV in the build gradle as follows:
pip {
install "opencv-python"
}
Which is according to the Chaquopy documentation found here:
Chaquopy openCV discussion
It looks like OpenCV only has support for key events on desktop platforms, not mobile ones. The same is probably true of all the other "High-level GUI" functions.
Anyway, unless your Android device actually has a keyboard, waiting for a keypress doesn't really make sense. You might be better off creating a simple Android UI like in the Chaquopy demo app, and interacting with the user that way.

AOSP: How to build /platform/frameworks/base or /platform/frameworks/support separately in Android Studio

Is there a way to build AOSP's /platform/frameworks/base package source or support library source separately in Android Studio.
I wanted to read the framework (base and support) code in Android Studio and since I didn't want to be bothered about the rest of the packages in AOSP, I only imported the mirrored repo of these two packages as two separate projects in Android Studio. I want to browse through the code by using "jump to source" shortcut (cmd/ctrl+click) of the IDE. But this handy feature won't simply work properly in Android Studio. When I try to jump to the method definition which belongs to a different java source file (It says - "Cannot find declaration to go to"). This limitation of source editor is due to gradle build failure. The project just won't build and throws the following error.
Error:You need a symlink in prebuilts/sdk/99 that points to
prebuilts/sdk/current.Without it, studio cannot understand current
SDK. ln -s ../../prebuilts/sdk/current ../../prebuilts/sdk/99
Is there a way to fix this. I know I can simply browse the source code on http://androidxref.com/ too, but it's not as convenient and powerful as your IDE.
This is possible (having Android Studio be able to show you the framework code and let you use the usual IDE tools), though compiling won't work.
But the detail in your question seems to indicate you don't actually care about compiling, just about viewing/editing.
The first steps listed here:
http://ronubo.blogspot.com/2016/01/debugging-aosp-platform-code-with.html
might work for you. Basically:
Build your AOSP platform
( . build/envsetup.sh && lunch - && make ...)
Create the Android Studio project for importing to
( mmm development/tools/idegen && development/tools/idegen/idegen.sh )
Import the project
( open android.ipr from Android Studio)
Not without a huge effort.
For very many reasons.Ex:
1.the framework depends on different HALs and libraries from system/bionic/external
2.Compiling the framework uses specific tools from linux(flex,bison,libgl etc..)
3.Framework is built using the Android.mk system and needs a lot of flags and compilation macros from build/
I also can't imagine a motivation to do what you are trying to do. If it's going to run on any device, bare in mind device manufacturers modify the framework heavily, even the small ones. Actually the chipset manufacturers modify it and give it to manufacturers that modify it even more.
Error:You need a symlink in prebuilts/sdk/99 that points to prebuilts/sdk/current.Without it, studio cannot understand current SDK. ln -s ../../prebuilts/sdk/current ../../prebuilts/sdk/99
This notice already tell you should run the command:
ln -s ../../prebuilts/sdk/current ../../prebuilts/sdk/99
To tell build system use 'current version sdk' in prebuilts/sdk/current directory replace the temp sdk version 99.
could you try it?

Is there a way to execute adb commands programatically in C++? This C++ part of code is built using ndk build in android studio. There

I referred to this link - Use CreateProcess to execute ADB command. The approach used in the above link requires Windows.h file which is contained in windows SDk. Since i am executing Android Studio in Mac i will not be able to get the include file. I am not sure whether the above mentioned approach can be performed using Android Studio in Mac.
You can use system or popen methods to start an adb process.

Where is atrace.c located?

I am trying to write a script to get frame rate data using systrace.
I know that systrace calls atrace. But I can't find out where atrace.c is located. Is it within the sdk or within the kernel? Either way it does not exist in msm kernel or the latest android sdk.
Google's git repo shows it is here
https://android.googlesource.com/platform/system/extras/+/android-sdk-support_r11/atrace/atrace.c
Yet I haven't cloned that repo.
So I am not sure where systrace is calling atrace from
the adb shell command that I am running is
$>atrace gfx
It's part of the platform code. The latest version is here. Note that it changed from .c to .cpp.

Trying to run simple monkeyrunner python script, 'importerror no module named os'

I have the android emulator/SDK installed on my computer, and I'm trying to run a simple python script, but it fails on the 'import os' line (which should be standard!)
Here's my script:
import os
print os.environ['PATH']
works fine when I run it against the actual python executable as
python test.py
but when I do
monkeyrunner.bat test.py
I get the error listed in the title of this question. I've uninstalled/reinstalled python several times, with no luck. Tried adding a PYTHONPATH ENV varaible, no luck. Set the python install dir to be in the PATH ENV variable. Kind of at my wits end, I think monkeyrunner runs on jython but I don't know if I can manage the jython install that comes with the SDK
The issue is that the latest versions of the Android SDK include jython-2.5.3 which do not have the os and other importable libraries built in. I found an old copy of the SDK and used the old JAR which appears to have that embedded in it those libraries.
The solution of this problem (and the problem itself explained) can be found at http://dtmilano.blogspot.ca/2013/05/monkeyrunner-importerror-no-module.html.
Basically, you have to replace jython-2.5.3.jar by jython-standalone-2.5.3.jar, at least until Android SDK Tools Rev. 22.0.1 is out.
all by itself in the jython interpreter
If you're using the jython packaged with the Android SDK, it doesn't include an 'os' module by default. You'll need to grab one, and put it in there, or use another interpreter.
I resolved this issue with java 1.7.0_21.

Categories

Resources