iMonk Release 1

Monkey Targets Forums/iOS/iMonk Release 1

xzess(Posted 2011) [#1]
Hello,

Some update of the native iMonk App which supports the imonk Module


iMonk is a module which adds some iOS features to Monkey.

you can grab it here (latest version 1.5, sorry description in this thread is outdated.. added native cocoa UI stuff, mapAPI, corelocation):
Http://www.tim-koepsel.info/imonk.zip

You'll need to use a custom target, so download
http://www.tim-koepsel.info/target_ios.zip

and extract it to the /monkeyhome/targets/ directory (please backup before!)




View current example how to combine xUI with imonk

imonk Wiki : http://www.tim-koepsel.info/imonk/
xui Wiki : http://www.tim-koepsel.info/xui/

**** iMONK Functions ****
Function UICreateMap(x1#,y1#,x2#,y2#,userlocation:Bool)
Function UICreateTextView(Text$,x1#,y1#, x2#, y2#)
Function UICreateNavigationBar(title$, x1#, y1#, x2#, y2#)
Function UICreateProgressBar(progress#,x1#,y1#,x2#,y2#)
Function UICreateWebView(Url$,x1#, y1#, x2#, y2#)
Function UICreateSwitch(checked:Bool, x1#, y1#, x2#, y2#)
Function UICreateLabel(text$,x1#, y1#, x2#, y2#)
Function UICreateActionSheet( Title$,CancelButtonText$, DestructiveButtonText$)
Function UICreateAlert( title$,message$,caption$ )
Function UICreateButton(text$,x1#,y1#,x2#,y2#)
Function UICreateTextField(placeholder$, x1#, y1#, x2#,y2#)
Function UICreateScrollView(ScrollViewWidth#,ScrollViewHeight#,ContentWidth#, ContentHeight#)
Function UIOpenEMail( address$,subject$,body$ )
Function UIOpenBrowser( URL$ )
Function Vibrate()
Function HTMLQuery( URL$ )
Function DebugLog( message$ )
Function SaveAppPreferences( key$,value$ )
Function LoadAppPreferences$( key$ )
Function GetBatteryStatus$()
Function GetITunesName$()
Function GetDate$()
Function GetDeviceType$()
Function GetSDKVersion$()
Function GetLocalisation$()
Function GetUID$()
********


Query a Website and receive as String:
- HTMLQuery( URL$ )

Add Message to Debug Log
- DebugLog( message$ )

Save your Data in App Registry:
- SaveAppPreferences( key$,value$ )

Load your Data from App Registry:
- LoadAppPreferences$( key$ )

Get Battery Status as String
- GetBatteryStatus$()

Get the ITunes Username of Device User:
- GetITunesName$()

Get the current System Device Date as String:
- GetDate$()

Get Device Type (IPod, IPhone, IPad) as String
- GetDeviceType$()

Get current SDK Version of Device
- GetSDKVersion$()

Get the Localisation (Country/Language) of the Device
- GetLocalisation$()

Add Message to default E-Mail Client
- UIEMail( address$,subject$,body$ )

Open default Browser and navigate to URL
- UIBrowser( URL$ )

Alert Messagebox:
- UIAlert( title$,message$,caption$ )

Vibrate Device (SDK 4 only):
- Vibrate()

Get unique Identity (Very useful if you don't want to get into a mess with different devices!)
- GetUID$()

Here is a screenshot of a example build which is included in iMonk.


Here is a quick example of iMonk which compiles fine with the latest monkey version:
Import imonk
Import mojo


Class imonkTest Extends App
	Field ITunesName:String
	Field BatterieStatus:String	
	Field GoogleQuery:String
	Field SystemDate:String
	Field DeviceType:String
	Field SDKVersion:String
	Field Localisation:String
	Field SaveDataTest:String
	
	Method OnCreate()
		SetUpdateRate(30)
		
		SaveAppPreferences("test","successful")

	End
	Method OnUpdate()
		VibrateTest()
		GetInfo()
	End
	Method OnRender()
		Cls
		DrawText("ITunes Name: " + ITunesName,0,0)
		DrawText("Battery: " + BatterieStatus,0,30)
		DrawText("System Date: " + SystemDate,0,60)
		DrawText("Saved Data: " + SaveDataTest,0,90)
		DrawText("Device Type: " + DeviceType,0,120)
		DrawText("SDK Version: " + SDKVersion,0,150)
		DrawText("Localisation: " + Localisation,0,180)
		DrawText("Google Query: " + GoogleQuery,0,230)
	End
	
	Method GetInfo()
		ITunesName = GetITunesName()
		BatterieStatus = GetBatteryStatus()
		GoogleQuery = HTMLQuery("http://www.google.com")
		SystemDate = GetDate()
		DeviceType = GetDeviceType()
		SDKVersion = GetSDKVersion()
		Localisation = GetLocalisation()
		SaveDataTest = LoadAppPreferences("test")
	End
	
	Method VibrateTest()
		If(TouchDown(0)=True)
			Vibrate()
			DebugLog("It shakes...")
		End
	End
	
End

Function Main()
	New imonkTest
End


Much more will follow soon!
If you want to help, just drop me a mail

Maybe Mark can add it to the module registry or include it in V42

If there are any problems/bugs etc please share here


therevills(Posted 2011) [#2]
Very cool! Thanks! Maybe Google code it?


xzess(Posted 2011) [#3]
Added: http://code.google.com/p/imonk/

I finished all testing on real device.
Pretty cool, everything works fine!
the example is a bit laggy cause of getting all informations (+ website query) together each frame.
Of course you would do it some other way, but i wanted to provide a quick example

Anybody using iOS 3.0 can test this on a real device?


xzess(Posted 2011) [#4]
Anybody wants to help me to wrap InAppBilling?

Im really hot on this, but i guess i am not the only one ^^

(Not good that its not possible to delete a post ^^)


OvineByDesign(Posted 2011) [#5]
That's really useful thanks for sharing


matt(Posted 2011) [#6]
Thanks for sharing this.

Have you considered GameCenter integration?


Qcat(Posted 2011) [#7]
That's Really handy!

is there any keyboard support that you plan to add. also game center support would be nice.

Thanks

Qcat


xzess(Posted 2011) [#8]
Anybody knows how to upload to google code? ^^


@QCat:

Virtual Keyboard isn't my priority atm because you can simple work around by doing your own keyboard with images.
But i have it in my mind!


Here are some functions im currently working on, not finished yet but maybe someone can help to finish it.

#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>
#import "GCHelper.h"


String GetGPSData()
{
CoreLocationController *CLController;
CLLocationManager *locMgr;
CLLocation *location;

self = [super init];
 
	if(self != nil) {
		self.locMgr = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
		self.locMgr.delegate = self; // Set the delegate as self.
	}
 
	
CLController = [[CoreLocationController alloc] init];
	CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
NSString *stringResponse = [location description];

[self.locMgr release];
[CLController release];
[super dealloc];
	
return String(stringResponse);
}


String GetCLSpeed (CLLocation *location) {
	NSString *speed = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
return String(speed)
}
String GetCLLatitude (CLLocation *location) {
	NSString *latitude = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
return String(latitude)
}
String GetCLLongitude (CLLocation *location) {
	NSString *longitude = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude];
return String(longitude)
}
String GetCLAltitude (CLLocation *location) {
	NSString *altitude = [NSString stringWithFormat:@"ALTITUDE: %f", [location altitude]];
return String(altitude)
}


void GameCenterAuthenticateLocalUser { 
    if (!isgameCenterAvailable) return;
 
	
	 [[GCHelper sharedInstance] authenticateLocalUser]
	 
    NSLog(@"Authenticating local user...");
    if ([GKLocalPlayer localPlayer].authenticated == NO) {     
        [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:nil];        
    } else {
        NSLog(@"Already authenticated!");
    }
}
bool isGameCenterAvailable() {
// check for presence of GKLocalPlayer API
Class gcClass = (NSClassFromString(@"GKLocalPlayer"));

// check if the device is running iOS 4.1 or later
NSString *reqSysVer = @"4.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer compare:reqSysVer 
                                       options:NSNumericSearch] != NSOrderedAscending);

return (gcClass && osVersionSupported); }
}



anawiki(Posted 2011) [#9]
This is awesome thing! It would be great to have virtual keyboard - making own keyboard isn't as much fun and lowers end user experience.

I am just starting iOS adventure so can't help much with new features, but if I need something that's not ready yet then for sure I'll add it to iMonk.


therevills(Posted 2011) [#10]
Anybody knows how to upload to google code?


We've been using Tortoise SVN:

http://tortoisesvn.tigris.org/

Makes it very easy to commit to Google code.


xzess(Posted 2011) [#11]
Thanks man, i'll give it a try


Shinkiro1(Posted 2011) [#12]
This will be very useful. Thanks man.


Rob Pearmain(Posted 2011) [#13]
Where is the code now? The xpress link is dead and google code contains no downloads :-(


CopperCircle(Posted 2011) [#14]
Hi Rob, I have the iMonk module, I could email it to you?


MikeHart(Posted 2011) [#15]
Hi CoperCircle,

could you please email that to me too?

mike ( a t ) whiteskygames ( d o t ) com

That would be awesome!
Michael


Rob Pearmain(Posted 2011) [#16]
Yes please, rob ( a t ) ipear ( dot ) co ( dot ) uk

I have had a go myself at implementing some ios code, and have posted a "tutorial" here:

Click here for tutorial


Rob Pearmain(Posted 2011) [#17]
Yes please, rob ( a t ) ipear ( dot ) co ( dot ) uk

I have had a go myself at implementing some ios code, and have posted a "tutorial" here:

Click here for tutorial


xzess(Posted 2011) [#18]
hey there, nice to see some progress in the ios section of monkey :)
didn't watch this board for months for now due the lack of time
i will upload a new imonk release soon, currently beeing underway on business journey with my macbook air, i have imonk and my monkey stuff on my PC

i will also release xUI then for public


TheRedFox(Posted 2011) [#19]
Update: got the zip but still...

Hard to get the stuff as "The site xzess.org has been disabled. Please contact support."

Is there a SVN somewhere?


Xaron(Posted 2011) [#20]
You can it download in my german forum: http://www.monkeycoder.de/forum/viewtopic.php?f=17&t=75

or here: http://code.google.com/p/imonk/

I'll ask if he's still around.


TheRedFox(Posted 2011) [#21]
Google code looks like empty.

Looks like it uses mercurial (hg) but doing the clone doesn't turn anything back.

Thanks for the download link!


xzess(Posted 2011) [#22]
Download link updated!

Version 1.5 now supports Mapkit, Location, UIStuff like Actionsheets, alerts, textviews, scrollviews, labels, switches, buttons, webviews and more!


benmc(Posted 2011) [#23]
Could you help explain the MIT license? Do we need to put a copyright notice in our games, or some other disclaimer, like a TOS or something when the game starts that references using this code, or do we only have to accompany source code with the license / copyright?


xzess(Posted 2011) [#24]
well to be honest, i didn't look further into the MIT license..

But you are allowed to use it freely without any royalities or credits.
You are not allowed to sell it as your own work!

Same for xUI portable


xzess(Posted 2011) [#25]
iMonk will have its own App called the same name.
It will be on iTunes within the next 14 days.

The first version will be free, so you can support the development with your advices or tips for improvement.

Current Features:

- Code your monkey app/game while you are on travel with the code Editor directly on your iOS Device
- Export the code to iTunes or send it via E-Mail to you PC

Planned Features (currently WIP) :

- Design your cocoa Interface directly with iMonk and export to monkey Code (requires latest iMonk)
- Add and Share your Code Snippets and templates to the iMonk Community
- Use helpers for 2D Coordinates and Accelerator for example


Here are some early screenshots:




I will post a link when it will be in the store


samowitsch(Posted 2012) [#26]
I hope you make a universal version that it work on the ipad too.

Build & Run is not possible i think, this would be the killer feature ;o)


xzess(Posted 2012) [#27]
Hi, well First i started with the idea to make an iPhone App "Server" which can receive Data from pc over WLAN, so you have iMonk pc Version which let you test / run monkey Code directly on you device by sending commands to the Server App on the device!
Upload image for example, or LoadImage or DrawImage for example. So you would be able to See your monkey code live on your device
Unfortunately im very sure that Apple would reject it.


TheRedFox(Posted 2012) [#28]
Cydia may prove useful...


xzess(Posted 2012) [#29]
Hi, since jailbreaking destroys warranty and allows illegal operations its no Way and no solution for most, as a Developer you should have in mind that jailbreakers are killing the Stores and the few Dollars and earnings a Developer would get! You can be sure that Apple Know their jailbreakers/lawbreakers and will go against some time. Even a reset dont hide to be a jailbreaker because there will be still many Files left which points out that the device has been illegale jailbreaked.

Greetz


xzess(Posted 2012) [#30]
Here is a video Preview of the upcoming iMonk 1.1 Update for iOS

http://youtu.be/Pjnnv7Bc6qM


EdzUp(Posted 2012) [#31]
Nice idea but I aint paying £5.49 for it, especially when there are other text editors out there


rIKmAN(Posted 2013) [#32]
Sorry to bump such an old thread but all the links and screenshots are dead, and this sounds interesting.

Am I right in thinking this wraps some native iOS GUI elements so you can use them from Monkey?

If so does anyone still have the files knocking around, I also tried hg but as has been said it is empty.

edit: Missed the link to the german forum, got it now.

edit2: It's v1, does anyone have the latest version 1.5?


rIKmAN(Posted 2013) [#33]
Anyone?


rIKmAN(Posted 2013) [#34]
Somebody must know something about this?


Beaker(Posted 2013) [#35]
I know it's dead. I also know that the last version I saw didn't really work because it lacked events/callbacks/delegates for controls. That is all I know.


rIKmAN(Posted 2013) [#36]
Thanks for the reply Beaker, thats all I needed to know, appreciate your time :)

Shame though, we could really do with some proper iOS native stuff from within Monkey.