How to include project on git into new android project - android

How I can include existing project into my android app.
following is the one i want to use:
https://github.com/dhis2/dhis2-android-sdk

You should be able to add your project as a submodule of your android app repo.
See for instance this question:
cd C:\Users\USER\AndroidStudioProjects\ProjectName
git submodule add https://github.com/dhis2/dhis2-android-sdk
file structure:
ProjectName
app
dhis2-android-sdk

Related

how to add a git non-android library project as a sub module, to android project

I am working on project were I have to initialize this repo https://github.com/livekit/protocol as submodule in my android project. How can I achieve this?
First clone the Android project into your local system.
git clone https://github.com/username/repo-name
Then using the git submodule add command, add the URL of the submodule
git submodule add https://github.com/livekit/protocol
Then execute the following commands:
git add .
git commit -m "Commit message"
git push origin master
In the last command replace masterwith the name of branch you are working with.

Remove module as library from git using android studio

I was using a project as module dependency in Android Studio. I no longer now need it. So I removed the dependency from build.gradle file and then committed and pushed it. When i take a fresh check out using git in Android Studio, i am able to see that module, even though that is not being used by my project. If i check on the git site, the folder is still there. I think i need to delete it from the cache of the git which maintain the history of this. But I do not know the commands to run in the Android studio terminal to completely remove it from git respository.
Project Structure
Project
|
-app
-build.gradle(removed dependency of module 1)
-Module1
-Module2
-module3
-settings.gradle(removed module1)
Want to remove module1 from the git. Please let me know the commands.

Error debugging and build in Git PowerShell command and Import in Android Studio 1.1.0

I want to use Indic-Keyboard github project for build an application. So when I clone it to my repository and try to build I get build failed with an exception that
Cannot evaluate module ime : Configuration with name 'default' not found.
I create my own release key for key store in android studio 1.1.0 according to developer.android.com's suggestion for Signing Your Own App
and store it in E:\GitHubCloneProject\AddSubmoduleAndroidStudio\CloneProject\java\keystores\android.jks.
and also set ANDROID_HOME=E:\Android Sdk in my system environment variable by using the
following suggestion from stackoverflow.
I follow the procedure for initialize,update and add submodule according to github project "austimkelly/my-android-project/How-to-Use".
When I try to import in my android studio I get the error
Can not invoke method readLine() on null Object.
I'm using gradle 2.2.1.
checkout your indic-keyboard/ime folder, if it is empty follow these steps-
after using this command "git clone --recursive git#github.com:smc/Indic-Keyboard.git" use cd indic-keyboard to navigate to project directory
use "git checkout -f HEAD" to check the status
use "git submodule update --init --recursive" or "git submodule foreach --recursive git checkout master" as suggested in this stackoverflow question.
then go to build.gradle in your clonned directory/indic-keyboard/java and remove signingConfigs and buildTypes part from it, after saving import java folder to android studio and hopefully everything will work
#CSE09 are you able to use it in your app, if so please guide me how you did that, as I am struggling to convert it into a library project in android studio

Create Android project in my local git repository

I have a git repository cloned from github. Then I go to my local copy of that repository. There are sub-module projects in the repository.
Now, I would like to create a new Android project. So, in Eclipse I did:
File -> New Android Application Project -> (fill project name, etc) Next -> I browse to my git repository, but Eclipse doesn't allow me to create project there, it complains "Folder is not empty".
But I need my new Android project to be created in the repository. How to get rid of this problem with eclipse?
Make your android project in an empty folder and then copy and paste the contents into the root of the directory where you have a git project.
You'll need to make sure you add everything with git add -A

How to push submodule to github using android studio?

I cloned an android project from github. I made changes after cloning and pushed it to the main repository from android studio. Everything worked fine but when I add an external library in my project I can't push it. I think its a sub module. Could anyone tell me how to push external library as a sub module from android studio?
After searching internet I found a simple way to do it. To add a sub-module we need to run this command
git submodule add LIBRARY_URL
and to init the sub module locally
git submodule update --init --recursive
If it is a submodule, you should be able to list the gitlink entry, special mode 160000
$ git ls-tree HEAD mysubmodule
160000 commit c0f065504bb0e8cfa2b107e975bb9dc5a34b0398 mysubmodule
It should also be recorded in your main repo/.gitmodules file.
In that case, all you need to do is add and commit that entry, and push it.
If it is not, then remove that folder, and add it again as a submodule through command-line (instead of Eclipse/Egit)
git submodule add /url/of/library/repo mysubmodule
git add mysubmodule # no trailing / here)
git commit -m "Add a submodule"
git push toAndroidRemoteRepo

Categories

Resources