I am new in android framework development .
I try to add a service in platform/base and then I make the whole platform folder follow a post online.
Now i don't know how this change can be applied to android application. Do I need to get a new android.jar package for the application?
Thanks
update --------------------------------------------
currently I have the android source code and modified its framework by adding a testservice.java following this : Android-Adding SystemService
Then I need to write a test app to use this testservice. But I don't how to add an app to that modified android source code. I try to following this:set up the Eclipse IDE for Android platform development to add app src path to eclipse build path , I doesn't work.
before this i use eclipse and ADT to write android apps, i am wondering is there any way to write an app in the modified android source code ?
Thanks
I copied an app under [androidroot]/packages/apps/ folder and rename it and modify some code . Then it shows in application list. It works!
But the problem is the directory structure is strange , very different from the one I create from the eclipse + sdk .
So is there anyone know how to develop apps under a modified android framework.
Thanks !!!
I see a quick and dirty solution: replace the corresponding android.jar in the install SDK location (for example $ANDROID_HOME/platforms/android-8/android.jar if you deriver from Android 2.2).
Also you may try to spoof a separate platform revision in $ANDROID_HOME/platforms. Something like android-99 to avoid clashes with the actual future platforms.
Though all of these are dirty tricks this may work for quick testing of your platform code without much pain.
It is exactly the same as the project you create using eclipse. What's more all you need is to write a makefile in the directory.
Then mmm framework/res framework systemserver
bw
Related
I found a few questions asking how to get the source code from the AOSP running in Android Studio. However, I could not find any explanation on how to import only a single application of the AOSP.
I am trying to do it for the Dialer application which can be found here. However, I had only minor success, I was able to import the code as a project, but didn't manage to set up dependencies and required libraries and all that.
Can anybody tell me if it is possible, and if so, how this is done?
UPDATE:
It seems impossible to achieve this with the code that i found and which was part of the full android distribution of google. But google decided to distribute the Dialer application just like any other application via the playStore. So there should be a possibility to find this code, IF it is also running under the open source project.
You can only open the whole AOSP inside Android Studio.
After you finish building the source do make idegen && development/tools/idegen/idegen.sh inside your root folder and then open the new android.ipr in your root via Android Studio.
AOSP code you are looking is not Android Studio compatible, It's an Eclipse project.
This may sound like a stupid question with a "duh" answer but I'm really new to this.
I have a HTML/JS project I created in Eclipse. Can such a project be exported as an Android application or .apk?
Or does a new Android project need to be created and programmed in Java for what I'm trying to achieve?
(I know about Phonegap and it is not suitable for my project as it doesn't have support for WebGL that I need)
There are a few libraries, tools which will pack your code into a webview. So with some work you can create multiplatform web implementation, and the build too, ofc ( apk, ipa )
Check the Google for more, but one is popular: Phonegap.
Google: "platform independent web based mobile" "framework" " solutions"
You can open your eclipse project by Dream Weaver and build it by phone gap .
the integration between phone gap and Dreamweaver support all versions of WebGL .
Since you are using Eclipse (and for all the others who do), the .apk file of the latest compilation you did is always found in the /bin folder of your project
Just starting with Phonegap and having some trouble understanding the directory structure and setup (on Windows).
I have been able to install and setup phonegap, jdk, android sdk, ant, etc. Using the command line I can now create a new project, edit the source files in www , build it and run it on my phone, Android Emulator and even Genymotion .
But the one thing that I just can not seem to understand is how I could edit and run the Phonegap project from within Intellij IDEA. All examples and how-tos I can find use the older Phonegap 2.9 structure, which is quite different from 3.0.
I enabled and configured all plugins, etc. I then try to import the existing project folder as a new project in IDEA, but it says "Source files for your project not found".
But when I build the project first with phonegap build android using the CLI, and then try to import it in IDEA, source files are found and I can continue the import of the project. But the Project Structure then seems to point to source files in platforms/android (platforms/android itself and also platforms/android/gen and platforms/android/src , I have no idea what to choose, so I choose all). I then click Next a couple of times until the Android project is created. After changing Project Language Level to 5 (no idea what this means) , I can now run the project from within IDEA.
But... changes that I make in www (in the root) don't end up in the compiled project!
So do I have to copy all files manually to platforms/android/assets then ? (the command line phonegap builder did not require this). Or do I have to edit the files in platforms/android/assets/www directly ? (which seems odd, since I would like to be able to only maintain the same code for all different platforms).
What do I need to do to achieve this in IDEA?
Somehow I think some things in Project Structure are wrong, but I have no idea what all this means (Modules, Libraries, Facets....).
Where should the manifest file be located, and the resources, and assets and libs?!
Could anyone point me in the right direction?
After phonegap create & build , there is a whole Android project located in %my_project_root%\platform\android
if you don't have the Android SDK at left, use the green icon to add one.
That's all
We don't need to modify manually the code under %my_project_root%/platforms/* but only under the %my_project_root%/www/* and %my_project_root%/merges/*
After running
phonegap build android
it automatically replaces platform specified code.
I found solution for me the next way:
After importing source code to IDEA, I added new web module which points to the %my_project_root% to be able to see all needed directories.
Also I created new IDEA command line tool with alias phonegap and tool path /usr/local/share/npm/bin/phonegap.
So before running default android running configuration I run phonegap build android just directly from IDEA (I think it's more convenient) and then run usual android run command to deploy the app to emulator or real device.
I hope this stuff will help you.
I need to edit the original Android Apps from packages
in terms make my own distro/mod..
I want to make changes to the In Call screen, lock screen, contacts, calendar etc..
I understand that for doing this I will have to build everything from
source,
however I need to edit the source and to do so I need to open the OS provided apps as
eclipse projects,
When I did I saw that there are
missing imports which are hidden in the SDK (or missing)
hidden parameters within the classes..
I don't want to use reflection since the whole code is here and
available, but how do you build a platform development kit..
or PDK ?:)
Can any one help?
You start by reading the documentation.
EDIT:
If you are trying to download some single project from AOSP and compile it using the SDK, odds are very strong that it will not work, and that you will encounter problems like the ones you cite. You do not build Android by building individual apps; you build Android ("my own distro/mod") by building the entire firmware. Most AOSP applications are not designed to be compiled by the SDK, but need the whole firmware.
Please check Using eclipse to browse and edit AOSP. You can atleast edit your code using eclipse, but you will have to use AOSP build system to build your distro.
You might also check Debugging Android Java Framework services as that would help debug your changes.
Just open Eclipse,
then go to "window" +"preferences" +"android"
there you will get sdk location,then give the appropriate path of the android sdk for proper run...
I'd like to build some native libraries for android using the NDK (native development kit), but i'd like to use Visual Studio 2010 to do it. I've googled quite a bit but haven't found any information on it. Does anyone have any experience with this and know the steps necessary to make this happen? I have CYGWin installed, made sure i get Make (per the NDK instructions), but i'm not really sure of the next steps in terms of setting up the project, compiler in visual studio, etc.
If anyone knows of any write-ups, tutorials, or links to sample projects, that would be awesome, as there isn't much on google yet.
thanks!
Here's another solution, which integrates the NDK fully within Visual Studio. No makefiles. It behaves like a proper Win32 project:
Here's an excellent blog post about how you can configure your environment to debug android NDK code using Visual Studio.
Visual Studio is officially not supported.
Some problems (but not limited to):
MSVS cannot create the proper ARM binaries
Android makefiles (.mk) are not supported by MSVS
There are however, third party solutions:
vs-android
VisualGDB
You might want to check out DS-5 as well, though it's not Visual Studio.
The answer depends on what kind of integration you require.
To just build the native Android code from Visual Studio you can create a new Makefile project, and make it run ndk-build.cmd when you press "build". If you would like to get the error messages mapped as well, you will need to parse the output of ndk-build.cmd and convert it to a format that Visual Studio can udnerstand.
If you want to debug your native Android code from Visual Studio, you will need a third party tool that will control ndk-gdb on behalf of Visual Studio and provide workarounds for several bugs (e.g. rebind breakpoints when libraries are loaded).
You can try our VisualGDB for Android tool that does exactly that - creates projects that wrap ndk-build and controls NDK debugger on behalf of Visual Studio. If you need more information, there is a step-by-step tutorial available.
I have not found a direct clean solution, here is my workaround.
I develop my native code on VS as a static library, and use some test project to try it as a console aplication.
When it is ok, from cygwin I use a little bash script that copies all needed files to the jni folder and launch the standard android ndk make command. (also copy some file to assets folder when needed), producing the executable in the right folder.
To use the pthreads I have linked my projects to pthreads-win32.
The only files I do not compile in VS are the jni code.
I hope this can help you.
There's also a couple of other third party alternatives for developing ANdroid apps with VS in addition to those above. There is the open source dot42 located at http://www.dot42.com and Remobjects, http://www.remobjects.com , which allows you to program in c#, Pascal, and Swift. I have played with the trial of Remobjects and am now starting to play around with dot42.
My use of the remobjects trial allowed me to recreate in c# the first five chapter projects in the textbook of the Android course I took. I haven't had the same success with dot42 so far but I need to find some time to really give it a chance.