Build and reuse android open source Dialer source code in my project - java

I have to integrate android opensource Dialer source code into my application and also need to do customizations on the same.
Currently I cloned the Dialer source code from https://android.googlesource.com/platform/packages/apps/Dialer/
It doesn't seems to be a gradle project. How can I build this project ?
I need to add this entire project as reusable module in my project. Could you please help me on this. How can I start with this ?
This Answer seems very informative https://stackoverflow.com/a/8668334/3020568 but I need to get some more help from guys those who tried to build this type of applications.
WE tried below steps.
Checked out source code from google source.
Tried to import the project in Android Studio.
It has dependencies outside the project which are not able to resolve. - Some classes and methods has no reference inside the source code.
Thanks in advance.

I know this is old but this is for future reference.
You cannot build the Dialer application without access to the rest of the source code. You need to first download the whole Android source (AOSP) and then build it because the Dialer application that comes with AOSP requires some framework files which is included in AOSP; hence the Dialer code may not actually work on all devices. Your best bet is using a tutorial to build a dialer application from scratch.

Related

What is the output when building android framework from the source tree

I am planning to modify the Android framework within the source tree. I have few questions,
If i build only the framework directory what will be the output? Will it be a jar file or the whole system image?
How can I use the built framework to develop apps that use this custom framework? (will there be any android.jar or something similar?
Thank you.
Building only the framework (mmm frameworks/base) is not enough. If you do in this way you will only obtain a bunch of jar files containing built framework. To use the modifications, you need to build the full image against which you will test your changes. Do not forget to do make update-api
To use the modified framework, you need to build sdk. To do this, you need to do the following steps after you've updated the api (see more https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt):
source build/evnsetup.sh
lunch sdk-eng
make sdk
After you've built the SDK, you need to point Android Studio project to the new location of the SDK. To do this, create a new project in Android Studio, select the root folder in the Project panel, and make a right click on it selecting the "Open Module Settings" item (or simply pressing F4). Point the location of the SDK to the folder with newly created SDK (it should be somewhere under the out/host/linux-x86/ directory if you use Linux-based host operating system).

Android Unable to access java files in library

After a lot of struggle and research I am writing this for help. Being a new in to Android and Java literally spent few days. I am sure I am missing something silly but need insight.
I am using Android studio and have added Zxing QR scanner in to my project. Now I want to edit few methods in the library to do some customisation. I have added the library via Gradle. This is the library I have used https://github.com/dm77/barcodescanner.
I have followed the basic instructions and added the library via gradle. Integration is successful. Now I want to customise the UI. So I got hold of the library here
When I got hold of ViewFindView and tried to edit the method, I wan not able to edit it. Then I realised it is a class and also auto generated. I am supposed to edit the Java files.
The respective java file with all the code in the methods is here
ViewFinderView.java
How do I use it?
Is there a way to get hold of the java files respect to those class files.
How can I edit those files so that I can customise them?
I think all the above questions are kind of same. What do I do?
I am happy to provide more information.
Greatly appreciate your time. Thanks in advance.
I have added the library via Gradle.
That is your problem. In order to add the library to your project you have to import it as a module instead.
Download the repository (either via git clone or download as zip from Github)
Import project as a module in Android Studio (File -> Import Module or File -> New -> Import Module)
Edit source files
You will need to make your changes to the files in the imported module not the ones found in the build directory.

After creating android project in Eclipse ADT, tons of errors show up

I'm using eclipse ADT (most recent version) to develop some android apps. I've followed the getting started tutorial at the dev.android.com and it worked just fine.
But when i tried to create another project with the same targets and sdk's, i've got nothing but errors:
Some errors and my sdk's:
That's the same sdk's i used before these errors started showing up.
What can be causing this?
EDIT: my project won't generate the R.java file
You might need to add a support library to your new project.
Check this link for downloading the support libraries -
http://developer.android.com/tools/support-library/setup.html#download
Please notice that you need to import them into your eclipse and then include one (preferably the newest, not sure about this) in your project.
EDIT:
Before downloading the support libraries you should first check if you have them already.
Try this, right click project folder in the eclipse package explorer, Properties>Android>Library>Add>select a library if you have one.
There might be an invalid library included in your project already, if that happens then you will see it in the Library>Add> menu, remove it and add a new one.
You might have clean your project ........
if yes.....you must check whether R.java file is present in **Project(your project)->gen->package name->R.java**
if not than u have to update Tool Folder in SDK manager

How to rebuild Android app in release mode with another package name by command line interface?

Hello im making an generic app that is configurable by xmls and files on res. Im trying to make differents apks from the same source of code. The problem is that im triying to do this by command line interface and i still dont find a way to change the package name and then build it in release mode.
I created my custom build.xml ant file and I tryed this solution,it generates 2 apks: MainActivity-debug.apk and MainActivity-debug-unaligned.apk but didnt work for me since the apk just built on debug mode and didnt even ran on emulator throwing [ INSTALL_FAILED_INVALID_APK].
So is there a way of doing this? The main problem isnt about debug or release mode since i think i just will have to use ant release command, is about creating an apk with different packages names so i can have both signed and running in same device.
Thank you!
If you set your project as a Library project, you can use a facade style Project with it's own AndroidManifest.xml and overriding /res values to create a "custom" set of projects which derive from your main "Library" project.
Facade projects created in this way act the same in terms of functionality but can have different styles, package names, internal id's, colours, images (or even expose different intents or receivers).
As commonsWare proposed i used Gradle for this solutions.
I used this tutorial for Gradle with android.
I used this answer for building apps in release mode
I used flavors also as commonsWare said, read this
Thanks a lot!

I'm unable to get WiEngine skeleton project to run

So I'm trying to port some cocos2d iOS apps over to Android and it looks like WiEngine is the most fully featured port of cocos2d to android ( http://www.wiyun.com/web/wiengine ), however I'm having issues getting the skeleton project to run. The latest problem I'm running into is I get a "Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/wiyun/engine/skeleton/Skeleton" error in the ADB. I'm trying to run it in the emulator which also may be an issue. I'm kind of stuck because i need to see if I can get certain things to work (particle effects etc) before i can justify a hardware purchase.
Originally I tried to import the Skeleton project into eclipse but ran into too many errors so i created a blank android project with the same package name as the skeleton project and added the libraries to the build path through properties>libraries>add external Jars
the project compiles but it crashes as soon as it tries to initialize the Skeleton class here is the console stuff:
http://pastebin.com/XAc0XYiA
Appreciate any help on this.
Thanks,
Nick
You have to include JNI accessible precompiled libraries to you project. You can find them on the SDK archive.
For running your WiEngine Projects you have to add the WiEngine Library which is available when you download it from Github.
https://github.com/stubma/WiEngine
You can add library:
Right click on your Project-> Properties->Android->Library->Add WiEngine

Categories

Resources