[XAP] Phone Commander - Windows Phone 7 Development and Hacking

I am working on TCMD equivalent for Windows Phone. It may be:
Two-panel filemanager,
SMS and Mail configurator (groups, searching, backup),
Registry editor (editing, export, import),
Taskmanager (working apps dehydrating, resuming, closing, memory increasing),
Tiles configurator (creating, grouping),
MultiMedia manager (searching, playing etc.),
Applications configurator (uninstalling, grouping),
Keyboard Shortcuts configurator (HTC 7 Pro, Gold, Prime),
and another next by plugins system.
It will use direct access for unlocked ROMs, HtcRoot project (http://forum.xda-developers.com/showthread.php?t=1453343) for full access on (dev and) InterOP unlocked devices (where it is possible), ProvXML method for incompatible devices.
There is first screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Try it, post experiences. This is designed for HTC7Pro hardware keyboard, but must be usable for touch conntrolling too. For big dirrectories (\Windows etc.) scrollbars are necessary. I want to have as far as possible biggest amount of controls on main screen. It may not be a game, it must be working tool. In long future I want integrate also simple programming IDE to this tool.
Newest version will everytime here.
Actual attached version enables for me:
To manage all files very quickly include multioperations (like TotalCmd).
To copy mp3 files to any phone directory by desktop TotalCmd, create playlist on phone and hear music.
To do the same vith movies, photos etc.
To copy e-books from my desktop and read them in phone (formats: doc, RTF - the best reading, pdf etc).
To edit all files in phone (the same formats, include binaries).
To import .reg files to Registry
From version 2.3 added 3s timeout to JPG files shell showing in built-in Pictures application (you can make simple automatic presentation from pictures, videos and sounds in sh file).

Hey man, sounds ambitiously, with the declared functionality it would be a perfect tool Good luck!

I think I will check this out

ap3rus said:
Hey man, sounds ambitiously, with the declared functionality it would be a perfect tool Good luck!
Click to expand...
Click to collapse
I will do, what free time allows me. The rest will simple for everyone, when plugin class interface will good designed (readonly properties top, bottom, size of list, manipulation properties/methods for copying, moving, deleting etc). FilePath (read/write) equivalent can be Group (ringtones, apps) or RegPath (registry), some classes will not allow any part of methods (class Task will not implemented copy and move for taskmanager etc). First I must make spotlessly this data model and user interface, becouse those are the most problematical parts of this app (too small screen, too big area of digit touch etc). My keyboard-only inspiration is very nice FileNote app from S80 Symbian (http://tech.groups.yahoo.com/group/FileNote/messages , http://my-symbian.com/s80/software/applications.php?faq=3&fldAuto=865) , but no everybody has hardware keyboard on WP7. Plugins (libraries) for unique quantities and implementing of any special behaviour (searching, comparing, sending) will secondary parts. The biggest problem is unlocking impossibility for new devices now. M.

Hi Martin,
first look i like your commander.
I will wait next version, good work

Looks *very* cool! Makes me wish my HD7 had a hardware keyboard though; this will be hard enough to use with touch on a 4.3" screen and will be a lot harder on something like the Surround or Trophy. I must admit that the inspiration (two-panel file managers, which date back to at least Midnight Commander and possibly further) appeals strongly to my nerd side.
I'll try my best to make sure that HtcRoot is available for this to use on as many phones as possible (probably all first-gen HTC, second-gen may never be possible without a new exploit).
One suggestion: just make the file lists scrollable using swipes (it's a built-in control that you put the other controls within). The scrollbars take up non-trivial screen space and are actually kind of hard to use with fingers. Also, tapping on "ext" is *way* harder than it looks like it should be; even moving in tiny increments I tend to go from tapping "FileName" to tapping "datetime" directly.

Hi GoodDayToDie. Thanks for your support. My first mind was to use standard WP7 scroll controls. But, there are two reasons to implement own control.
1. amount of files \Windows directory in WP7. I use TouchExplorer every day, but working with \Windows directory is worry in it. Then I need control, which is quicker for big lines ammount (implementable by any part of filenames reading immediatelly and pre-loading some amout to seek in scrolling time).
2. Total commander has very sofisticated file subset signing to select operation set (file can be selected/unselected or to have focus independently). Try select 10 files beginning by diffrent characters in Touchexplorer in \Windows directory and after it try copy one another file. This is operation to 10-15 minutes in TouchExplorer. I do not know, if control behaviour is simply changeable in WP7. I am planning to have one self made control with scrollbars for big directories and one inhereted from WP7 standard with simple changes (if possible) and without scrollbars for small ones. I am low-level C/C++/etc programmer, then I must study Silverlight/C# possibilities first.

i am looking for a function that auto on/off 3G had scheduled times, much like what android apps do
is this possible with yr xap??

Magpir said:
i am looking for a function that auto on/off 3G had scheduled times, much like what android apps do
is this possible with yr xap??
Click to expand...
Click to collapse
Scheduling is in the future plane. I have a lot of to do with higher priority first. I seen any "Tasks" application on MarketPlace for scheduling. Try it, may be it is able to schedule system changing.

Martin7Pro said:
Scheduling is in the future plane. I have a lot of to do with higher priority first. I seen any "Tasks" application on MarketPlace for scheduling. Try it, may be it is able to schedule system changing.
Click to expand...
Click to collapse
those apps in the marketplace only give u a reminder.
i need the app actually disable/enable things at a given time.

GoodDayToDie said:
Looks *very* cool! Makes me wish my HD7 had a hardware keyboard though; this will be hard enough to use with touch on a 4.3" screen and will be a lot harder on something like the Surround or Trophy. I must admit that the inspiration (two-panel file managers, which date back to at least Midnight Commander and possibly further) appeals strongly to my nerd side.
...
Click to expand...
Click to collapse
I have a question:
Normally, in C++, I will make basic plugin class, inheritable to 3rd plugins dlls. When interface will changed in future, I will use multiple inheriting of additional behaviour class, in reverse order for "old generation" plugins.
But, what is the best practice in phone C# ? Multiple interfacing? Or dependency injection is implemented here? I must use something very simply for easy plugins creating. M.

If I understand what you're asking about correctly, multiple interface inheritance is probably your best bet, since .NET doesn't support multiple class inheritance. This usually means you need to have some kind of external factory as well, since interfaces can't have constructors or static methods.
Implementation-wise, one way to do this is to simply wrap the older objects, and pass calls to their interfaces through to them. This isn't ideal and still requires non-trivial coding, but it does provide good encasulation and relatively good code sharing. Dependency injection using Reflection APIs is certainly also possible, but requires some work.

I am "old school" OOP Programmer, then I must study it much. Main problem is: I know interface for files, registry, tasks etc just now. But, application must accept today unknown interfaces in future by little addition only, without recompiling old generation plugins. Then I explain previous question: Are interfaces and namespaces in C# able to solve this problem? To have one interface for today plugins, new interface will added after any months and using one or second automaticly? TotalCommander solves it by different plugins extension (*.wfx , *.wcx etc), but, I mean, it is not right way in 21 century. Second problem is: Every plugin can contain more system access methods (Standard MS WP7 API, ProvXML, your HTCRoot, fiinix's CSharp_DllImport, something new...). Every this method need not be copletely implemented in all plugins, any common base may be stored in one library for each access method and plugins will prepare only parameters for them. When design will the best, old generation plugins can use future access methods too. Access methods can be sorted by priority (probably related to method speed), plugins must use highest method priority, which is allowed on device. If plugin will not know any hi priority access method itself, must automaticly hand over its pursuance to any newer library. What modern method I must study for mentioned behaviour?

Thanks man looks very good

I think that doing this is going to require the use of the Reflection APIs. In essense, these let you load assemblies (collections of classes, typically in namespaces) from .DLL files (by name), and let you load classes from within assemblies, and let you call functions of those classes.
Probably the easiest way to do it is a function pointer table. In .NET, function pointers are called "Delegates" and are technically objects (like everything, including primitive types) but they pretty much work exactly like strongly typed C++ function pointers.
When the app starts up, it looks in a known location (or possibly queries the registry, or something) for DLLs containing extensions. It then loads the assemblies from those DLLs. Each assembly should have a registration function (probably a static method o a static class) that returns a collection of delegates (and their priorities, if needed). Your app then uses those to build a function table that it uses whenever it needs to do a specific type of operation.
For example, you could have one entry in the table for "WriteFile" and might get function pointers for it from one assembly that uses the native APIs with no special permissions (works for some custom ROMs, or after using HtcRoot), one that uses isolated storage APIs (works for any ROM, but only to a specific folder), one that uses HtcFileUtility.dll (the driver that TouchXplorer uses), one that uses ntive APIs but wraps every call in an elevation call to HtcRoot, etc. It would be up to the framework (meaning up to you, if you're designing it) to define some way to indicate which one to use.
All that said, while extensibility is an excellent goal and probably necessary in the long run, you might want to just get a proof-of-concept working that is hard-coded to use a single known approach. Reflection isn't actually that difficult, but it seems like a distraction from getting a first version out the door. Release early, release often, and all that.

I must finish other important work, after any days I will continue here. I will use simpliest way, which coul not be the best, but it will quick and independent. M.

very cool
good luck

Good luck with this app. Please drop me a PM when you finish so that I can feature it on the XDA front page.

Martin7Pro said:
I am working on TCMD equivalent for Windows Phone. It may be:
Two-panel filemanager,
SMS and Mail configurator (groups, searching, backup),
Registry editor (editing, export, import),
Taskmanager (working apps dehydrating, resuming, closing, memory increasing),
Tiles configurator (creating, grouping),
MultiMedia manager (searching, playing etc.),
Applications configurator (uninstalling, grouping),
Keyboard Shortcuts configurator (HTC 7 Pro, Gold, Prime),
and another next by plugins system.
It will use direct access for unlocked ROMs, HtcRoot project (http://forum.xda-developers.com/showthread.php?t=1453343) for full access on (dev and) InterOP unlocked devices (where it is possible), ProvXML method for incompatible devices.
There is first screenshot:
There is also Pre-Alpha User Interface demo only xap.
Try it, post experiences. This is designed for HTC7Pro hardware keyboard, but must be usable for touch conntrolling too. For big dirrectories (\Windows etc.) scrollbars are necessary. I want to have as far as possible biggest amount of controls on main screen. It may not be a game, it must be working tool. In long future I want integrate also simple programming IDE to this tool.
Click to expand...
Click to collapse
Err, why are you using drive letters like C:\? We all know Windows CE doesn't use such things. I think adding artificial drive letter paths will just confuse users in the long run. If they're going to be navigating the filesystem, they might as well learn how to do it right. But if you really must do this, at least make it easily disabled.
Also, are those native Windows CE common controls in the screenshot?

@Martin7Pro: One suggestion: with the semi-imminent release of WP7 Root Tools 0.9, which will allow elevating arbitrary apps (and will support more devices than the HtcRoot project), I suggest you focus on just using native APIs and don't worry about permissions. It will already work on full-unlocked ROMs, it will work on all devices that are supported by WP7 Root Tools once it releases, and it will be easy to add support for HtcRoot if for some reason that saspect of the project is still relevant.
I've got some exciting other directions I want to go with HtcRoot, like seeing whether I can modify ROM files or do other crazy things like that (it might be possible, what with the ability to tweak driver code directly). The elevation to TCB ("Admin") and policy-engine work was (and still is) a stepping stone to get there, but with WP7 Root Tools 0.9 supporting the most important policy engine changes directly, that's less of a concern now.

Related

(STOPPED) New Omnia graphic shell

The development of this project has come to a stop.
I'll post any future update here, in case the project will resume.
Thanks for your support.
------------------------------------------------------
UPDATE 03/12/08 - Images added + Lock Screen Demo
Hey all,
i've been following the board for a little. I'm an lucky Omnia owner and i really love it, particularly it's versatility.
I just regret the lack of cool interfaces (put Manilla 2d aside, it's awesome, but it's like having an htc device on our phones, not very exclusive).
Here are some quick layouts of an idea I had today, it's practically just eyecandy stuff, maybe not the top usability around but, you know, in our life we must satisfy ourselves...
So here they are, a portrait and a landscape view of what's laying in my mind:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
the home screen design:
the lock device screen:
-the audio profile control
- Programs folder
- Contacts page
the idea is to have a spinning wheel of icons, that allow to navigate between the main ambients of a mobile shell when tapped, just like SPB mobile shell or manilla, only more "graphic". The thing is conceived to be touch driven, with hrizontal sliding to spin the icons wheel and a vertical slide to access a secondary menu.
Actually the design phase is still underway, more screens will come.
-------------------------------------------------------------------------------
OMNIA USERS ONLY
>>>HERE<<< is the FIRST RELEASE OF THE SCREEN LOCK, coded by DeimosLP at MoDaCo.
Just unzip it everywhere you want and launch OmniLock.exe.
THIS ISN'T MEANT TO BE USED EVERYDAY at the moment, probably it drains battery very fast, haven't tried yet on long usage times.
A few notes about it:
- this is somehow a mockup since not everything has been implemented properly and we are still working on performance issues
- the main goal of this release is to get feedback and new ideas so we can improve the usability
what has been done :
- clock+date
- missed calls counts/sms count/mails count
- swing to unlock
- fade out on unlocking
- cool breathing "swing" logo
- fade in/out of the clock digits
what remains to be done:
- phone status and audio profile integration (as seen in the design)
- xml configuration file
- close the application on incoming call
- a lot of code cleaning/performance fixing
- interact with Speleomaniac's launcher
Cheers.
Hellbender.
this is a neat idea, here's what i think would make it even more practical for use and won't just fall off after its been developed. Cuz the problem with good ideas is that they aren't good enough to keep and people always switch back to some other interface...
here's my thought:
Take the portrait pic you have posted for example... Maybe you should shift that Spinner of tabs closer to the top of the screen, then have a spinner on the bottom half of screenshots of running programs, something like taskfacade or visualtaskswitch in the spinner style as well!! I think that would be freakin AWESOME and would really be functional from that front screen.
Its simple, attractive and would be incredibly functional... what else would ya need?
So yeah, 2 spinners, one of tabs, one of screenshots of open tasks (maybe even a zoom animation when you tap on an open task, just like visual task switcher)
whatdya think?
Yah, the idea is to have differente spinners of icons layered vertically (the green arrow pointing up means you can go up another level).
In landscape view looks difficult to have the secondo wheel visible, but the portrait version could be more useful with more than one visible at a time.
About the open task switcher, that would be awesome! I thought about it but i didn't want to push it too far from the beginning, but i agree it would be really useful. And i agree about zoom animation.
The only problem right now is that i need a programmer to do the "dirty" job, cause i'm just a designer, i don't have the knowledge to do that.
Still waiting for a sign
Cheers.
Hellbender
maybe, when you turn landscape, the icons just twist 90degrees, and the spinner becomes up/down, rather than left/right...
I'm a designer too, so i feel your pain... I throw together some wicked ideas but can't seem to find someone who will put it together... developing is VERY time consuming Wish i knew how
it will be difficult to remove the window bars and softkeys while keeping the touchflo.
This will have to be done in C++ (basically rework the whole frontend.) -meaning we need to know alot about each API to be able to create a flawless frontend that works with WM6.0+ backend
This will be quite a project.
I like how it looks
Integration will be the most beneficial way and with the best performance
zeezee said:
...Integration will be the most beneficial way and with the best performance
Click to expand...
Click to collapse
I'm prone to get to an accomodation with the Os limits, could be great just having that with bars, i tought it was cool without, but not essential. Performance are, indeed, crucial.
This is ment to be kinetic, so it must be as quick as possible mantaining a cool appearance. Initially i proposed an app made in flash lite thinking that could have some os interface tweaking overridden with a fullscreen app (and keep things easier for me to animate), but i suppose it isn't performing like a full c++ app.
Still looking for a coding partner
S2P
The album selection in the S2P software is somehow similar to what you are looking for, maybe you could ask it's developer for some help.
Please make it customizable: Let each one chose what software each icon is gonna open. It's easier if each icon opens a panel where you can configure any plugin you want. Make it a Launcher.
Great Idea!
dmro said:
The album selection in the S2P software is somehow similar to what you are looking for, maybe you could ask it's developer for some help.
Great Idea!
Click to expand...
Click to collapse
Don't know, i'm sure he follows these boards, so if he haven't gave a word here it is because he doesn't like the project, or have no time to spare. I don't want to bug anyone to take a part on my project, that's not a job.
dmro said:
Please make it customizable: Let each one chose what software each icon is gonna open. It's easier if each icon opens a panel where you can configure any plugin you want. Make it a Launcher.
Click to expand...
Click to collapse
It's what it mean to be right now. And i thought that customizable icons/apps was a must feature, cause everyone uses his fave apps for everything, and it's difficult to write an entire suit of applications with this visual approach, many tasks would bel impossible.
hellbender_it said:
Don't know, i'm sure he follows these boards, so if he haven't gave a word here it is because he doesn't like the project, or have no time to spare. I don't want to bug anyone to take a part on my project, that's not a job.
It's what it mean to be right now. And i thought that customizable icons/apps was a must feature, cause everyone uses his fave apps for everything, and it's difficult to write an entire suit of applications with this visual approach, many tasks would bel impossible.
Click to expand...
Click to collapse
I would presume he didn't see your thread since the first time you read it, it looks to be about some special interface for the omnia, and he doesn't own one. Just PM him anyway.
I would suggest you change your thread name to one which attracts the attention of the appropriate people.
I would love to see development for this project, and I'll do my best to help, I have an omnia, so atleast I can BETA test it out and provide feedback or w/e required.
Akshay
Something like flShow Carousel...
Click on the different examples...
http://www.flshow.net/carousel_examples.php
That would be awesome
EDIT: And make it for all devices!!!!
WildSioux said:
Something like flShow Carousel...
Click on the different examples...
http://www.flshow.net/carousel_examples.php
That would be awesome
EDIT: And make it for all devices!!!!
Click to expand...
Click to collapse
Exactly, same concept, but touch driven and with inertia. Very cool examples.
About the all devices subject, well if that depends on me i can make the graphic assets for every platform i think, with the given time obviously.
hellbender_it said:
Exactly, same concept, but touch driven and with inertia. Very cool examples.
About the all devices subject, well if that depends on me i can make the graphic assets for every platform i think, with the given time obviously.
Click to expand...
Click to collapse
I don't know anything about coding for PPC/WM. But I have used the above examples of flShow Carousel that I posted above for a website.
Aside from the flash in that, it uses XML. Since dazzlingdaz built a GUI using only XML http://forum.xda-developers.com/showthread.php?t=407900 I wonder if its possible to implement the flShow XML in that somehow?
BTW, the flShow Carousel uses inertia as seen in the "Mouse Interaction" example.
EDIT: I just noticed this on the flShow website...
Stand alone applications
The Carousel can be used in stand alone applications (like Delphi and C++ applications). Provided that you know how to embed flash movies in applications (and you also know how to handle fscommands issued by the movie), you simply have to associate fscommands to your photos:
<photo href="fscommand:mycmd" target="myparm">path/image.jpg</photo>
Click to expand...
Click to collapse
I have seen some here developing apps under C++ Lets make this happen. With my limited knowledge, I could try helping with some XML code.
mhhh... I'm thinking about a c++ fullscreen app embedding a flash application, this could keep things easy especially when porting the app on other devices (flash lite friendly), so resizing the movie to different resolutions should be like a snap, and the c++ base would allow to access device parameters that are not accessible directly from flash.
Furthermore using flash will allow more control over animations and visual quality from the design side.
Could that be a way?
hellbender_it said:
mhhh... I'm thinking about a c++ fullscreen app embedding a flash application, this could keep things easy especially when porting the app on other devices (flash lite friendly), so resizing the movie to different resolutions should be like a snap, and the c++ base would allow to access device parameters that are not accessible directly from flash.
Furthermore using flash will allow more control over animations and visual quality from the design side.
Could that be a way?
Click to expand...
Click to collapse
There is no easy way of doing. Either you do it complicated in C++ or you do it with C++ and complicated flash.
zeezee said:
There is no easy way of doing. Either you do it complicated in C++ or you do it with C++ and complicated flash.
Click to expand...
Click to collapse
You are right, i'll stop talking about things i don't know.
Things are moving a bit at MODACO
http://www.modaco.com/content/i900-...to-build-a-new-graphical-interface-for-omnia/
There's an interface demo done by a guy over on MoDaCo which is pretty decent for a quick mockup
http://www.modaco.com/content/i900-o...ace-for-omnia/
There's an interface demo done by a guy over on MoDaCo which is pretty decent for a quick mockup
Click to expand...
Click to collapse
Just posted a skinned version.
A little UP cause i'm slipped past the tenth page ...
*bump*
A li'l help from the guyz at xda would be appreciated, things are really moving at modaco and I'm sure they wouldn't mind a little hand from the xda experts.

[App] The Mortifier v0.96 - Your Mortscript coding pal

Hi,
Welcome new and longtime Mortscript coders. This app will bridge the gap between you and coding Mortscript on your phone.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Here are a few limitations we experience as we Mort code more and more.
Getting at It:
So you've set up a a script, Do-Me-Now.mscr, and copied it into a sub folder on your phone. Maybe you even copied it into a sub sub folder because you have so many scripts, like me.
How fast can you browse to that script? Well let's see, Start, Explore, Storage Card, Morts, Testing. There it is! Great! I am here, now I run Do-Me-Now.mscr. And of course, like all new and great scripts, it doesn't run. That only took us clicking four clicks to get there and run it. My thumbs already tired and I have a blister.
Exploring Anew:
Now run another script you have in a different sub-folder. Click up, Click into new sub folder. Keep in mind not all phones File Browse quickly. My phone is more small perhaps than your screen, as well as slower. Small is a pain to see while browsing folders. I feel it every time I click the D-Pad I am committing to waiting. You may have tabbed exploring, but I don't. Then if I want to get back to my old script, browsing back. It isn't simple.
Edit Me Not:
I see my file in the little File Browser window, I can run it, but now I need to edit it. Right Click? Do any mobile phones have a right click button? If mine does I have never seen. My soft menu buttons say "Find" and "Menu". Where is the "Edit File"? Dead end. But wait, I know, we can rename Do-Me-Now.mscr to Do-Me-Now.TXT, and now we can edit it with the default editor. Then save it and rename it to Do-Me-Now.mscr. Well at least we can.
Tomorrow is a Whole New Day:
I've reset my phone. Or the phone auto closed my File Browser. Now I start finger browsing from scratch. No favorite folder list, no default last explored folder is selected. Every time I run File Browser I have to start from scratch.
But Wait, I have More:
It seems I have to run a couple mortscripts in a session of coding. My test app, a windowrecording utility, another app or two. I want to click one app from my start menu, and be in my environment.
More, not Less:
Now I am in my environment, editing is now possible. But I can do more with the clicks I saved, what else? Handy access to your photo browser, registry editor, and screenshot taker (Moves your screenshots as well).
Less, not More:
But wait a sec, can't we just open the text file editor on the phone and start there? Maybe. In the first place, wow, I try and use the best editors on the market on my phone, but they all seem to have very annoying limitations. Some editors can't remember which files we were just editing, no recent list. Some editors have such a terrible document loading interface I was unable to browse for my document at all. This goes for Osymo Textpad as well as Orneta's Notepad. Not to mention, half the apps I tried don't have a close/exit option.
But irregardless, this is not just a launcher of convenience. It is also a launcher of utility.
The Mortifier will be bridging the limitations of working in a tiny mobile environment.
Click to expand...
Click to collapse
Features:
Quick access to prior scripts:
Keeps a library of your prior script edits. Script Modes: Spy run, Select script, Directory search.
Internal Registry Browser & Paster:
Browse the registry, choose the Key you want, and it will be pasted into your Mort code. Edit values. Search could be added to a future version.
Watched Folder Sync:
Bluetooth Sync - Select a destination directory and then you can transfer intended files over through bluetooth transfer. It will move those new files into the destination folder, as well as extract zip files as a directory in the target folder. Storage card sync will be next (As soon as i can connect). Maybe it will keep track of prior target directory in a later version?
Windows install folder cab copier
Window/App Recorder:
Records window titles and application processes, very useful for knowing process names and window titles!
Support for VJTrayLaunch. If you have it installed to the phones main memory, when you run The Mortifier it will put a quick launch to the tray. After you exit The Mortifier you can just click the Tray launcher and it will re-open The Mortifier.
Future Additions(?):
Mortscript Language Code Dictionary:
Browse to the Mortscript command you want to insert into your code and select it. Internal support for Orneta Notepad, but any text editor will work.
Personal IIS web updating. Who needs to wires or BT to update our scripts/cabs/docs/jpgs etc.
Prior Versions:
TheMortifier v0.7 (5.8 KB, 24 views)
TheMortifier v0.8 (5.6 KB, 42 views)
TheMortifier v0.9 (6.4 KB, 25 views)
TheMortifier v0.95 (6.4 KB, 61 views)
Runs with
Added support for VJTrayLaunch. If you have it installed to the phones main memory, when you run The Mortifier it will put a quick launch to the tray. After you exit The Mortifier you can just click the Tray launcher and it will open The Mortifier.
HK is a bit vague,
so i plan to explain the power of what hes doing.
This SOB will allow you to run mscr, because it scanned it.
But the power IMO is the ability to edit your mscr files on the fly right on your handheld!!
nhvoltagenh said:
HK is a bit vague,
so i plan to explain the power of what hes doing.
This SOB will allow you to run mscr, because it scanned it.
But the power IMO is the ability to edit your mscr files on the fly right on your handheld!!
Click to expand...
Click to collapse
couldnt u do this with a regular text editor?
Glad u ask.
This does not replace the functions of a text editor on your mobile phone.
It is a front-end tool. I will list some of the limitations of coding on a mobile phone.
howdykeith ,
I like the idea. When are you planing on getting this out?
Primary release quite soon.
For a couple of the bigger things, like the code dictionary, will follow in the next couple days. Lot of text I will need to reformat, I will.
I've paused working on my other apps so I can get this done and start using it myself.
jug6ernaut said:
couldnt u do this with a regular text editor?
Click to expand...
Click to collapse
Right you could, but whats the process of doing that?
Either open the file, and then select all files, then open the mscr file...
or rename the mscr to a txt file, then open edit resave.
i have a demo version of this now for ppc.
and talk about slick.
heres some screen shots of it
All i do is run the app, select the mscr file, it auto opens it, you edit it press save, and your done.
Hi y'all.
So things are progressing real nice.
I was kind of concerned I was going to have to deal with passing a lot of arrays but it's goin real smooth like.
If anybody wants to try it, give a holler.
Awesome can't wait, thanks for making this.
So an update .
I have finished almost all of the Registry browser. Once I finish the Registry browser path library, I will get back to the mortifier and making the script library for the list of scripts and then i will put out a release.
Screenshots:
Hi
nother update.
I look up at the edit subkey pic and i want it to auto fill the text field. i expect to be able to do that no prob.
Closing in on the finish of the registry browser.
why don't you use c++ or some other program language to develop such a tool?i think that will run more efficiently than a tool developed with a script language.the script language has its own advantage and disadvantage..for exp it's easy to write,run, read ,and modify, but can't afford to operate with numerous data(no database support) ,etc.if i had studied some program language like c c++ c# ,i will develop such a tool with that...however i really appreciate what you do
wei2005yh said:
why don't you use c++ or some other program language to develop such a tool?i think that will run more efficiently than a tool developed with a script language.the script language has its own advantage and disadvantage..for exp it's easy to write,run, read ,and modify, but can't afford to operate with numerous data(no database support) ,etc.if i had studied some program language like c c++ c#
Click to expand...
Click to collapse
As u know, there are a number of programming environments to program in for mobile phones.
.net is a beast. The learning curve is high, and even though i have taken courses in c++, coding on the mobile phone is not high on the course instruction list apparently.
Mortscript is quite similar to c++. For certain purposes, Mortscript is just as valid as any other environment. Sure Mortscript needs to be included or installed, but keep in mind installing .net on a mobile phone takes about 6 megs.
You are correct about the lack of database access, but that would be way overkill for most Mortscript apps, as well as any other app that doesn't need database access.
How much better would any of the apps i have constructed work if they were coded in c++/c#?
That being said, I am continuing to take .net courses, and I would not be surprised if i dont have time to plug away at Mortscript any more once i am full time .net. Who knows?
That all being said, I am just tidying up The Mortifier, and it will definitely be released today or tomorrow...
Hi,
So here is a first release of The Mortifier.
Much works. Some of the more esoteric functions are not working yet, like "kill all Mortscripts".
ToDo:
Registry Find
Auto Detect Text available text editors
WindowRecorder w/screenshots
Folderwatcher
Load recent scripts
Language code dictionary
Add more scripts
Re-set text editor
& Fix what's broke
Any other features that r missing, please alert me!
Because of the re-set text editor and the additional script setter needs to be included, I will be updating the script very shortly...
So we can make menus with kvvQuickmenu. not so sure submenus would work so well. would have to either keep swapping the ini file and restart the menu, which we probly could do, or have the quickmenu exe and ini file in each separate subfolder for each menu... If we did that we could probly also just do it with 2 subfolders. Keeping the first ini intact would be a good idear.
The Mortifier v0.8
Update for The Mortifier:
Command-Line Tester: Browse to the exe and enter your command line parameters. Keeps the old exe and parameters in memory so you can re-test them easily.
Task Manager is a functional menu. If you have a different Taskmanager or one that is built in, let me know and i will have it auto set for that one.
Version 0.9 - Bluetooth Folder Sync
Hi.
Here is version 0.9
There's a couple fixes here and there. WindowAppRecorder has some added info messages. The Mortifier shouldn't leave any temp files any more.
The most major update is to the Utils section. This version adds a Bluetooth folder synchronizer. So if you run the BT Synch option, you will pick the target folder. Then you can bluetooth files over to your phone that you want in the target folder. It will move all the new files that you just bluetoothed over. If you send a zip file, it will ask you if you want to extract the zip as a folder in the target directory. It will timeout after 3 seconds, so if you just wanted to move the zip instead you would click "Move as Archive" instead.
It seems too often I can't send files over cept through bt. usually i can reboot my computer and it is fixed, but often i dont want to reboot. This utility is to bridge the functionality gap for bt transfers.
Not sure why the Auto save/Hider for BT files isnt working, but thats just xtra. Maybe a future update will ask if you want to browse the destination folder when you are done.
Hi howdykeith,
can't wait to get it in my fingers (phone) to hack it. I have to travel sometimes very long. So as the next week. I have to travel from Amsterdam to Moscow and then 13 hours with the train. And that for three days work, that can't be done on remote, aaahhhhhhh.
How uncool is that? But then i have a lot of software on my laptop. A copy of my ROM and no extra accus for my phone, but i have the USB cabel to charge my phone . Then i have the time to check your little app, also the script for ms voice command. And i hope i have a minimal signal of 3G on my phone, then i can be online. And that me, without internet, only wodka, aahhhhh
Hi thanks.
So I did update the app so it wouldn't copy over the stub apps that get deleted when the bluetooth sync is initiated.
also, i did get the Auto hide and save on BT transfer working good. The auto hide will be available on the next release of the StatusTicker app as well...
Also the bluetooth auto transfer hints to the current number 1 script directory. That works real well.
Added the function for auto cab install through BT transfer. I may add "Auto detect BT dir" for wm6. I probly will remember to add Storage Card sync to do the same as BT sync.
Added is support for VJTray Launcher.
I likely may add a VJTray Launcher Library Util.
VJTrayLaunch is only for launching a small number of apps. Don't use it for 15 etc (due to the 32 task limit on WM)
Click to expand...
Click to collapse
Maybe not this next release? But soon.
I am adding registry search to the registry browser, so as soon as that is done I will post it here.
Below is a screenshot of vjTray:

[APP] Resident Mort - Scary Good, not Scary Evil

*Anyone get the reference? Haha*
Resident Mort
The Scripter's Companion​
Current News / Status:
Resident Mort is currently Under Development
Resident Mort is planned to be a background EXE that will extend the functionality of MortScript available to developers through the usage of the "PostMessage" function.
Resident Mort is planned to extend functionality by adding extra, possibly more complex, functions or even adding in the ability for more complex GUIs.
Features (Green = Implemented, Blue = In Testing, Orange = Planned, Red = Failed):
GetProcessList - Gets a list of Running Programs
GetRecentApps - Gets a list of Recent Apps (10)
CreateScript - Creates a MortScript with the provided info
MakeFile - Makes a file of any kind with the provided info
MakeFolder - Makes a folder at the specified location
RegToEvent - Registers a File to an event​
UnRegFromEvent - Unregisters a File from an event
IsIdEventRegistered - Checks to see if a File is registered to an event.
DispImg - Displays an Image to the screen [and gets where the user Presses]
MakeForm - The Initial call for setting up an 'advanced GUI' form
FormAddObject -A Call that will add one of the predefined objects to the form being created
DeployForm - The Final call for setting up an 'advanced GUI' form, displays it to the user
This application is being made for MortScripters, to possibly make some projects easier. Since I don't use MortScript so much any more, I do rely on you the developers who use MortScript, to tell me what you want in the program.
Since I have a good deal of Functions there, I will commence work on a primary release
Saved For Future Use - Features and Screenshots
like the idea! advanced guis would be very useful
so this is a compiler? I am not sure what this is about
-sorry
No, this is a Resident App, an EXE that is always running in the background. It will have certain functions in it which can be accessed by MortScripters.
All the functions can be called with PostMessage ( I will provide documentation on how to do so, when I make a first release ). Then the results will either be written in the REGISTRY, written to a FILE, or copied to the CLIPBOARD (depending on how the scripter wants to handle the task).
Does this clarify it a bit?
Thanks for sharing!
A small update:
I am using this 'decent' planning utility, to help me keep track of my growing projects. According to this utility, the program is close to 30% complete. Then again, this is just a 'decent' utility haha. I would say, in my estimation (since some Code is "Copy + Paste"), I am close to 60% to 75% done.
A small change in my plans:
While I originally had the intentions of making this program as simple as a PostMessage in MortScript, I found out the following two Limitations:
1) MortScript's PostMessage/SendMessage only support(s) sending Numbers in the wParam and lParam parameters...very disheartening.
2) Due to #1, I made an assistant EXE, which would be run instead of calling PostMessage [this way I could do it Natively in my own control], but it is MUCH harder to transfer data between two applications that I would have thought! Due to Virtual Stacks and Memory Allocation 'rules', I couldn't EASILY do this.
So Here is my change:
In order to use Resident Mort, scripters will have to do about 3 or 4 commands to run. The only real commands that need to be used are PostMessage and RegWriteString (Did I get those right?).
In any case, my Resident Mort will read the Registry for corresponding wParam and lParam values and use those [in the future I will attempt Clipboard integration, to avoid Registry Interfacing].
When I release this program to the public, I will try to include a MortScript file that shows how to use all the functions. I don't remember much of MortScript [unfortunately], but I was thinking it could be helpful to make a "Library" of MortScript functions so a script will only have to call that function. But that is if some kind dev. would like to help out later on
Anyways, Thats that for this update. Expect a result in the coming week.
That sounds interesting for adv. gui functions.
Cyclonezephyrxz7 said:
1) MortScript's PostMessage/SendMessage only support(s) sending Numbers in the wParam and lParam parameters...very disheartening.
Click to expand...
Click to collapse
That's not MortScript's fault, it is design of whole Windows CE kernel, more here
I'd go with background EXE, that would listen to messages WM_USER+somenumber, maybe even region (for different actions, so you'd have both lParam and wParam free for another parameters). If you need help with this part, drop me PM on MSN, I had to study this a bit in the PinchToZoom project myself.
@OndraSter : Yeah, I know that Windows CE has limitations, however it is not impossible. Such an ability could be implemented in a code-update to MortScript. I did my reseach (if you look at #2, I mention that I found it much harder to transfer data between exe's that I had hoped) and found that you can transfer data via SendMessage (the Synchronous method) using a TRANSFERDATASTRUCT and WM_COPYDATA. If MortScripts interpreter could identify a SendMessage with a String value in either wParam or lParam, then it would create such a structure and transfer it, the receiving app would HAVE to take care of deleting the data though, or you have mis-used RAM.
As for how it is going to work now, I did not consider using WM_USER + a value, mainly because my program won't be using other Messages, and will only act if the correct wParam/lParam are provided (preventing accidental execution if the System decides to post a message with the same ID). I have it mostly covered, and I am closing in on finishing (currently with Reg data retrieval only, no Clipboard yet). I have completed 3 of the 7 Proposed Functions (MakeFile, MakeFolder, CreateScript) and I would have finished RegToEvents, but I got sorta lazy hehe. DispImg shouldn't take me more than a few minutes when I get to it, and once I get the API calls for Processes and figure out how to read the MRU reg-entry, I will have the last 3 complete!
As for Clipboard data retrieval, unless I am using the entirely wrong API calls, MortScript has an interesting way of using the Clipboard...I tried copying simple strings like "hello world" to the clipboard using MortScript, then trying to retrieve them in my Resident Mort, but the clipboard always comes up empty... Any ideas anyone?
Thats that for now I am about ready to release....any other functions you want implemented?
As for how it is going to work now, I did not consider using WM_USER + a value, mainly because my program won't be using other Messages, and will only act if the correct wParam/lParam are provided (preventing accidental execution if the System decides to post a message with the same ID).
Click to expand...
Click to collapse
http://msdn.microsoft.com/en-us/library/ms644947(v=VS.85).aspx
Good idea, the only downside being that it will generate the Message Numbers each time it is run... It is not assured that the Post / Send Message MsgIDs will remain constant.
Thanks for the link however
Cyclone,
Sorry about taking so long to post here...
How about, when the BT is on, this reports what is "out there" based on what the BT stack is telling you.
That is, it should read the surrounding area, then report that is saw my BT dongle. In the car, it should report that it saw my BT GPS unit.
Then, I can use that information to change my profile. That is, when it sees the BT dongle, regular phone calls. When it sees the BT GPS unit, run speaker mode, or connect to the GPS unit for phone calls.
Thanks!
--Ironhead
P.S. it would need to support the Touch Pro 2, Rhodium (my understanding is that it is Widcomm BT stack)
I"ll see what I can manage. I am really 'grid-locked' in my work on a couple of projects already So a release of this may have to wait a while....Sorry
I wish I had caught you a little sooner...
AutohotkeyCE may be a better base to work from than Mortscript...
http://www.autohotkey.net/~Micha/AutohotkeyCE/html/index.htm
In fact... AHKCE should be able to cater to all of your needs without the separate resident app
Yeah, I have seen that before. This project is really just a little challenge for myself to expand upon MortScript [because I know it is widely used].
Thank you for the link/suggestion however
I've been playing with Mortscripts for a while, I'm really thinking I can do everything I want, right from there...
EXCEPT:
Actually getting the information from the BT stack. I just need to see if there are any registered BT devices around my phone (so I can tell if I am in my car, at home, at work, etc.).
--Ironhead
Bumpity bump!
Hehe...Yeah, sorry for the lack of work on this. Check out FFP_LockScreen. I am working on a new release. I have very little time now, and I can't manage more than just one or two projects at a time. Once I release FFP_LS 3.0, I can devote some time MAYBE to this project. It all depends on how quickly the XDA-Marketplace idea takes off.
Sorry =\
I you can add a tool to make an GUI... it s must be soo cool...

[DFT] z..::H.O.W...T.O...N.A.T.I.V.E::..z [PREVIEW]

..::H.O.W...T.O...N.A.T.I.V.E::..
Hello,
today I had decided to start this thread about native development for WP7.
At the current moment I don't upload/attach any working stuffs to this message. It will happen a bit later, after new DFT ROMs release. This is because it's very difficult to run them for now.
Let's start from current achieved results:
1) It's possible to run any EXE files (after "FullUnlock")
2) Those EXE files can do any operations in the system (after "FullUnlock")
3) It's possible to show some GUI from this applications. But GUI has legacy Windows CE style, it's impossible to create Metro-style applications for now.
How can it be used by community?
We can develop a lot of homebrew applications: like porting emulators, old native applications, video players and etc.
It can be possible to port famous TCPMP player for example and get ultimate playback on Windows Phone 7!
Is it possible to run old Windows Mobile 6.5 applications without modifications?
No, it's not possible. A lot of different APIs are missing for those applications.
Is it hard to modify old Windows Mobile 6.5 applications?
Well, it's almost same like porting to pure Windows CE, but a lot of Windows CE stuffs are "damaged" inside Windows Phone. They just doesn't work right, because nobody never used/tested them before
Photos of sample "WP7 Native test"
Information for developers you can find in the next messages.
So I will release demo WP7 native application, when we fix issues with FullUnlock.
Demo will be as binary EXE file. And as VS2008 project, which can be good start point for other developers.
Now this thread dedicated for discussion, share ideas and thoughts.
DFT, Cotulla
Information about "FullUnlock"
Information about "FullUnlock"
DevUnlock actually allows only to deploy XAP files from external sources.
It doesn't give more privileges.
So we (DFT) developed "FullUnlock". FullUnlock is implemented as replacing some system files by wrappers, which allows any kind of access (disable access checking at all)
We replace LVMOD.DLL which used to check files and data (checksums, certificates and etc) and POLICYENGINE.DLL which implements internal objects access checking.
All written before means that FullUnlock at the current moment only possible by flashing custom ROM to device. In future maybe we can find good ways to do it without flashing, but for now I don't see any ideas how to do it without flashing.
Maybe we can replace DLLs inside \Windows\ directory (put a shadow copy), but I am not sure if it will work really. It's stuffs for future experiments.
It can be possible to do something near by editing policy values, but it need big research to find right way. As it still won't disable file checking, maybe we can add own certificate to right store and then sign files with them.
The last DFT 7720 MANGO ROMs contains FullUnlock, but it doesn't work as expected there few issues. as well some users got issues with debugging on those ROMs and etc. We will continue work under it
So I will release demo WP7 native application, when we fix issues with FullUnlock.
Demo will be as binary EXE file. And as VS2008 project, which can be good start point for other developers.
Now this thread dedicated for discussion, share ideas and thoughts.
For developers
For developers
(users do not read! danger for brain!)
First of all I want to talk about abilities of native code.
Most applications built in inside WP7 are native. But they don't use usual Dialog UI style, they are using some kind of Silvelight scripts. This kind of UI is called "UIX".
Main idea of UIX that DLL files have UIX resources inside which describe whole UI.
Something similar is used inside CE 7.0 Slivelight - there some xml compiler which make binary data and put them as resources inside DLL. I don't know how to decode this binary data.
Seems Zune desktop application also using this framework.
So UIX used some kind of scripts for UI part and callbacks for all actions.
If we decode this UIX format, we will able to change/modify UI as we want, like it was before with regular resources inside DLL. But UIX must be much more powerful.
We can't use UIX for native application because we don't know how to use it, how to make proper binary data and etc. It's hard to reverse.
But native application can have some GUI with Windows CE style (you can see examples on the photos above)
Another issue: If you call API function "CreateWindowW" you won't see anything on the screen. It seems because shell handle all output, so window doesn't visible.
After some searching I found inside some test ROM nice DLL called "WindowTreeUpdater.dll". After looking inside and decoding functions parameters, it's working!
Basic idea: you create window and call function from this DLL and Window appear on the screen. There seems some kind of proxy engine to output legacy windows on top of shell output.
Nice, it's working...
So we can use usual windows for UI inside native application.
There present standard controls, but they work rather laggy (hey, and looks too).
Basic controls like PushButton, Static, CheckBox, Radiobutton, Icon are working.
About extended controls: (Progress bar, list view, and etc)
they come from Commctrl.dll usually, it was present inside Initial/NODO releases, ut it was removed inside MANGO. I was able to run NODO Commctrl.dll under MANGO after some modifications. But all this controls are shown on screen, but they don't do anything on input. So you can see toolbar, but can't press any button.
CommDlg.dll is missing and never was inside WP7.
There present AYGSHELL.DLL, but most functions are broken. For example, I was not able to create menu bar.
So, a lot of functions are broken, like MessageBox not working.
But we still can create own custom controls and use them for developing.
For example porting TCPMP means that we will need reimplement UI fully - because toolbar doesn't work. slider also won't. Maybe get and reuse some source from ReactOS or NT40 CommCtrl
reserved1reserved1
reserved2reserved2
reserved3reserved3
This is some crazy ****! I like it
for...all...devices!? If possible...damn
I just came...
Holly smoke !!!!!!!!!!!!!!!
Way to go guys....BRAVO... This is a major breakthrough for wp7 dev
Once again well done DFTeam
You guys are beasts...please keep it up
for...all...devices!? If possible...damn
I just came...
Click to expand...
Click to collapse
For now it's only for HTC devices with flashing custom ROM
The UIX/UIB scripts are a real pain.. I tried going through them a while back to change the annoying notification system (10 seconds? Really, Microsoft?) and figured it would all boil down to the usual XML-style script that WM6.5 and other MS products use, but the format is newer and there doesn't seem to be an easy way to decompile them.
From what I do know, however, is that it's more of an encoding than a compilation, and can be decoded if we can figure out what all the different headers mean... but that's a serious reverse engineering project.
Keep it up.is it possible to add Samsung device into support list?
Great work! Are there any multitasking restrictions for these apps? presumably because they are not Silverlight they will not be present in the task switcher & the app will be in charge of when the process terminates?
Looking forward to doing some nice low-level operations - hopefully this will open a whole new world for WP7 dev
Sent from my 7 Pro T7576 using Board Express
That's great,,,Thanks
Cotulla said:
For now it's only for HTC devices with flashing custom ROM
Click to expand...
Click to collapse
Hopefully this will change when you receive the Samsung Focus and try custom ROMs.
Blade0rz said:
Great work! Are there any multitasking restrictions for these apps? presumably because they are not Silverlight they will not be present in the task switcher & the app will be in charge of when the process terminates?
Looking forward to doing some nice low-level operations - hopefully this will open a whole new world for WP7 dev
Sent from my 7 Pro T7576 using Board Express
Click to expand...
Click to collapse
I would suspect that they won't be killed unless there's an Out of Memory issue (you can see the whitelists for that in the registry), because these processes are not like the silverlight/xna apps that are launched in Taskman.exe. Whether they show up in multitask lists, idk, but they probably won't be killed in the traditional way..
but that's a serious reverse engineering project.
Click to expand...
Click to collapse
yes...
maybe it's precompiled XAML scripts, like inside Managed applications?
Great work! Are there any multitasking restrictions for these apps? presumably because they are not Silverlight they will not be present in the task switcher & the app will be in charge of when the process terminates?
Click to expand...
Click to collapse
I would suspect that they won't be killed unless there's an Out of Memory issue (you can see the whitelists for that in the registry), because these processes are not like the silverlight/xna apps that are launched in Taskman.exe. Whether they show up in multitask lists, idk, but they probably won't be killed in the traditional way..
Click to expand...
Click to collapse
Plain EXE can run without restrictions, but I guess it will be killed at OOM condition still. EXE with window seems all a bit more complex. When I press back button it usually disappear after few seconds. I think window got WM_CLOSE or something at that moment. It should be researched more in the future.
Furthermore, I forgot to say: Interesting thing, before MANGO WP7 supports native XAP files too!
There was few files nativeinstaller* which implements native installation. There references inside for setup.dll and _setup.xml like in old CAB files.
But it was removed from MANGO seems
Cotulla said:
For now it's only for HTC devices with flashing custom ROM
Click to expand...
Click to collapse
Would we be able to install an old application like fpsece for windows mobile? One of the biggest things I miss about windows mobile! I get paid today so I will be making a donation for your hard work! I'm currently using your custom rom on my HD7! Thanks again, and keep up the good work!
支持DFT論壇!支持xda-developers!至於你信不信,反正我是信了!

Include local JavaScript within PhoneGap on Windows Phone 7

I have a PhoneGap application designed to work on multiple mobile platforms. I'm loading a dynamic HTML content from an external page on the Internet using jQuery Mobile. The problematic system is Windows Phone 7.
This is what I get from the external page, with the URL of the script tag already replaced to load from the phone instead of from the net to save bandwidth:
HTML:
<script type="text/javascript" charset="utf-8" src="x-wmapp1:/app/www/test.js"></script>
This works fine on Android, iPhone and even BlackBerry when I replaced the x-wmapp1: part by a respective counterpart (e.g. file:///android_asset/www/ on Android). However, on Windows Phone 7 it doesn't seem to work at all.
When I try to load the same URL via $.getScript function, it always returns a 404 eror, even if I try and load it with a relative path only.
Any suggestions?
First of all, this type of question may be better suited to the Software Development or Apps and Games sub-forums, as a lot of the people who hang out here are more familiar with homebrew hacks. I'll give it a shot, though.
First of all, what kind of path are you trying to use? I haven't tried loading scripts or images in HTML or JS, but to dynamically load content within the app itself typically requires some care with regard to the path. For example, is the JS file being built into the assembly (as a resource) or included alongside it (as content)? How about the HTML page?
This is a kind of lame approach, but one option that's sure to work is just inlining the scripts in the page, directly. That won't increase the total app size or load time at all, although it might make maintaining the app take a little bit more effort.
Thanks for the reply, I will try to post this into the more appropriate forum.
With regards to paths - you can see the path in the HTML snippet I provided in the original question. It's all a bit specific and we cannot afford to load JS directly from page, since that does increase the size of the resulting HTML, sent from an external PHP page, thus increasing bandwidth. This is the first reason why we chose to have all JS and CSS files directly bundled with the application and load them internally rather than from Internet.
Also, all of JS files are included alongside the application as content. I'm using the same approach for all images, since if they were included as a resource, they would not show in the application.
GoodDayToDie said:
First of all, this type of question may be better suited to the Software Development or Apps and Games sub-forums, as a lot of the people who hang out here are more familiar with homebrew hacks. I'll give it a shot, though.
First of all, what kind of path are you trying to use? I haven't tried loading scripts or images in HTML or JS, but to dynamically load content within the app itself typically requires some care with regard to the path. For example, is the JS file being built into the assembly (as a resource) or included alongside it (as content)? How about the HTML page?
This is a kind of lame approach, but one option that's sure to work is just inlining the scripts in the page, directly. That won't increase the total app size or load time at all, although it might make maintaining the app take a little bit more effort.
Click to expand...
Click to collapse
First question: have you set the IsScriptEnabled proerty on the control to True? It defaults to False, preventing scripting within the control. Also, changing it only takes effect
on navigation, so if you already loaded the page and then set this property, it still won't work.
Anyhow, I missed that your HTML was coming externally, and only the scripts and stylesheets were local. That's... interesting, and seems reasonable enough, and I can't find any info online that exactly matches your use case. The way you're structuring the script src URI looks weird to me, but I haven't messed with the WebBrowserControl very much at all.
One solution, though a bit hacky:
Use the WebBrowserControl's InvokeScript function to dynamically load scripts into your pages. To do this, you would first need to load the script file content into a .NET String object. The GetResourceStream function is probably your best friend here, combined with ReadToEnd(). Then, just invoke the eval() JS function, which should be built-in, and pass it the JS file content. That will load the JS into the web page, creating objects (including functions) and executing instructions as the files are eval()ed.
Of course, you'd need to do this on every page navigation, but you can actually automate it such that the page itself requests that the app load those scripts. In your app, bind the script-loading function to the ScriptNotify event handler, probably with some parameter such as the name of the script to load. Then, on each page served from your server to the app, instead of including standard <script src=...> tags, use <script>window.external.notify('load localscript1.js')</script> and so on; this will trigger the app's ScriptNotify function for you.
I hope that helps. I can see your use case, but somewhat surprisingly, I couldn't find anybody else online who had either run into your problem or written a tutorial on doing it your way.
Thank you for your reply, it was very informative. One question though - why do you think the way I'm structuring the SCRIPT URI is wierd? I tried to mess around with relative URIs and the such, however those would load the JavaScript file from Internet rather than from the application itself.
The problem I'm running into with your proposed solutions, however is that:
1. the project is a PhoneGap/Cordova application, using its own components, so I have no idea where I would look for IsScriptEnabled here (although this all worked on an older PhoneGap release, so I'm guessing they have it set up correctly)
2. injecting a script programmatically on each navigation would require me to rewrite much of the code we already use for other platforms, not to mention those custom Cordova components, which I don't even know if they can handle such thing
As for my user case - I was surprised to be the only guy on the internet with this methodology in place as well. So it either works for everyone else or nobody really thought of doing it my way, since it's basically an Internet application (maybe the don't want to disclose their sources, who knows).
CyberGhost636 said:
1. the project is a PhoneGap/Cordova application, using its own components, so I have no idea where I would look for IsScriptEnabled here (although this all worked on an older PhoneGap release, so I'm guessing they have it set up correctly)
Click to expand...
Click to collapse
In the WebBrowser properties.
CyberGhost636 said:
As for my user case - I was surprised to be the only guy on the internet with this methodology in place as well.
Click to expand...
Click to collapse
Of course you not "the only guy". I've tried to port/run a few HTML java-script based games on WP7 (Digger and couple more) more then year ago; they runs well with one HUGE exception - touch screen events are freezing scripts execution and make games not playable.
The "x-wmapp1:" URI scheme was what I was referring to. Not sure where that comes from, but I haven't done anything really with the WebBrowser control.
I have no knowledge of PhoneGap or Cordova; I assume they're "we write your app for you" frameworks? One would assume that such tools would know to set IsScriptEnabled, but you may have to do so manually. A bit of web searching on that direction may be fruitful - maybe earlier versions enabled scripting by default, and now it's disabled by default so you have to specify an option somewhere?
Injecting the script on navigation really doesn't require any major change to the server-side code. I mean, is sending
<script>window.external.notify('load localscript1.js')</script>
really much different from sending
<script type="text/javascript" charset="utf-8" src="x-wmapp1:/app/www/test.js"></script>
? If that's too different, you could instead send
<script src="http://yourserver.com/LoadLocalScripts.js"></script>
and put "LoadLocalScripts.js" on your server with the following code:
window.external.notify('load localscript1.js');
This has only a trivial increase in server traffic and load time, but lets you continue using external scripts instead of inline ones. Very little server-side change needed at all.
Now, the additional client-side code to support the window.external.notify and call InvokeScript... normally I'd say that's dead easy, because it is if you have any experience with the .NET framework, but in your case I get the feeling that this isn't so? I code to the framework, or to the underlying native code, and I tend to code "raw" (very little auto-generated code), so I'm not going to be able to help you solve the problems with a "make me an app" wizard unless I can see the code it generates for you.
For what it's worth, here's the approximate raw code that I'd use (it's over-simplified, but close enough):
void HandleNotify (String param) {
String[] parts = param.split(" ");
if (parts[0] == "load") LoadScript(parts[1]);
}
void LoadScript (String script) {
String content = Application.GetResourceStream(new Uri(script, UriType.Absolute)).ReadToEnd();
theBrowserControl.InvokeScript("eval", content);
}
void theBrowserControl_Loaded (...event handler args here...) {
theBrowserControl.IsScriptEnabled = true;
theBrowserControl.ScriptNotify += HandleNotify;
theBrowserControl.Navigate("http://yoursite.com");
}
the URI comes from Windows Phone itself, with this code, you can see for yourself:
var a = document.createElement('a');
a.setAttribute('href', '.');
alert(a.href);
also, I've been informed that this works in Cordova 2.0, so it might be a 1.8.1 bug... will try and see how it goes
thanks for your help so far!
Looks like it was a problem with PhoneGap 1.8.1 - after upgading to Cordova 2.0 (PhoneGap got renamed) it all works now... thanks for all the help!

Categories

Resources