I am currently using a library found on github, which our client is updating daily.
Right now, I have cloned the repository, imported the project as a separate module, and I have been able to use it just fine.
However, when the client updates the library, I have to sync, remove the module from my project, and add the updated one.
I should mention that I have to use the github app, cannot use the system embedded in Android Studio.
Is there a way to do this better?
imported the project as a separate module
If, in addition of declaring it as a "module", you import that project as a git submodule, then you can make that submodule follow a branch, and a simple git submodule update --remote would be enough to update the project sources.
Related
I want to versionate an Android project with git but I am wondering what is mandatory to add to git repository.
I know about .gitignore file and I also have read this question: What should be in my .gitignore for an Android Studio project? but I have seen that there are a lot of different opinions about what should I add or remove from .gitignore file.
My question is not so open, I just want to know what is mandatory add to git repository, I mean that if I create a new project, versionate it and clone that repo in another computer, the project will work without problems.
Just the needed files I need to make my Android git project works in other computer when I clone my git repository. I am using Android Studio.
So, what files are mandatory to versionate on Android git project?
There is a great github project that includes gitignore files for every kind of project.
There is one for Android.
https://github.com/github/gitignore/blob/master/Android.gitignore
I always use this for my projects.
I cloned this repository from github and opened it as a new project.
The project view shows no gradle and I cant run the provided samples.
How can I create or add a gradle to the project and run the samples?
The repository directory what you have mentioned is not an android project.
This is the URL for that wheel sample
Android-Wheel-Menu
and also it is developed in Eclipse. So better download it from browser. then load it from Android STUDIO.
What you cloned is not an Android application but a library for Android applications. Thus, it's not intended to be run standalone which is why you don't find a build.gradle. You need to create a new Android project and then follow the steps under "Usage" which explain how to integrate it in a project.
This library is marked as deprecated, so you might want consider using another one.
I am currently using Android Stuio Beta 0.8.1 an its working fine but I am having an issue with library projects are handled.
In Eclipse, I create an Android project which is my app project and another project which is my Library project. From my App project, I reference my Library Project and I can modify the library project and the changes are automatically built into the app project.
I am trying to do the same thing with Android studio but am having a problem.
The problem is I create my Library project in Android Studio and my App Project in Android Studio.
From my app project I go File > Import Module and point to my library project and it then copies all of the source code from my library project into my apps project structure.
From my app project I then project structure and select module dependency of the module I have just imported.
The problem is though, as it copies all of the source from my library project into my app project, if I modify the code that's imported into the app project structure, then the library project isn't updated, and if I update the library project code, the app referencing the library doesn't see the change.
My library is being referenced by multiple projects, and at the moment if I change, librar projects, the apps continue to use the old code, so I am having to copy/paste the source code into the apps project stucture and re-build.
Am I missing something basic or is it just Android Studio isn't really working too well witih libraries so copy/paste is my only option for the time being.
Because libraries must live within the main project, it's difficult to share them across projects. If that's your usage, the library should be its own project that you publish to maven locally. After that, you can declare it as a dependency similar to any other. Keep in mind that the version number of the library becomes important; when you make changes to the library, be sure to publish with a new version number.
In my projects I use some Android Libraries that are hosted on github, for example, facebook android sdk. Until now I downloaded the .zip with the library and added it to my workspace. This made keeping up to date libraries were a tedious job.
I want to use the option "Import > Git" in eclipse to import the Android Projects. And later use "Team > Pull" to obtain the latest versions of these projects. Is that possible? How?
My two principal problems are:
The android project there is not in the root of the repository, and
there is not .project file.
Install Mylyn and the Mylyn Github connector into Eclipse using the update manager or the marketplace client. Afterwards you can use Import -> Git -> From Github and only need to give it the repository name of the github project. That will clone the repository, so you have the files locally on your system (but not yet known as normal projects in the Eclipse workspace).
Independent of using the connector or any other method to clone the github repository, afterwards you need to import the cloned code into the workspace, so that Eclipse knows about it and can manage it as normal Java/Android/whatever projects. This can best be done by opening the git perspective, expanding the repository node and using the context menu "Import projects" on the "working directory" node of the repository. For projects without a .project file, you will want to use the import as new project option.
I created an Android library project and an app project which is use my library. I sent into svn:
svn/trunk/library and svn/trunk/app.
Can I checkout both under Eclipse in a same time? So my destination that I checkout just svn/trunk and the library project and app project will be create. Thanks
You create the 2 projects in svn and In that case you need to checkout the app and library project separately to eclipse.