-
Notifications
You must be signed in to change notification settings - Fork 29
Creating your own Baker Android Project
Francisco Contreras edited this page Mar 20, 2014
·
30 revisions
To create your own baker application for an Android environment you have compile the library and then create your own project in Android Studio. The following will guide you through the process:
- Download Baker Frameworks to your local environment (download here).
- From Console/Terminal (for Unix Systems) or CMD for Windows go to the "ABakerProject" folder. (if you list the files you should be able to see "gradlew").
- Run "gradlew install" command, if you are running on Windows it should go like this "gradlew.bat install" otherwise use "./gradlew install".
If this last step ran correctly you should see something like this
BUILD SUCCESSFUL
Total time: 21.441 secs
It means that Baker Frameworks for Android was installed as a library in your Maven repository wich will allow you to use it in you own project.
- Open Android Studio and click "New Project...".
- Add your applications details and click "Next".
- Use "Blank Activity" and click "Next".
- You can use the default values for Activities, click "Finish".
- On the project view, extend your module node and open the "build.gradle" file. Noticie is not the project but the node build file.
- Add your local maven repository url to below the apply statement, should look like this:
apply plugin: 'android' repositories { maven { url 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath } }
- Add the Android Baker Library to the compile dependencies
compile 'com.giniem:ABaker:1.0'
- Update the "minSdkVersion" to 11.
- Update the "targetSdkVersion" to 17.
- From the Android Baker Library "src" folder copy the "AndroidManifest.xml" file and replace the one on your project module.
- Replace the package name on the manifest definition with the package name of your project.
- Sync your gradle files.
- Run your project
By now you should be able to run and see the default Android Baker App that you can customise.
- From the Android Baker Library Project copy the assets and res folder to the same location in you own Project main module.
- Allow it to Overwrite all.
- On "res/values/strings.xml" you will find the URLs and properties you can override to make your project use your own servers.
- On "res/drawable-*/" you will find the images to replace for the application Icon. Make sure you use the same sizes when replacing them.
- On "res/layout/magazine_thumb_options.xml" you will find the values for colours, fonts and sizes of the main shelf view (list of issues).
- On "assets" you will find the html files that renders the Background of the Main shelf view, the Header and the Loading Screen. Make sure you create responsive html pages for you app so it renders correctly in all devices.