Android app for "Magic - The Gathering" players in order to count life points.
You can download the newest version here.
This app is still under development and we want to improve this software each day. We play 'Magic - The Gathering' and we want to put our best effort into this project. If you attempt to join us, read the next section.
To work on this project, you will need:
- Fork this project via
git clone repository-url - Basic experience in Java and Android development
- Eclipse IDE (Indigo preferred)
- Android SDK including ADT
- SlidingMenu library on GitHub
To configure the sliding menu, download the code (or fork it via git). Afterwards you open Eclipse and follow the steps:
- Go to
File -> New -> Others.. - Afterwards select
Android -> Android Project from Existing Code - Select the
libraryfolder of the downloaded sliding menu project - Click
finish
Everything complete? Then you should know, that you can fork this repository on order to make improvements! Just go on and make a pull request. Maybe it has a chance to get approved!
If you are using a 64 bit based architecture, install the ia libraries first, in order to generate the R.java files properly:
sudo apt-get install ia32-libs
It is also important to place the SlidingMenu project folder in the same folder with the magicwizard-android project folder.
The project structure looks as follows:
src/myreality/development/magicwizard/ <- Contains sources
activities/ <- Contains all activities
components/ <- Contains all business logic components
layouts/ <- Provides custom layouts
widgets/ <- Provides custom widgets
util/ <- Contains utility classes and interfaces
res/ <- Contains resources (images,meta data)
AndroidManifest.xml <- Contains general Android configuration
README.md <- Documentation of the software
Before you write a single line of code, ensure that you're in the right branch. Never touch the master branch. Instead, use always the active milestone branch as a reference.
If you want to add a language, create a new folder in res/, called values_xx where xx is the language code of your country. Afterwards copy the existing strings.xml file from values_en into your folder and rewrite the content to your language. Afterwards create a pull request with an explanation which language you have chosen.
Currently are the following languages supported:
- German (de)
- English (en)
Feel free to submit new translations!
The basic concept of this app is to create components and map them to a specific view. Each view has an own id. Without going into much detail, you can write an own component:
public class MyComponent implements Component {
@Override
public void onActivity(Activity context) {
// Is called after layout is loaded
}
@Override
public void handle(Activity context) {
// Do something here with the context!
}
}Afterwards you have to register your component in the SimpleComponentHandlerFactory class and map it to a specific input:
handler.addComponent(R.id.btn_my_action, new MyComponent());The handler will be processed by the current activity context.
Android provides so called Toast objects in order to show small popup messages. This app has an own wrapper implementation to provide custom toasts for the following types of type ToastType:
- SUCCESS: Should be used when something good happened
- INFO: Should be used to inform the user
- FAIL: Should be used when something bad happened
It is very easy to make a simple toast message. You only need the Context (e.g. your current Activity):
MagicToast.show(context, "This is your text", ToastType.SUCCESS);That's it!