I wrote this small app as a joke for my daughter, who at the age of 21, still thinks that playing "Punch Bug" (aka "Slug Bug") is fun. Turns out she now has an iPhone.
Thought I would upload and share it since it was an exercise in using:
The libraries it uses are:
For a future version I would like to:
One thing that I haven't solved yet is how to send a text message to multiple contacts at one time.
I used this code to create a string with all the selected contacts:
and then used this code to try and send it:
but I couldn't get the format right and I never received any errors, so I switched it around to send one text for each selected contact.
Any suggestions or helpful hints will be appreciated.
UPDATED To Beta Version 2
I added my idea of a simple Splash screen, which is nothing more than an activity with a single image on it. The image is randomly changed every 1/2 second and moved to a new position on the screen.
The original code was moved to a second module that is started after the timer on the Splash screen is finished. I've also added a touch sub to the Splash screen that would allow the user to stop it and start the second activity.
No new libraries were not needed but it does add a few more learning exercises:
UPDATED To Market Version 1
Just got done publishing in Google Play: https://play.google.com/store/apps/details?id=com.isotoria.punchmaster
Thought I would upload and share it since it was an exercise in using:
- Loading Images into a HorizontalScrollView.
- Loading Contacts (Mobile Only) into a ScrollView.
- Sending a text message and storing it in the message logs
- Using Checkboxes
The libraries it uses are:
- Phone
- Reflection
For a future version I would like to:
- Use PUSH Notification instead of Text Messages. Just haven't had time to look into it yet.
- Log the number of times a Bug Color is Punched. (Then sort bugs so that the most punched bug is displayed first.
- Log the number of times a Contact is Punched. (Then sort contact so that the most punched contact is displayed first.
One thing that I haven't solved yet is how to send a text message to multiple contacts at one time.
I used this code to create a string with all the selected contacts:
B4X:
Dim contactPhone As StringBuilder
contactPhone.Initialize
contactPhone.Append(chk.Tag).Append(",")
and then used this code to try and send it:
B4X:
SendSms(contactPhone,punchMsg)
but I couldn't get the format right and I never received any errors, so I switched it around to send one text for each selected contact.
Any suggestions or helpful hints will be appreciated.
UPDATED To Beta Version 2
I added my idea of a simple Splash screen, which is nothing more than an activity with a single image on it. The image is randomly changed every 1/2 second and moved to a new position on the screen.
The original code was moved to a second module that is started after the timer on the Splash screen is finished. I've also added a touch sub to the Splash screen that would allow the user to stop it and start the second activity.
No new libraries were not needed but it does add a few more learning exercises:
- Get a screens height and width using GetDeviceLayoutValues.Height and GetDeviceLayoutValues.Width.
- Use Rnd(#,#) to randomly load an image and to randomly set the left and top layout of the image.
UPDATED To Market Version 1
- Added AdMob
- Got new app icon from Free ClipArt and Icons 10,000+ | IconBug.com
- Changed the splash screen to only change the color of a single image and added warning about exceeding text message limits.
- Added menu that links to online about, terms, and privacy pages.
Just got done publishing in Google Play: https://play.google.com/store/apps/details?id=com.isotoria.punchmaster
Attachments
Last edited: