Visual Studio Project migration to Android Studio with Gradle - android

I'm not an android developer, but I have little experience with andoid. :)
Th Problem
Playstore now requires .adb file type to be used for submission
Apparently I've discovered that the only way to generate a bundle is by converting my project into an android studio project with gradle or through command line with build tool.
So I tried the buildtool first, but I had a hardtime with last part which was zipping your source code in different parts using apt2, this would've been the last part and I wouldve been able to generate a .adb file already. But the tool is for windows only. I tried the import Profile / Debug apk aswell to archive it into .adb but I ranto a gradle issue this time. To make story short, Is there a way I can properly import and migrate my visual studio project into android that would totally work this time?
I need to import a visual Studio Project (w/o) gradle into a Gradle Visual Studio project type so I can archive a bundle .adb file.
THe project structure is like this (Client Just bought this template app)
MyApp_V2.6.1 [Folder]
API [Folder]
SomeDLLFiles.dll
SomeOtherDLLFiles.dll
MyApp [Folder]
properties[Folder]
AndroidManifest.xml
The Rest of the folders
MyApp.cs
etc.

Related

How to import an Android Studio project from android.googlesource.com?

I'm trying to open the DeskClockApp (https://android.googlesource.com/platform/packages/apps/DeskClock/) in my version of Android Studio. However, since no gradle files are downloaded, Android Studio is struggling to see the project as an Android-Gradle app.
I've tried downloading the source code as a zip, importing it as Git from Android Studio's VCS, etc. The online repository doesn't have the gradle files b/c the developer added a gitignore for gradle (makes sense). I also considered adding the gradle files myself but the project structure seems to be slightly different than the structure defined online. When I first import that project it says Android Framework detected, however, on configuring it for Android it cannot find any module to run, or even display the correct files (in the Project view). Is there any way to generate the correct gradle files for this? Maybe run it without gradle?

Writing a Gradle for a previous Project

I just started an android project for school, and I have to edit an android application that was built by previous students. I was given source files and apk but no gradle.
I imported into Android Studio and tried to run the build when I saw that I couldn't. I have looked up documentation online for the past 4 days and have so far come up with nothing other than downloading the gradle-2.7 files and running:
build gradle
in my computers shell.
Is there an easy way to build a gradle? Perhaps some tools or such? Or will I have to go through the files and write all the gradles myself?
Android Studio uses a Gradle wrapper to fully integrate the Android plugin for Gradle. You can build your Android apps from within Android Studio and from the command line on your machine or on machines where Android Studio is not installed.
Android studio comes bundled with gradle and in the screenshot I can see gradel folder, gradlew and gradlew.bat and build.gradle files. So (hopefully) all you need to take care is build.gradle files.
I would strongly suggest you to go through link
If you have time go through this course

Gradle sync failed in android studio

I am using eclipse for developing android applications.Its works good and I can debug and run the application.But now I installed android studio and move to creating new apps using android studio,But i get the following error
Gradle sync failed
What is gradle and how can i fix this problem, Now also I can't import my eclipse project to android studio
I had the same issue when importing my project from eclipse to android studio. I'll tell you how I fixed it. It's simple.
- Solution 1: It is possible to import your project from eclipse to android studio, but android studio version 1.2 currently has bugs with that. What I did is I created a new application with the same app name, same package name, same minimum api and all these things... Then normally, go to your app's folder that you want to import it from eclipse, and copy it's src folder and java folder, maybe asset and libs folder too if you have them, and paste it to your newly created project in android studio by going to that folder: "Users/AndroidStudioProjects/appname/".
If that's not your issue, try the other following solutions:
- Solution 2: Add this to your gradle.properties file in the project. This will just increase your android studio's memory:
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
You can also replace 512 to 1024 if you have enough memory in your pc.
- Solution 3: Try to close all your pc apps that consume large memory, and try that: In android studio, there is a toolbar at the top, where there is "Build" tab. Select Clean Project then Rebuild Project. Then try to sync your project again.
If you find the File Encoding Error is showed in your log when trying to sync your gradle, click on it and change the project formatting to UTF-8.
Source: https://stackoverflow.com/a/30498383/4843993
I would prefer to start solution 2 then 3 first before trying solution 1. If you still face the same issue, tell me. :)

How does one migrate libGDX projects to another system?

I have libGDX projects on one laptop. I need to move to another laptop. I am using eclipse on both windows laptops. I have a git repo I can push to and pull from. I know that I can clone the https://github.com/libgdx/libgdx-demo-cuboc and import it into eclipse as a gradle project. But when I try this with my libGDX projects the "Build Model" fails.
I suspect I did not export the project correctly from my source laptop.
Can someone please point out what I am doing wrong?
Update:
OK. When I exported the projects from Eclipse I exported as plain old Android projects (Export Android Application), so I figured that I should export the project as Generate Gradle build files but I get this error when I attempt to do so ...
... and yes I did this too ...
... and I still get the same error.
UPDATE: After accepting JH's answer. Thank you for your answer BTW.
I was able to copy files in the project, but with gradle one copies the files into the directory libGDX generated the base project. I was coping the files into my Eclipse workspace, which is why the files were not showing up in my Eclipse project ... I know confusing huh. Well I was able to get my project to build but whenever I launched the app if crashed at runtime (see java.lang.UnsatisfiedLinkError: Native method not found: com.badlogic.gdx.backends.android.AndroidGL20.glGenTexture:()) I decided to give up on Eclipse and migrate my project to Android Studio. After taking a quick look at the Android Studio I was FINALLY able to build my app and execute it without runtime errors on my new laptop!
For clarity here is what I did to migrate my project from one laptop to another.
1) I got the my code out my git repo.
2) I downloaded the latest gdx-setup.jar, 1.5.3, from the libgdx project.
3) I generated a project, being careful to use the correct values for: Name, Package, Game class and Android SDK. For Destination I used c:\Users\Me\.
4) I copied the directories android, core, html, desktop and ios directories from my git repo into the corresponding directories in the project that gdx-setup.jar created.
5) Then I started Android Studio and follow the directions found here: Migrating to Android Studio
6) updated my build.gradle to include google play service and BANG! it worked
You shouldn't have to export anything, just clone the git repository on the new computer and then import gradle project and build model.
You could even generate a new libgdx project with their project wizard and then copy the source files.

Phonegap 3.3 installation issues

I'm having some issues with the new phonegap installation, using nodejs. I've managed to get everything working, set the path to ant, android sdk, java jdk etc., everything works perfectly.
With the usage of the following commands I've managed to create a new project:
cordova create hello com.example.hello HelloWorld
However, when I've examined the project, it was empty:
So I went into the "hello" folder and added an Android platform in the following manner:
cordova platform add android
and then I've build it:
cordova build android
So, after that, there were some android specific folders, as shown below:
Is this how the structure is suppose to look like? I'm having REAL problems importing this into Android Studio. However, I managed to import the project into eclipse, but now I have two projects, first is named "HelloWorld" and the other "HelloWorldCordovaLib". This is a bit confusing. While it works, why are there two projects? Am I doing something wrong?
Moreover, when I import this project into android studio, I get a bunch of errors (whereas the same project works in eclipse): Errors with the structure
This is seems very, very confusing. I have yet to understand why Phonegap is suddenly so hard to install. I hope I'm missing something. Any kind of feedback is welcome. Thanks.
Android Studio, amazingly, can't import Android projects that don't have the Gradle project structure. Until Cordova starts generating Gradle files, or Android Studio completes the importer's types of projects it'll support, you have to export the project from Eclipse before you can import it in to Android Studio.
It's perfectly valid to have two Projects in one Cordova application. Usually, it's because your app references the Cordova project as a sort of "sub-project" (not the right term, but I'm not sure what Android calls it).
The structure is correct.
when giving the command cordova platform add android you are actually adding a folder named android inside platform folder. For android development you have to work on the files inside platforms/android.
Read more here Phonegap - Command line interface

Categories

Resources