Android Studio project cloned from Github only showing ReadMe - android

I'm trying to set up my Android project on my new laptop and I'm having some trouble. My project works fine on my PC, it's just the new setup I can't get working right. The project file is building properly, but it won't display in the project view. The files I can open show a red J in a circle. All attempts to update or pull just end in "All files up to date."
This is a link to my github profile: https://github.com/jschioppo/RecipeList

I have downloaded this project and found that there are no project level build.gradle and settings.gradle files.
This is not an Android project it's a module. I am able to run this Module at my end. Do following steps:-
Create new Android project in your studio.
Once it is loaded. Goto File Menu and Click on Import new Module.
If you already have a Module named app then changed the Module name and import this Module.
Now you will be able to run this Application.

You've not added project's build.gradle (located in project's root folder) to your github repo. Please add that to github and try importing again.

Related

Edit Classes From Github Libraries

I have installed the folder picker as per instructions from Github found on this link: https://github.com/kashifo/android-folder-picker-library
I have added the following line to gradle:
implementation 'lib.kashif:folderpicker:2.4'
And added to MainActivty:
import lib.folderpicker.FolderPicker;
And in onCreate:
Intent intent = new Intent(ActivityFolder.this, FolderPicker.class);
startActivityForResult(intent, PICKFILE_REQUEST_CODE);
Everything works fine accept that this type of installation seems to be working 'online' as I don't understand where this class is: FolderPicker.class, I would like to make changes to it and its xml layout (remove the New button etc..), how can I edit this library and customize it instead of using it as it is?
I have also downloaded the entire package as well and it also doesn't have all classes and layouts located within the app folders.
You are looking in to wrong folder , The app folder is for the sample project . The actual library will be in folder with name folderpicker
Here is the link to the class FolderPicker.java .
If you want to customize the library then clone the project , edit the parts you want in folderpicker and include the the folderpicker module to your project Or generate an aar file and add aar file in the project . If you have time you can even publish on jcentre/maven and directly include it as a gradle dependency
Follow This Steps For Import Module and Edit Libraries class in Android Studio.
First Download Project From Github Then Go to Android Studio-> File -> New -> Import Module...
Select the source directory of the Module you want to import and click Finish.
Open Project Structure and open Module Settings for your project.
Open the Dependencies tab.
Click the (+) icon and select Module Dependency. Select the module and click Ok.
Open your build.gradle file and check that the module is now listed under dependencies.(implementation project(path:":YOUR_PROJECT_MODULE_NAME")

how to add another project in my existing Android Studio project?

I'm getting some image cropping demo from the net , and I'm trying to import that lib project in my existing android studio project. I don't understand how to import lib project in my project .
Here is getting demo from net.
See this is highlighted the folder name cropper . This demo is getting from net .How to done same as in my existing project.
Go to File->New->Import Module then browse you project. After importing module go to project structure and add module dependency to your project.
First add it as a new module into your project.
Then go to Project structure select dependencies tab and then add that module as a dependenci.

Create a standalone library module in Android studio

Creating a standalone library application is a common task in Eclipse + ADT.
I thought that this should be a simple task in Android Studio (1.2 or above), but after struggling with this problem for two days, I figured out that google did nothing about this and implementing a standalone library module is not as simple as I thought. So I decided to share my experiences with you.
To create a standalone and reusable library module in Android Studio:
1- Create a new project with no Activity.
2- New project's default module is named app. Right click on module and refactor/rename it to something like 'library'. Close Android Studio.
3- Open file explorer and rename module's folder from app to library.
4- Open .idea folder. There are some XML files there that have references to app folder. Replace app into library in these files.
5- Open module's gradle file (library/build.gradle) and change plugin to com.android.library. Then remove applicationId.
6- Open Android Studio. Rebuild module. If there is no error, we are done here.
7- Open application which is dependent on that module. Open settings.gradle and include library module as below:
include ':library'
project(':library').projectDir = new File('/Path/To/LibraryProject/library')
8- Open application's app module build.gradle file and add this line into dependencies section:
compile project(':library')
9- Rebuild your project. If everything is right, you will see library module in your project. You can edit library module from there and/or its project and more important: Now you have a standalone library module that you can reuse in multiple projects!
I hope google will make this process a lot easier in future releases of Android Studio!
EDIT:
I checked Android Studio version 1.4 and hopefully in this version we can omit steps 3 and 4.

Android Studio won't let me import SDK

I was trying to follow this post to import the mopub SDK into my app, however Android Studio is being difficult.
I unzipped the SDK, and went to Project Structure to select import a New Module. When I chose the unzipped folder, the Finish button is grayed out, and there is an error saying 'Select Modules to import'
I am using Android Studio version 0.8.6. Here is a screenshot of the error menu
I had the same issue so I had to install it manually.
First, unzip the downloaded file and then copy the unzipped mopub-sdk folder into your project directory.
Next, open your project's settings.gradle file and make sure the MoPub SDK is included as a module:
include ':app', ':mopub-sdk'
Open your app's build.gradle file (not your main project one) and add the MoPub SDK as a dependency:
dependencies {
compile project(':mopub-sdk')
}
These instructions are based of those found on the mopub github.
In eclipse, if we create a project which is having library projects inside our project, then
we cannot import this project as module in Android studio. This may be the issue
It's not fault of AndroidStudio, just try archived sdk, it works
https://github.com/mopub/mopub-android-sdk/archive/v3.9.0.zip
from https://github.com/mopub/mopub-android-sdk/releases
// sorry I don't enough reputation to post image

Run Facebook SDK sample apps in Android Studio

Novice question.
What is the recommended way to run the sample apps, included in the Facebook SDK, in Android Studio (0.8.6)?
The ideal answer would include step-by-step instructions.
I'm using Android Studio version 0.8.0, and Facebook SDK 3.18.
When I tried to open a sample as a separate project, it can't find Gradle and wasn't able to run it. However, when I imported /samples folder as a root, all sample projects were imported and was able to run each samples.
File > Import Project > Select FACEBOOK_SDK_PATH/samples > OK > Create project from existing sources
and then, click next/ok as Android Studio's default setting.
Hope it helps!
Suposing you already downloaded and unzipped the SDK.
Create your android project. Gradle based.
File -> Import Module. Navigate to the unzipped folder and select the unzipped folder.
Add the library dependency in your main module (the one created with your project) adding this line in your build.gradle:
Synchonize project.
If you want to continue creating your own app, you might add the dependency module build.gradle file:
android {
dependencies {
compile project (':facebook')
}
}

Categories

Resources