<commit_before><img style="margin:10px" src="https://www.magnet.com/wp-content/uploads/2015/05/sampleapps.png"
 alt="rest2mobile logo" title="MMXAndroidSamples"/ width="200" align="right">

# Magnet Message Android Sample Apps

Magnet Message is a powerful, open source mobile messaging framework enabling real-time user engagement for your mobile apps. Send relevant and targeted communications to customers or employees. These sample Android apps serve as introductory sample code - get familiar with our API, extend our samples and get coding today.

## Rock Paper Scissors Lizard Spock
<img style="margin:10px" src="https://www.magnet.com/wp-content/uploads/2015/04/spock.png"
 alt="RPSLS logo" width="200"  align="right" title="RPSLS"/>

We created a Rock Paper Scissors Lizard Spock game as popularized by the show “Big Bang Theory”. If you aren’t already a fan, check out the [rules](http://www.samkass.com/theories/RPSSL.html). Install, build, run, play, repeat. Oh, and learn more about how Magnet Message handles core message passing and the publish/subscribe dynamic.

### Build Instructions
0.  Ensure that the configuration file contains the proper values for your deployed server.  Edit the RPSLS/app/src/main/res/raw/rpsls.properties file.

Command line:
1.  Execute the gradle wrapper script from the RPSLS folder.
    Windows:  gradle.bat clean build
    MacOS/Linux:  ./gradlew clean build

Android Studio:
1.  Import the RPSLS/settings.gradle file into AndroidStudio.
2.  Build using Android Studio

### How it works (Technical Highlights)

RPSLS leverages the topic features of Magnet Message to keep an updated list of "available" real opponents.  When the user starts the app, the code publishes to a pre-defined availability topic to say "Hey, I want to play."  Upon closing the app, the code publishes to this same topic and says "I'm leaving".  

When the user wants to discover opponents, the app requests the most recent posts to the availbility topic to find which users have published their availability and presents this to the user.  The user can then choose which available players to invite to play and upon accepting the invitation, they both make a choice.  RPSLS determines the outcome and notifies each user whether they are the VAPORIZER or the VAPORIZEE.  The invitations, acceptance, and other interactive portions of the game are performed using the in-app messaging functionality of Magnet Message.  

All of this functionality is accomplished through the metadata of each message payload, in which the app specifies various message types and fields which pertain to each type.  This can also be accomplished by using the actual message payload and JSON marshalled objects.  The payload can be ANYTHING or any protocol you desire.

Game on!


<hr>
## Soapbox
<img style="margin:10px" src="http://www.threetwelvecreative.com/Portals/207686/images/Stick-Figures-With-Megaphone-800.jpg"
 alt="soapbox logo" width="250" align="right"  title="soapbox"/>

We needed an app to address one of the the most important issues in our office – what’s for lunch? Following that, after our office was hit by a network outage in the morning that blasted productivity for unsuspecting early commuters we came up with the notion of a corporate announcements app. Something we could check to take some of the… surprises out of work. After polishing up the code, we realized it makes a pretty effective piece of sample code highlighting our Publish/Subscribe capabilities. Pull it down, customize and get everyone on the same page.

### Build Instructions
0.  Ensure that the configuration file contains the proper values for your deployed server.  Edit the RPSLS/app/src/main/res/raw/rpsls.properties file.

Command line:
1.  Execute the gradle wrapper script from the SoapBox folder.
    Windows:  gradle.bat clean build
    MacOS/Linux:  ./gradlew clean build

Android Studio:
1.  Import the SoapBox/settings.gradle file into AndroidStudio.
2.  Build using Android Studio

### How it works (Technical Highlights)

SoapBox leverages the Magnet Message topic functionality to provide a channel for employees/friends to communicate effectively by publishing/subscribing/receiving simple text messages against a pre-configured set of topics or topics they choose to create.

Feature highlights:
-- quick account provisioning
-- retrieve all topics using topic search
-- retrieve topics subscribed by the user
-- retrieve topic summaries (used to show the number of postings in a certain timeframe which is, in the case of SoapBox, the last 24 hours)
-- retrieve the last 25 items for a topic
-- create topics
-- subscribe and unsubscribe from topics
-- adding tags for topics (tags can be used as search criteria)

## Feedback

We are constantly adding features and welcome feedback. 
Please, ask questions or file requests [here](https://github.com/magnetsystems/message-samples-android/issues).

## License

Licensed under the **[Apache License, Version 2.0] [license]** (the "License");
you may not use this software except in compliance with the License.

## Copyright

Copyright © 2015 Magnet Systems, Inc. All rights reserved.

[website]: http://www.magnet.com/
[techdoc]: https://www.magnet.com/documentation-home/
[license]: http://www.apache.org/licenses/LICENSE-2.0

<commit_msg>Updated Build Instructions and added quickstart app section<commit_after><img style="margin:10px" src="https://www.magnet.com/wp-content/uploads/2015/05/sampleapps.png"
 alt="rest2mobile logo" title="MMXAndroidSamples"/ width="200" align="right">

# Magnet Message Android Sample Apps

Magnet Message is a powerful, open source mobile messaging framework enabling real-time user engagement for your mobile apps. Send relevant and targeted communications to customers or employees. These sample Android apps serve as introductory sample code - get familiar with our API, extend our samples and get coding today.

## Rock Paper Scissors Lizard Spock
<img style="margin:10px" src="https://www.magnet.com/wp-content/uploads/2015/04/spock.png"
 alt="RPSLS logo" width="200"  align="right" title="RPSLS"/>

We created a Rock Paper Scissors Lizard Spock game as popularized by the show “Big Bang Theory”. If you aren’t already a fan, check out the [rules](http://www.samkass.com/theories/RPSSL.html). Install, build, run, play, repeat. Oh, and learn more about how Magnet Message handles core message passing and the publish/subscribe dynamic.

### Build Instructions
0.  You must replace the existing properties file in the project with your own. You can download this file on the Settings page of the Magnet Message Web Interface. After adding the properties file to RPSLS/app/src/main/res/raw/rpsls.properties, just build and run!

Command line:
1.  Execute the gradle wrapper script from the RPSLS folder.
    Windows:  gradle.bat clean build
    MacOS/Linux:  ./gradlew clean build

Android Studio:
1.  Import the RPSLS/settings.gradle file into AndroidStudio.
2.  Build using Android Studio

### How it works (Technical Highlights)

RPSLS leverages the topic features of Magnet Message to keep an updated list of "available" real opponents.  When the user starts the app, the code publishes to a pre-defined availability topic to say "Hey, I want to play."  Upon closing the app, the code publishes to this same topic and says "I'm leaving".  

When the user wants to discover opponents, the app requests the most recent posts to the availbility topic to find which users have published their availability and presents this to the user.  The user can then choose which available players to invite to play and upon accepting the invitation, they both make a choice.  RPSLS determines the outcome and notifies each user whether they are the VAPORIZER or the VAPORIZEE.  The invitations, acceptance, and other interactive portions of the game are performed using the in-app messaging functionality of Magnet Message.  

All of this functionality is accomplished through the metadata of each message payload, in which the app specifies various message types and fields which pertain to each type.  This can also be accomplished by using the actual message payload and JSON marshalled objects.  The payload can be ANYTHING or any protocol you desire.

Game on!


<hr>
## Soapbox
<img style="margin:10px" src="http://www.threetwelvecreative.com/Portals/207686/images/Stick-Figures-With-Megaphone-800.jpg"
 alt="soapbox logo" width="250" align="right"  title="soapbox"/>

We needed an app to address one of the the most important issues in our office – what’s for lunch? Following that, after our office was hit by a network outage in the morning that blasted productivity for unsuspecting early commuters we came up with the notion of a corporate announcements app. Something we could check to take some of the… surprises out of work. After polishing up the code, we realized it makes a pretty effective piece of sample code highlighting our Publish/Subscribe capabilities. Pull it down, customize and get everyone on the same page.

### Build Instructions
0.  You must replace the existing properties file in the project with your own. You can download this file on the Settings page of the Magnet Message Web Interface. After adding the properties file to SoapBox/app/src/main/res/raw/soapbox.properties, just build and run!

Command line:
1.  Execute the gradle wrapper script from the SoapBox folder.
    Windows:  gradle.bat clean build
    MacOS/Linux:  ./gradlew clean build

Android Studio:
1.  Import the SoapBox/settings.gradle file into AndroidStudio.
2.  Build using Android Studio

### How it works (Technical Highlights)

SoapBox leverages the Magnet Message topic functionality to provide a channel for employees/friends to communicate effectively by publishing/subscribing/receiving simple text messages against a pre-configured set of topics or topics they choose to create.

Feature highlights:
-- quick account provisioning
-- retrieve all topics using topic search
-- retrieve topics subscribed by the user
-- retrieve topic summaries (used to show the number of postings in a certain timeframe which is, in the case of SoapBox, the last 24 hours)
-- retrieve the last 25 items for a topic
-- create topics
-- subscribe and unsubscribe from topics
-- adding tags for topics (tags can be used as search criteria)


<hr>
## Quickstart
0.  Quickstart was created to have a simple app that could demonstrate the most basic messaging features including logging in and sending and receiving a message.

### Build Instructions
0.  You must replace the existing properties file in the project with your own. You can download this file on the Settings page of the Magnet Message Web Interface. After adding the properties file to quickstart/app/src/main/res/raw/quickstart.properties, just build and run!

### How it works (Technical Highlights)
Quickstart auto-creates a user and allows you to send a message to yourself by default. By sending a message to yourself you can easily see the roundtrip from device to server and back.

Feature highlights: 
-- quick account provisioning 
-- addressing and sending a message 
-- receiving a message and accessing its content.


## Feedback

We are constantly adding features and welcome feedback. 
Please, ask questions or file requests [here](https://github.com/magnetsystems/message-samples-android/issues).

## License

Licensed under the **[Apache License, Version 2.0] [license]** (the "License");
you may not use this software except in compliance with the License.

## Copyright

Copyright © 2015 Magnet Systems, Inc. All rights reserved.

[website]: http://www.magnet.com/
[techdoc]: https://www.magnet.com/documentation-home/
[license]: http://www.apache.org/licenses/LICENSE-2.0


{'fraction_non_alphanumeric': 0.06391489361702128, 'fraction_numerical': 0.009872340425531916, 'mean_word_length': 4.485994397759104, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 8, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7258982', 'n_tokens_mistral': 3114, 'n_tokens_neox': 2943, 'n_words': 1576}