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
https://www.neowin.net/forum/topic/974258-android-style-widgets-on-ios/
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.

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

    • No registered users viewing this page.
  • Posts

    • The problem of course is simply that government does not always know best. My point is that agency is taken away from the EU consumer in these cases. I'm sorry, but I do not believe that governments (politicians) are inherently good, and "looking out for me." Primarily they look to themselves and their own personal desires first, foremost, and always. When the EU or the DOJ fines these companies, claiming to "represent the welfare of the consumer," how much of these billion-dollar judgments are handed to the consumers they claim to represent? Not even a dollar, as I've seen. Yet the EUC lawyers who are paid to sit around and dream up these suits make huge commissions on the fines the EUC adjudicates, which is an ironclad fact I hope everyone is aware of. It's also rank corruption, of course, but that's another topic. Last, when the EU inflicts these judgments, or the DOJ, take your pick, the costs are bundled right along in the cost of the goods and services these companies provide the consumers they are "looking out for." If you are someone who believes his government is his savior then you have my condolences. I think Apple is right here, because the whole scheme of consumer choice is that consumers pick and choose among the products companies offer. Microsoft Windows is more compatible with third party software and hardware than any desktop OS on Earth, which is my sole reason for choosing it. Just because the EUC forces companies do certain things it knows the companies do not want to do, "or else", has no bearing on consumer benefit. This Siri thing is almost idiotic it's so infantile. But this is what the EUC does when the EU in Brussels becomes cash-strapped and needs a big infusion of cash. Some people get upset by "big companies" but it's the opposite when governments dwarf the size and scope of these companies, which is so obvious it hurts.... I mean you can't honestly believe that forcing Apple to do things with Siri it has its own reasons to decline is something that "opens up" Apple, do you? Say it aint' so...
    • Looks like many years since the request was made, a directory tree view finally may be added. https://github.com/files-community/Files/pull/18537
    • There's this from last year https://gist.github.com/threat...364659a8887841aa43deca4efd9 but nothing about a buffer overflow that MS somehow can't code against. No matter what, it makes sense to take a "protected by default" approach.
  • Recent Achievements

    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
    • Reacting Well
      Techinmay earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      PsYcHoKiLLa
      212
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      84
    5. 5
      FloatingFatMan
      72
  • Tell a friend

    Love Neowin? Tell a friend!