Android style widgets on iOS


Recommended Posts

I've been messing around with this for a while, but I figured I'd post it up here and see what people made of it. It's a mod by a guy called wyndwarrior, that adds Android style html widgets to iOS pages. Now there isn't interactivity at the moment, but he does know how to do it (and shows it in his WP7 "theme") but he hasn't added it to this free mod yet. Normally I wouldn't post something like this up here, but granted the thread recently Why doesn't iOS do Widgets It seemed like it was worth it. Yes it does require a jailbroken phone, sorry vanilla people. All of the widgets are HTML and JS based, some have been taken from dashboard widgets and even widget builder sites.

From the Author:

Authors Thread on ModMyi

attachment.php?attachmentid=494700&stc=1&d=1294283407

Instead I offer you per-page HTML wallpapers. With this, you can have dynamic, (not yet) interactive backgrounds on every page. Things such as having a widget on each page, having a different animated background on each page or even an entire theme based off of interactive HTML widgets.

[Download] (Or in Cydia)

=====================================

Creating Page Widgets

=====================================

A widget is simply a folder under /var/mobile/Library/PerPageHTML, this folder is the name of your widget and will also be displayed in the PerPage app. A typical widget consists of a Widget.html or a Wallpaper.png or both. In the case of both, the Widget will be displayed on top of the wallpaper.

(Look at example widgets for more info)

The first thing to do is to make a folder under /var/mobile/Library/PerPageHTML

(NO SPACES)

This folder should be the name of your widget, and will also hold the contents of your widget.

Once you have created the folder, inside of it put a Widget.html and/or a Wallpaper.png. The Widget.html is a standard html file and the Wallpaper.png must be a 320x480 png file, or a 640x960 file.

To activate a widget, launch the PerPage app

attachment.php?attachmentid=499586&stc=1&d=1295826432

The select the widget

attachment.php?attachmentid=499587&stc=1&d=1295826432

Then choose a page for the widget to be displayed on. If you wish for that page to display nothing, select none and then the page.

Source Code:

	NSDictionary *myDictionary = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/PerPage.plist"];

	NSString *str1 = [myDictionary valueForKey:@"SpotLight"];
		if(str1 && ![str1 isEqualToString:@"none"]){
			if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str1]]){
				UIImageView *wallpaper1 = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
				wallpaper1.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str1]];
				[self addSubview:wallpaper1];
			}
			if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str1]]){
				UIWebDocumentView *docView1 = [[[UIWebDocumentView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)] autorelease];
				[docView1 loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str1]]]];
				[docView1 setBackgroundColor:[UIColor clearColor]];
				[docView1 setDrawsBackground:NO];
				[self addSubview:docView1];
			}
		}

	for(int i = 1; i<=11; i++){
		NSString *str = [myDictionary valueForKey:[NSString stringWithFormat:@"Page%d", i]];
		if(str && ![str isEqualToString:@"none"]){
			if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str]]){
				UIImageView *wallpaper = [[UIImageView alloc] initWithFrame:CGRectMake(i*320,0, 320, 480)];
				wallpaper.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Wallpaper.png", str]];
				[self addSubview:wallpaper];
			}
			if([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str]]){
				UIWebDocumentView *docView = [[[UIWebDocumentView alloc] initWithFrame:CGRectMake(i*320, 0, 320, 480)] autorelease];
				[docView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Library/PerPageHTML/%@/Widget.html", str]]]];
				[docView setBackgroundColor:[UIColor clearColor]];
				[docView setDrawsBackground:NO];
				[self addSubview:docView];
			}
		}
	}

Widgets

Facebook Contagon

Endroid speedfeak228

Facebook + Twitter SnowLeo

Twitter JesseDegenerate

LowerAW Sheff1889

XBOX + PSN Gamertag MikeTheTech

RSS Weak-Sauce

RSS Jephre

HTC clock tieuthienvuong

Glow hsus

SimplScreen rossrossross

HTC clock BR0MERZ

Gallery Slideshow

**Note for the gallery slideshow you have to edit the slideshow.html in the "private" folder to the name of the files in your camera roll.

Examples

Slideshow

IMG_0814.PNG

Twitter

546958631.PNG

Normal HTC clock with animated weather

574466891.PNG

HTC clock + RSS feed

IMG_0807.PNG

Link to comment
Share on other sites

Massive Android clock + iOS looks retarded (first picture). Others aren't too bad.. If you have the money to get an iOS device you have the money for an android phone; why make your phone look retarded by mixing them like this.

Link to comment
Share on other sites

Jailbreaking for widgets is nice...but it will be severely limited. We really need support in iOS so that app writers have an API to make widgets with. Widgets that are in complete sync with Facebook, Twitter, and Mail Apps would be awesome.

Lockinfo may be of use to some of you wanted calendar etc... It costs around $5. Bought it last year and have never looked back!

So far, this is the best app I've been able to find. This brings a "digest" view of SMS, Email, and Calendar to your lock screen.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.