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

    • If you are willing to go to approx $200, then as mentioned in your other thread I think a refurbished Pixel 8 will be a great deal that will last you for years. I recently recommended that to someone at work, he was on a strict £200 budget, which got him an excellent conditioned refurbished Pixel 8 here. He's since told me its the best phone he's ever had and feels its a massive upgrade over his old Samsung A series device. I don't know the sites which deal in refurbished devices in the US, however I’m sure you will have some options like we do here. Failing that Ebay is also quite good in my experience. If you wanted something a bit cheaper, then you could maybe go for an older Pixel 7, these will still get security updates until the end of 2027. Even after that you have good third party OS support from LineageOS. It doesn't have to be a Pixel though, you can buy many older devices for a good deal that would be better than a new $100 phone and flash LineageOS to them: https://wiki.lineageos.org/devices/
    • I don't use one drive, but then I don't use any cloud storage, not even Icloud on my mac. If I did use cloud storage, then I would not use One drive, not because there is anything wrong with it, but because I can use Icloud. The only reason I see to use one drive is if your job requires you to have access to it
    • Not built in, which is not a bad thing. There are ways of adding cloud storage to it, Dropbox is the most well know that also have a client for Linux, but there are others.
    • My advice, dont use teams, use the web version if possible. https://teams.microsoft.com/v2/
  • Recent Achievements

    • Reacting Well
      Techinmay earned a badge
      Reacting Well
    • Collaborator
      WndSks went up a rank
      Collaborator
    • One Month Later
      Sopa flores earned a badge
      One Month Later
    • First Post
      StaticMatrix earned a badge
      First Post
    • Week One Done
      StaticMatrix earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      506
    2. 2
      PsYcHoKiLLa
      209
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      89
    5. 5
      ATLien_0
      79
  • Tell a friend

    Love Neowin? Tell a friend!