[Q] How to compile a specific file to solve bluetooth problems? - Nexus 5 Q&A, Help & Troubleshooting

My Nexus has problems connecting over bluetooth to my Car (BMW). I've found a lot of references to similair problems, and also a hint which suggests a change that could solve the problem. The hint can be found on the cyanogem forum in posting 77834, "bluetooth-connection-drops-kar-kit-bmw" (I cannot post links here).
I am running stock KitKat, and for the moment want to keep it that way. So, I decided to try the same patch on KitKat. I've managed to setup a development image in a VM, but keep running into problems compiling - my machine lacks resources (diskspace) to complete a complete build. I do not need a complete build; I need just 1 file, bluetooth.default.so, compiled. My development skills are VERY rusty, and I cannot find out how to build only this file.
I've applied the patch to external/bluetooth/bluedroid/bta/ag/bta_ag_sdp.c, run a make on the Makefile here etc - but, still no luck. The most frustrating bit is that I'm sure this is trivial, but it has been such a long time since I did any development work that I cannot seem to find a way to compile.
Can someone help me out here with hints on how to build the .so? I need bluetoot.default.so, build from the files in the external/.../ag directory, to be situated in system/lib/hw on the android system.

Related

Recompile and overwrite applications in system/app

As an experiment I am trying to rebuild some standard android applications and replace them in system/app on the G1. I have been through all the steps to get the source code and build for the dream platform and have built the various .apk files of interest (e.g. AlarmClock.apk, Browser.apk etc)
To put the files on the device I delete the old .apk and .odex files and copy my newly built .apk file on to the device. However when I try to run the application it crashes with the following message.
The application Alarm Clock (process com.android.alarmclock) has stopped unexpectedly. Please try again.
I know that replacing the applications like this is possible, because the AutoRotating Browser build works fine when copies over in this manner.
I'm using JF1.31 (RC8)
My initial reaction was that I was not signing the applications properly but having read some posts I think the default built .apk should have the right key already in it.
Another theory I have is that perhaps the applications from the head of the source tree are not compatible with the RC8 (or RC30) Android OS releases. Can anyone tell me how to get the source tree which corresponds to this baseline, I've done some reading around but cannot figure it out. I presume I need to do a repo init -u git://android.git.kernel.org/platofrm/manifest.git -b BASELINE but I can't figure out what BASELINE should be.
Many thanks in advance for any help you can give me!!!
There are some branches in android sources:
master
cupcake
release-1.0
Apps from the first two will not run on default G1, you need to reinstall a whole system. I think by default, following google docs you'll get master. So you need to download a release-1.0 sources.
I may be wrong, but that is what I'm see from my experience.
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
I was also trying to recompile some of the built-in apps, specifically the browser, but I can't even get it to build. I get a bunch of import errors, stating that it can't find some of the android libraries, such as android.net.http.AndroidHttpClient, android.os.AsyncTask, etc. I've got the android.jar from the SDK in my build path, and it finds some of them, such as android.webkit.URLUtil.
Can anyone shed some light on what I need to do to get it to see the missing libraries? Thanks.
UndeadCretin said:
Thanks for that, I'll get the 1.0 branch downloaded and have a go with that.
Cheers for your help!
Click to expand...
Click to collapse
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Are you resigning the .apk files? Cuz you have to do that for them to work correctly.
Koush said:
There are around a dozen build breaks in release-1.0... all of them are due to missing header #includes in various .c and .h files. So, when it doesn't work, don't give up. Fix the breaks and everything will build properly.
Click to expand...
Click to collapse
Yep I fixed these problems but I have now hit upon the following problem:
(unknown): error 17: Field android.hardware.SensorManager.LIGHT_NO_MOON has changed value from 0.0010f to 0.001f
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
I've been in and modified SensorManager back to 0.0010f and that let me build get further but I hit the same error again later in the build.
Given that release-1.0 should be a stable branch is it normal to get all these build issues?
Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Just tried building the AlarmClock application and running on the G1 and it works fine. Thanks everyone for your help!
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
^ Agreed, let us know which files need modifying and what needs doing, i've been trying to get my release-1.0 build root working too!
Alternatively, UndeadCretin, could you build the firmware (release-1.0) with a modified framework-res i can send you?
Ok, I managed to compile it without any editing of xml.
Just added stdlib, string, vector headers to dozen of cpp/h.
worry said:
>Managed to fix the java issue by modifying public_api.xml. Then hit several more C++ problems which I fixed and finally I can build the lot!
Can you write, what did you fix?
Click to expand...
Click to collapse
To fix the java issue, I modified frameworks/base/core/java/android/hardware/SensorManager to change the LIGHT_NO_MOON value to 0.0010f (from 0.001f) and in out/target/common/obj/PACKAGING I modified the <field name="LIGHT_NO_MOON" to have value-"0.0010f">
After this there were several other c++ files which were missing relevant includes. I'm afraid I didn't keep a note of these so cannot provide much detail but mostly they were missing one of the following
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
I think one file needed the following include
#include <string>
and there were a couple of other files that needed other includes. The best way to find these is to google for the function name that isn't building and you should be able to find the appropriate include (that's how I did it).
Hope that helps a bit!
were you able to repo sync after adding the local_manifest.xml?
ximonx said:
were you able to repo sync after adding the local_manifest.xml?
Click to expand...
Click to collapse
I did try that previously but it didn't work. I don't think the relevant files for the dream build are available in the release-1.0 branch. This wasn't a problem for me since I'm only interested in building the applications which work fine with the generic build.
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Phlogiston said:
I would like to do the same for the mms application. Could you give me the steps or a link how to do it? I mean do I need the whole sources from android platform to do it? How can I just compile one application?
Click to expand...
Click to collapse
I downloaded the whole Android source (the release-1.0 branch) and compiled the lot. It may be possible to just build the individual application but I do not know how. It is not vital to build for the dream platform if you only care about the applications since they will work fine with the generic build.
So the basic steps to start are:
Get yourself a Linux or Mac OS platform (I use Ubuntu running in VMWare on my XP box).
Follow the instructions here: http://source.android.com/download but when you come to repo init add the flag -b release-1.0
Fix various build problems
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
ximonx said:
When recompiling individual apps to replace system apps is there a way of just building a single application or does the entire thing need making?
Click to expand...
Click to collapse
My experience is that you have to do the whole thing if you are building from source. There is one way I know of to get around this, which is to use baksmali and smali.
Just to be clear, making the entire thing = build from source root?
ximonx said:
Just to be clear, making the entire thing = build from source root?
Click to expand...
Click to collapse
If you are asking me--yes, that's what I mean. Make sure to build for dream-open as the target (it's generic by default).

[Q] How To Compile tun.ko for Mesmerize running 2.2.1

I have recently unwillingly upgraded from my Samsung Mesmerize I500.01 to the newer Samsung Mesmerize I500.04 in the process of reinstalling my OpenVPN client (the whole reason my company pays for me to have the phone). I discovered that the version of the tun.ko module i have will not work with the newer phone.
I have scoured the internet trying as many different versions of the tun.ko as i could and none will work they all fail with "failed (exec format error)".
After realizing there may not be a pre-compiled one available i moved on to trying to compile my own (which I've never done) . Now it seems as though not only is my directory layout a bit different but I'm missing key files that are referenced in the process ( config.gz ) and cannot find any how-to's that take into account the unique obstacles of this particular version of phone. Of course if someone has this exact same phone and a working module that would be great otherwise I'd love to get help compiling my own.
The Phone is Samsung Mesmerize SCH-I500.EC10 Kernel Version 2.6.32.9 (no additional subversion) Firmware Version 2.2.1
I downloaded a couple source versions off of the Samsung site that seem to be for this phone but I'm not sure exactly which one i should use.
I have experience in Linux but none in development/compiling.
Help would be very much appreciated. And i did search for 4 full work days before posting this thread.
-Jace
Solution Found
After much trial and error i finally managed to compile a working Kernel module for this phone. I will post it here so others with this model may use it.
I know this is an old thread ... but I'm now looking for tun.ko for 2.3.4 ...
Or instructions on compiling it my self ...
Thanks
compiling
Guidojones,
I bellieve i have a document that i made while compiling my tun driver that should be able to help you through the process. I will scour for it this evening and see if i can't come up with something for you.
-Jace
tinookoo said:
Guidojones,
I bellieve i have a document that i made while compiling my tun driver that should be able to help you through the process. I will scour for it this evening and see if i can't come up with something for you.
-Jace
Click to expand...
Click to collapse
Tinookoo,
Were you able to find the document for creating the tun.ko file? I am also interested in compiling it for 2.3.4.
Thank you,
craknjak
i am looking for new threads please help me to find new threads

[Q] Hints requested building specific binary to solve bluetooth problems

My Nexus has problems connecting over bluetooth to my Car (BMW). I've found a lot of references to similair problems, and also a hint which suggests a change that could solve the problem. The hint can be found on the cyanogem forum in posting 77834, "bluetooth-connection-drops-kar-kit-bmw" (I cannot post links here).
I am running stock KitKat, and for the moment want to keep it that way. So, I decided to try the same patch on KitKat. I've managed to setup a development image in a VM, but keep running into problems compiling - my machine lacks resources (diskspace) to complete a complete build. I do not need a complete build; I need just 1 file, bluetooth.default.so, compiled. My development skills are VERY rusty, and I cannot find out how to build only this file.
I've applied the patch to external/bluetooth/bluedroid/bta/ag/bta_ag_sdp.c, run a make on the Makefile here etc - but, still no luck. The most frustrating bit is that I'm sure this is trivial, but it has been such a long time since I did any development work that I cannot seem to find a way to compile.
Can someone help me out here with hints on how to build the .so? I need bluetoot.default.so, build from the files in the external/.../ag directory, to be situated in system/lib/hw on the android system.
You put a Q in the title yet still posted in the wrong place. Please be more careful about where you post. General is not for questions. Q&A is for questions

[Q] How To Configure Python In Prebuilts Directory?

Hello everybody,
I've just started with CyannogenMod and I still have no idea what is happening with it.
The whole story began when I was trying to port one of my scripts to my device.
With the power of buildozer, python-for-android and kivy I was able to build an apk file which runs perfectly on device...or maybe not so perfectly.
The problem was that my script requires python to be compiled with SSL support.
It turned out that the builtin python on my device does not support it.
So I decided to build my own version of CyannogenMod with this feature.
I've downloaded the source and started to read the wiki.
A lot of things are pretty well explained and are very helpful.
But I coudn't find any information about the topic that I was looking for: change default python in CyannogenMod.
Then I started browsing the source and found python in prebuilts directory.
My question now is:
How can I change, replace or configure the python interpreter, which is going to be build within Cyannogen, to support SSL.
I googled around but found nothing.
It will be very helpful if someone can refer to some more detailed article or even better - to explain in details.
Thank you in advance!
Best regards to everyone and see you around!

[Q] Informations for building a new Device tree for a unsupported Device

Hi Everybody,
I want to ask for some informations what is need to do to build SlimRom for a new device. I found a lot of informations about CM, but nothing is really in a way that I really know what I have to do at the end. So is there a Howto, which describes it a little bit more in detail? A lot of howtos was found which describe to get a build-system, and to generate something for a know device. But everybody then describes only: you have to get the vendor files, made your Board-config but only on a very high level.
What I did:
- set up a building-server on ubuntu.
- get Slim-Sources branch JB4.3, and build the version for galaxysmtd to be sure that the buildprocess is ok.
- get "Nonreallyfree"-Opensources from Samsung for my I8200, and try to put them in the right places, and try to implement all needed files in the device/samsung/i8200 folder.
Up to now I think I have everything in place more or less, but the system told me that there is no rule for make 'bacon', but lunch seems to work right with setting the variables...
Up to now I did not used the blobs of the devices. The question is, if that is needed if I have the sources from open Samsung?
I know, jb43 is not the newest, but I start here, because up to now the sources are based on that level, and the kernel have no selinux implemented... If this start point will work, then I will try to go ahead with higher versions... end goal will be Slimkat...
Any help is very much appreciated!!
BR
SP

Categories

Resources