Creating Android App builds - android

How do I create Android app builds similar to Windows code builds? I have my Android app code base checked in to Tortoise SVN. But I also have the binaries checked in - i.e the apk file etc. and not just the source code. Everytime there is a change I am building it manually on Eclipse and then updating the apk and the code folders. Is there no mechanism to create builds like on Windows where you run a batch file running the visual studio exe to create builds and binaries. I need this because otherwise it s just replacing the apk's everytime. Its very frustrating that I dont know this simple detail so please help!

You can use ant building scripts (details at http://developer.android.com/guide/developing/building/building-cmdline.html).

Actually you have to just checkin your project to SVN. The other team member or even you when loading it in another working space (another PC or diff Eclipse WorkSpace), Eclipse will throw error.
Simply clean the project it should rebuild the app and APK files for you again. Nothing much to worry. Me and my friends have done it several times.
Correct me if I'm wrong.

Related

Files appear in the Android/Data/{appName/} folder after installation, without starting the app

So I am working on a Android app with Unity, and I use git (gitHub) for source control. The problem is that on my PC when I build the apk and install on a phone there are files in the Android/Data/{appName}/Files folder. That's a unexpected behaviour because I want to copy files there but only after starting the app. The interesting thing is that if I clone the repo and build the apk on my laptop it works fine, the files are only created on my phone when I start the apps and my own scripts copied them.
So my question is there a gradle or any build system configuration for this kind of behaviour? (I am not so familiar with gradle)
So basicly I tried going trough my git ignore list to find what can be the difference (the unity provided default on), but no luck.
Edit: The apks totally similiar, same size, etc
Changing the product name in the player settings solved worked, but I am not convinced the issue is solved.

cordova build has erased my files - can they be found

Damn!
I ran cordova build from the CLI for an existing Android app with Eclipse, because another post said to do that if you've got problems with the splashscreen plugin.
Of course, cordova has reset my project to the start and has deleted all my files. Thankfully I've got a copy of the index.html file, but I had a large database initialization file which is now gone.
Is it gone gone? Or has cordova moved it somewhere where it can be retrieved?
(cordova 3.3.0)
I would be surprised if Cordova made backups. But as you mention Eclipse the data may still exist as local history: Package Explorer > Context menu for the project > Restore from Local Histoy....
While this is not the answer, I figured I would expound on my experience with IntelliJ and the resetting of the project back to stock phonegap app (maybe the reason for this was the same). I once used Eclipse, but since trying IntelliJ I will never use Eclipse again unless required.
Being late at night, I decided to get ramped up on some PhoneGap development. Because that is the best time to learn something, when your brain is frazzled from the work day.
I followed the standard procedure to get a base phonegap project started (using the command line), and did an Import into IntelliJ from existing source. Import went fine, or so I thought.
Being late at night / early in the morning, I went straight to assets/www and started tinkering. Not knowing really much about the phonegap build process yet, I did not realize I was developing out of the android platform assets www folder. I could run my project fine in IntelliJ, changes were showing up in my VM.
But the minute I did a phonegap build android (or cordova build android, whichever), it took everything from my unedited root\www folder and did the build, resetting everything I had done in android platform www folder. Luckily IntelliJ has a local history.
So for now my solution is to add the root\www folder as a source root in IntelliJ and make sure to modify THAT. I probably need to modify my run configurations as well to do a full build / deploy, but I have not got that far yet.

Deploying Phonegap / Cordova app for Android?

I've got a Phonegap/Cordova 3.0 app that I am testing on Android.
Since version 2.x, Cordova relies heavily on the command-line terminal. I've done all the setup stuff and I can build the app. But two things are troubling me.
First of all, an Android project has two www folders. One is [myproject]/www. The other is [myproject]/platforms/android/assets/www. I'm not sure which of these folders to edit when I am fixing bugs.
If I am correct, the first one is where you place your app files before using the command-line "cordova build" to create the app. The second one should then be only a copy that's used after building, before deploying.
Now my question is, when I make a change to my app and I want to test on device, do I have to use the command line to (re)build the app every time?
[myproject]/www is the directory in which you should put your source files. When you build your app these files are copied in to [myproject]/platforms/[platform]/assets/www. In addition to this, files in [myproject]/platforms/[platform] are also copied to [myproject]/platforms/[platform]/assets/www, which allows you to create per-platform overrides to your files.
Note that you should never edit files in [myproject]/platforms/[platform]/assets/www directly, as they will be deleted next time you build your project.
To run your project on your device use cordova run [platform], or to run it on an emulator use cordova emulate [platform].
I found a solution: in command-line terminal, type cordova run android and the app will be built, deployed and run on device.
Hi First thing : Edit www folder inside the asset folder.
Second : no need of command line build , you can take build via eclipse its very easy, Right click on project root folder --> Run As -> Android Application

conversion to dalvik format failed with error 1 on andengine live wallpaper

I built a parallax live wallpaper with andEngine. I exported the .apk without any problems. I copied the project, updated the package and app name and everything needed to republish as a new .apk. The app tests fine on my tablet. But when I try to export it, it throws:
conversion to dalvik format failed with error 1
After hunting forums, here are the ways I've tried to fix the problem to no avail.
Update proGuard to it's latest version.
Updating the SDK to the latest version.
Removing project from workspace, changing it's directory and re-importing.
Removing everything but Android 'version#' in Java Build Path->libraries
Removing everything in Java Build Path->libraries and ran fix project properties.
Removing and regenerating the R.txt file in bin.
Clearing the .jar file from the libs directory.
Changing my .apk and keystore directory.
Cleaning the project after all of the above.
Refreshing the project after all of the above.
Running fix project properties after all of the above.
Occasionally the exporter won't throw the error. But it doesn't build the .apk, it just builds the keystore and closes.
I'm pretty stumped. If anyone has insight it would be invaluable.
Thank you so much.
I had the same problem with the latest Android SDK (API 17). I tried all of the above without success. Then I reverted all changes and this is what works for me now:
Clean project
Turn off Eclipce
Clean temp directory (on Windows, %TEMP%)
Turn on Eclipse, export (sometimes I clean the project once more)
What usually happens is that the temp directory will contain some files from previous export that cause problems and you can't delete them while they are used. Hence the "Turn off eclipse" step.
Note that some files will stay in temp and you won't be able to remove them - don't worry about it, some other programs use them.

How do I make a basic App Engine Connected Android Project?

I'm new to this, so please bear with me. I simply want to get the basic App Engine Connected Android Project to work in eclipse.
I first downloaded Eclipse 3.7 and the Android SDK. I installed the ADT plugin through eclipse. I configured eclipse to point to the sdk and created an android project. I added some widgets, messed around with SMS messages, and ran it on my phone. Worked like a charm.
Then I decided it was time to work with app engine. I downloaded the Google plugin for eclipse from within eclipse using this link http://dl.google.com/eclipse/plugin/3.7. I also downloaded the Google App Engine Java SDK from that link.
Ok, here's where it gets more fun. I created a new app engine connected android project and named it "TestProjectThree". I then clicked "Debug as->local app engine connected android project". On the console I got a url, but on my phone I got a black screen. I then noticed that there was nothing in the android/gen folder, so I did a clean build of both projects. Suddenly, it gave me 10 warnings.
"Cannot fully validate context since domain type com.testprojectthree.server.HelloWorldService is not available.
You must run the ValidationTool as part of your server build process."
I googled the problem and found this link http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation.
I began following the instructions. I tried to enable annotation processing, but it was already enabled. I tried to add the requestfactory-apt.jar to the factory path, but it was already there too.
Apparently now I need to run something called an Annotation Processor. I've never used Maven before but I right click on my android project->configure->convert to Maven project. I do a clean build and a POM file appears. I then copy all of the XML from that link to the line right above the /project line in the POM file. I copy the second bit too because I'm using indigo. Clean and build again. New error.
"/TestProjectThree-Android/gen already exists but is not a source folder. Convert to a source folder or rename it."
No idea what that one means either, but I see right click gen->build path->convert to source folder so I click that too. Clean and build again. NO ERRORS!! YAYAYAY!!!
Debug as local app engine connected android project. Got a black screen on the phone, and some sort of error in eclipse. “Source not found”. Looked for a more detailed error message but the console just has the app engine url on it and logcat looks empty.
I went back to the link about the validation tool and read all the comments. A lot of people seemed confused. I have no idea if I did it right, or did any of it right, and am very lost now. Please please please help me!!!
This sounds very similar to a problem I had, although not exactly.
I think the code generated by the AppEngine project that is used by the Android project is either not generated correctly, or needs a refresh.....and clean doesn't do it.
Try this:
First, make sure the requestfactory-apt.jar was in the "Factory Path" of "Annotation Processing" in the "Java Compiler" section of Project Properties.
In AppEngine project.
Properties-> Java Build Path, Source section. Select the ".apt_generated" entry and then "edit…" and rename it, by putting a "1" at the end of the name (or whatever).
Project -> Clean
then in Android Project
Properties-> Java Build Path, Source section.
Select the "apt_generated" source folder that is linked to the ".apt_generated" source folder in the AppEngine project.
"Edit…", then in the first line "Linked Folder Location" navigate to the NEWLY named folder in the AppEngine project (the one with the "1" at the end……)
Then Project -> Clean
Then build & run your Android project, it should now have newly generated RequestFactory code from AppEngine project and validate OK at runtime.
It's possible that closing and opening projects and cleans were also required.
Use parse. I tried using AppEnging for my app's backend, but parse seems to take care of a lot of backend jobs and makes life extremely easy https://parse.com

Categories

Resources