[Q] Is there a way to DISABLE font smoothing? - Gen8 General

Archos 101 has a problem that all the fonts are blurred, including text in 3-rd party apps. It looks just awfull. On windows I have an option to turn that off. Loking for some method to do the same on Android.

There are many apps for font changing
but you need root your device for this
Maybe there is an option like this in that apps, just try it

One could recompile the skia library.

arpruss said:
One could recompile the skia library.
Click to expand...
Click to collapse
Can that library be relpaced in current Android installation without rewriting full Android image?

sarge425 said:
Can that library be relpaced in current Android installation without rewriting full Android image?
Click to expand...
Click to collapse
I would think so, unless Archos has customized the stock library and the 2.2 source code doesn't match it. I'll try a recompile and see what happens.

That sounds interesting...
Looking into sourcecode of AOS, i noticed that "freetype" library included too. May be it involved in font decoding?

I compiled libskia from the 2.2 sources, making only one change (enable bytecode interpreter in FreeType). Zygote doesn't start up.
Maybe Archos has made some modifications to the stock code.
It might also be worth checking if FreeType reads some config files. Normally, FreeType works with fontconfig, and fontconfig has some configuration files.

I found exact places where text rendering is done. It is in file trunk/src/ports/SkFontHost_FreeType.cpp
Most work done via calls to freetype library, however some "subpixel rendering" attempts can be noticed in the source.

sarge425 said:
I found exact places where text rendering is done. It is in file trunk/src/ports/SkFontHost_FreeType.cpp
Most work done via calls to freetype library, however some "subpixel rendering" attempts can be noticed in the source.
Click to expand...
Click to collapse
Right. I don't think the subpixel rendering is currently implemented. People say that subpixel rendering doesn't work vertically, and these tablets are often used vertically. I couldn't find anywhere in the code where the font code would have access to the current screen orientation, which would be crucial to subpixel rendering.
In any case, it would be easy to disable all antialiasing, in SkFontHost or in FreeType (libskia.so includes FreeType, I think--at least there is no separate libfreetype or libft2 or the like on the device). But since I can't get Android to start up on my archos when I install my compile of libskia.so, that's moot.
By the way, did you notice that the skia library includes PDF rendering? One could make a very lightweight pdf viewer if one hooked into that (but it might stop working with a new release of the skia library, since this isn't an official Android API).

Things seems to be more simple. In the file SkFontHost_FreeType.cpp I found a string "FT_Render_Glyph(fFace->glyph, FT_RENDER_MODE_LCD);" and some text down. According to FreeType2 docs, parameter FT_RENDER_MODE_LCD is used for subpixel lcd rendering, and FT_RENDER_MODE_NONE means 1-bit mode (anti-aliasing off).
Another problem is that freetype uses subpixel glypth positioning, which not good.

arpruss said:
I couldn't find anywhere in the code where the font code would have access to the current screen orientation
Click to expand...
Click to collapse
I found that place in SkScalerContext_FreeType constructor.
Btw, inability to replace libskia is really bad. I have only remaining way to binary patch that lib

sarge425 said:
I found that place in SkScalerContext_FreeType constructor.
Btw, inability to replace libskia is really bad. I have only remaining way to binary patch that lib
Click to expand...
Click to collapse
Or do a pass-through patch, like ChainFire3D did for the opengl library. I don't know how to do that.

Also, I am guessing there are some hardware-dependent settings to set for the skia code that I didn't set--I just compiled the generic 2.2 code for it. Someone who understands the skia code better might be able to get it running quite easily.

I was busy that days. Now I disassembled libskia.so and fortunately it has symbols!!! I can locate all public methods, and all calls to FT2 as well. Also I found the optimal font configuration: nonchrome mode + full hinting (tested on ubuntu).

sarge425 said:
I was busy that days. Now I disassembled libskia.so and fortunately it has symbols!!! I can locate all public methods, and all calls to FT2 as well. Also I found the optimal font configuration: nonchrome mode + full hinting (tested on ubuntu).
Click to expand...
Click to collapse
Maybe you can try to figure out how it differs from the stock 2.2 source, so we can just compile the stock source with some changes?

I expect it will be a hard task. I'm not very familiar with ARM asembler, and the problem can be everywhere in that library. I found some strange calls to external modules, where functions linked with constant address. That may be the source of incompatibility. Normally all imports defined by name, not by magic address.

Doing a pass-through library might be the best way to go. Do you know how one might do that?

What means "pass-through" library? I think the key problem is the mechanism of recompiled library not working. It may be just checksum verification, but may be more complex too.
The most straight way is to change responsible bytes directly in .so file. I already have found where to patch.
Can You describe steps to be able to replace libskia with ability to return back if boot fails?
---------- Post added at 07:11 PM ---------- Previous post was at 07:00 PM ----------
Also I noticed that skia uses very strange method of drawing texts - it renders text into separete bitmap, then does alpha-blend. Obviously subpixel rendering will require 3 separate alpha-channels for alpha-blend at subpixel level. Windows GDI, for example, outputs text directly to final bitmap, and doesn't need to to store subpixel transarency values.

sarge425 said:
What means "pass-through" library?
Click to expand...
Click to collapse
ChainFire3D installs replacements for the OpenGL libraries that do a few things when called and then pass control to the stock library (which is still there, but renamed).
I think the key problem is the mechanism of recompiled library not working. It may be just checksum verification, but may be more complex too.
The most straight way is to change responsible bytes directly in .so file. I already have found where to patch.
Can You describe steps to be able to replace libskia with ability to return back if boot fails?
Click to expand...
Click to collapse
I used the Chulri's RW root, and just copied libskia.a over the original one and rebooted. When it didn't work, adb still connected just fine, and I just went to /mnt/system/unionfs/system/lib (I think) and deleted the new libskia.a there (the way the rw root works is that stuff in /mnt/system/unionfs shadows stuff in /) and rebooted.
Also I noticed that skia uses very strange method of drawing texts - it renders text into separete bitmap, then does alpha-blend. Obviously subpixel rendering will require 3 separate alpha-channels for alpha-blend at subpixel level. Windows GDI, for example, outputs text directly to final bitmap, and doesn't need to to store subpixel transarency values.
Click to expand...
Click to collapse
Interesting. And there may be another blend that's done by the surfaceflinger library.

arpruss said:
ChainFire3D installs replacements for the OpenGL libraries that do a few things when called and then pass control to the stock library (which is still there, but renamed).
Click to expand...
Click to collapse
The technical name for this is an "interposition library". You an search the web for LD_PRELOAD and interposition for a lot of information. (LD_PRELOAD itself doesn't work on Android.)

Related

[Q] Real-Phone AVDs for download?

I'm semi-adept at programming, and I've got a pretty good game on the Market (Porcupine Assassin, if you wanna check it out).
Long story:
Problem is, some features work on a "grid" system, which generates it's layout on startup based on the phone's physical properties. Now, I only have a G1 and the grid system works fine on it. But a user has received an FC caused by "Array Index out of bounds" which means the grid system was trying to access a section of the grid that was not generated. It wasn't generated because the user's phone has a difference screen size than mine, and obviously the grid failed to adapt properly.
Short story:
I need a way to download emulator AVDs that are identical to real-life phones. I don't have the know-how to reproduce them myself (I use a basic AVD for all my testing). Is there a site that has custom AVDs for download?
I seem to recall an option when installing my AVD to set the screen resolution. I poked around and didn't find any way to change it once it's installed though.
With my x10 I went to the se dev site and there was a preconfigured avd. I'm assuming other companies do the same. Hope it helps

[CODE] HTML5: toDataURL on Android browser

Can't believe that it almost took me a day to implement a tiny rendering change in my Vexed/HTML5 port. A little backstory:
I know there's already a good Vexed port for Android, but since I needed a web version, making it compatible with Android seemed like a good idea. It's still missing a lot of details, like a menu, manual or win/lose messages, but if you want you can play it here:
http://www.tapper-ware.net/data/devel/web/games/JS.Vexed/
The buttons used to be rendered using CSS3 border-images, which work on Android (at least 2.3+, haven't tested any other versions yet), BUT they are slow as hell. Apparently it's hitting a fallback path that renders the element much like you'd do on legacy-IE with behaviors... meaning that there's also a lot of tearing since the element that you apply the border-image to basically becomes a set of 9 image elements as far as rendering is concerned.
So I decided to implement my own border-image using Canvas (you can find it at line 168 of the HTML file: HTMLImageElement.prototype.renderAsButton)... after all, drawing border-images isn't exactly rocket science.
So far so good: it was working beautifully, but somehow I couldn't get it into my CSS... after basically checking every part of the chain with manually created data urls it really didn't make any more sense, so out of pure desperation I decided to take a look at the data url returned by HTMLCanvasElement.prototype.toDataURL, which was a ... surprise. This thing is wrong on so many levels it never should have shown up in any code. Not only does it not throw and ERR_NOT_IMPLEMENTED, it even returns data to cover the fact that it's not implemented, namely "data:," which doesn't throw an error when used as an image source.
The general workaround seems to be that people use a custom toDataURL implementation that outputs a Windows BMP file... which would be great, if Android supported 32-bit RGBA BMP files. However they usually end up as if they were 24-bit RGB files.
So if I wanted RGBA, i had to create PNG files.
The PNG spec is really very readable and makes it easy to implement a PNG encoder... but there are two shortcomings:
1. The only filter method available requires a filter byte at the beginning of every row. So you can't use the return data of getImageData directly (Array.prototype.splice doesn't work on ImageData, you have to copy it first).
2. It doesn't support uncompressed data directly... and compressing in JS seems like a bad idea. Instead you are supposed to use and ZLIB stream with raw blocks
It also has CRC checks which are annoying for our purposes, but not that hard to implement (you can find my implementation at line 94: Array.prototype.crc32). Costs a bit of performance, but wouldn't be a major problem by itself.
But the reliance on ZLIB proved to be a major annoyance, because the documentation (RFC1950 & RFC1951) is lacking... to put it mildly (the relationship between those two documents is never really mentioned, meaning that you're always guessing if a header belongs to the stream or the block). The endianess is also switched from what PNG uses, meaning that you end up with two different types of integers in the same file. I ended up mostly analyzing THE GIMP's output for uncompressed PNGs (and could have finished everything much earlier if I hadn't tried to work my way through the spec first). The most important part from the spec is the definition of the ADLER32 checksum (line 85: Array.prototype.adler32), which sadly is required for each ZLIB block, meaning that creating a PNG involves calculating two different checksums for (mostly) identical data.
But my little PNG encoder is working now, and in difference to other implementations that I've found, there's no 64kb limit as my implementation splits every stream into 32k blocks correctly. However, it's not as fast as it could be and if there's interest I'll happily put the code in a project if other people want to help improve it or maybe even add proper compression.
EDIT: THE CODE IS NOW PART OF AN OSS PROJECT, SEE THE NEXT POST
I might not check this forum at the time, but you can always reach me at [email protected]
I've published the Javascript-PNG-encoder workaround over at http://code.google.com/p/todataurl-png-js/ under the GNU Affero General Public License, version 3 license in case anybody wants to join and add compression or just general optimization. Just drop me a line if you want to be added to the user directory.

[XAP][Source] Webserver v0.6.0 (File uploads)

Version Alpha 0.6.0 is now available
I'm back! Not dead yet, I promise. This is actually a relatively small update in terms of user-facing features, with only one really big new thing - support for file uploading - but that's a lot bigger than it might sound. It's the first write support I've implemented in the server, and it also required some fairly massive updates to the HttpServer component (support for binary requests, for POST parameters, for MIME multipart parsing). These will be built upon in forthcoming versions to add support for things like registry editing, in-browser file viewing (possibly editing), and so on. There are also a large number of small fixes and improvements that I've made over the last two-weeks-shy-of-a-year, which should make the server faster, more robust, better able to support concurrent connections, and lighter on device resources. Finally, while the app still targets WP8.0 and should run on 8.0, it now is designed for 8.1 compatibility (especially the AllCapabilities version).
Previous update (0.5.6): This version is mostly bug fixes and UI changes. The biggest changes are: clearer display of weird registry data types, the server now consumes fewer threads (it used to spawn them with wild abandon) and does faster string compares, the app version is now shown on the phone, error pages are now better, if you launch the app without a WiFi IP address it'll offer to take you to the WiFi settings page, connections are no longer closed as soon as the app starts sending a response, and the server now defaults to using the Connection: keep-alive header, with a two-minute timeout. The last change, combined with the second-to-last, should hopefully both do away with the tendency to have the app fail to display a page. However, I shouldn't have *needed* to switch it to "keep-alive" - using "close" should have worked - but it still veeeery occasionally would kill the connection early. Agh. Anyhow, this is better in the meantime.
DevDB offers me a support / Q&A thread. Please use that thread to ask questions; don't PM me unless it needs to be kept private for some reason!
ISSUES ON WP8.1:
It *should* work to deploy the app with "Application Deployment", but if you have a problem try deploying with "Windows Phone Application Deployment 8.1" instead.
Problems have been reported in the past when the app is installed to the SD card. It's small, though; putting it on internal storage shouldn't be a problem.
RESOLVED The AllCapabilities version included a few capabilities that were present in 8.0 but removed in 8.1. Those capabilities have been removed; the AllCapabilities version now deploys and runs on capability-unlocked WP8.1 phones.
IN CASE OF OTHER ISSUES: Please provide a *detailed* error report - what phone and OS version you have, what hacks you've installed, what Webserver version you're running, what you do to get the error to occur, and exactly *what* occurs - and I'll fix it as soon as I can! There's a DevDB section for posting bug reports, and you can also use CodePlex if you want.
I finally implemented file upload! I'll work on getting more stuff like that (file delete, possibly file rename/move/copy, various registry edits), hopefully soon! I also hope to add support for different areas, like an "Applications" path, a "Processes" path, a "Services" path... eventually. Many of those are really hard without good privileges. I'm also looking at moving the server to a background process and making the app just a control UI for it, adding support for authentication and/or HTTPS, adding some stylesheets to the web UI, adding caching, and much more. I did finally implement Connection header support.
Once again, the XAP is published twice. One is a fairly standard XAP that any phone can sideload, and the second has many exotic capabilities to enable viewing of (and writing to) slightly more of the file system and registry. The standard XAP has had its list of capabilities expanded to pretty much all of them that can be used without interop-unlock. The high-capability variant requires not just interop-unlock, but the additional capability-unlock hack available in the interop-unlock thread. The AllCapabilities version now works with WP8.1; sorry for the long delay on that!
An item of note: the AllCapabilities version (or either version, on WP8.1) can open other drives in the file system. On phones with an SD card, it is mounted at D: and you can browse it as normal. Credit to @hjc4869 for this discovery!
DESCRIPTION: This is a simple webserver app which can enumerate those files that are in folders readable from the sandbox, can download and upload (access permitting) files, can browse the registry, and can display the contents of registry values of any type. It runs on WP8.x (not yet tested on W10M). It is a spiritual successor to the Functional Webserver / WebServer (Mango) projects from WP7. This version is still missing a lot of functionality as I decided to implement it from scratch, but it is advancing swiftly. Note that there's no access controls implemented; use it on a public network only at your own risk!
Instructions are simple: sideload the XAP, connect to WiFi (required), run the app (called "WebServer Native Access"), point a web browser (on a PC or phone that is also on that local network) to the URL that the app displays. You should get a basic index page. Click on a Filesystem or Registry link to begin browsing the phone. There's a textbox near the top of all filesystem pages, type in a path there (for example, "C:windows" with no quotes) and hit Enter or click Get Files. You'll see a list of the contents of that folder. Click on a file to download it or a directory to open it. There's also a box for uploading files, one at a time, to the current directory. Navigating the registry is similar, except you'll need to specify the registry hive and then the path from that hive (or no path, to access the root of the hive).
As of v0.6.0, uploading files is finally supported! Other modifications (editing files, creating, deleting, or changing registry keys or values) are currently not supported. They will be "soon" although my personal testing suggests that basically the whole registry, and most of the file system, is off-limits for writing unless you use restricted capabilities.
You might see an error code (error 5 is "ACCESS_DENIED", you'll see it a lot; I should replace it with an appropriate 403 or whatever). Or you might see a status 500 message because of an exception in the server. Or the server may just crash (hopefully not so often anymore...). I'm making it more resilient, but there are still bugs. Please report any previously-unreported issues you find, including how to reproduce them, and I'll fix them if possible.
Also feel free to request features or changes; I'll implement them if reasonably possible. The app is a mixture of C++ and C# code; I could probably have done it all in one or the other but wanted to have a C++ component in case I ran into something that wasn't available in C#, and although it probably would have saved some time, I decided that hacking up a web server in C++ was maybe not the best idea.
The source code is on Codeplex, at the following projects: https://wp8webserver.codeplex.com/ for the server and the app (C#) and https://wp8nativeaccess.codeplex.com/ for the native access wrappers (C++). You may have to fix up the reference paths to get the C# component to see the C++ component correctly. The code is reasonably well documented, but let me know if you have any questions. Permission to re-use the code or components is granted under the MS-PL (Microsoft Permissive License) as posted on Codeplex.
Go forth and find cool stuff!
Version history (see the git commit logs for more detail:
07 July 2013 - 0.2.0: Initial release, FS only, 920 downloads (source: 652 downloads)
14 July 2013 - 0.3.2: initial registry, HTTP server and web app encapsulation, source on Codeplex, 225 downloads
0.3.3: bugfixes, 454 downloads
0.4.2: basic registry values display, 86 downloads
0.4.3: bugfixes, 326 downloads
0.4.6: multistring registry values, bugfixes, updated libraries, first AllCapabilities version (950 downloads), 453 downloads
25 Oct 2013 - 0.4.8: binary and long registry values, formatting and bugfixes, 451 downloads AllCaps, 201 normal
22 Dec 2013 - 0.4.9: all registry value types, better threading, proper resume, remembers port, 97 downloads AllCaps, 53 normal
24 Dec 2013 - 0.5.0: background operation using Location APIs. Downloads: 1011 AllCaps, 963 Normal
20 Jul 2014 - 0.5.1: More capabilities, better navigation. Downloads: 358 AllCaps, 352 normal
07 Aug 2014 - 0.5.3: .REG export, better traversal, bugfixes. Downloads as of 0.5.5 release: 260 AllCaps, 164 normal
10 Oct 2014 - 0.5.5: Bugfixes and back-end work. Downloads as of 0.6.0 release: 140 AllCaps, 113 normal
25 Oct 2014 - 0.5.6: Bugfixes and UI tweaks. Downloads as of 0.6.0 release: 1720 AllCaps, 1334 normal
12 Oct 2015 - 0.6.0: Binary requests, file uploads, bugfixes.
XDA:DevDB Information
WebServer Native Access, Tool/Utility for the Windows Phone 8 General
Contributors
GoodDayToDie
Source Code: https://wp8webserver.codeplex.com/
Version Information
Status: Alpha
Created 2014-10-17
Last Updated 2015-10-12
I'm going to use this space to mention something that's pretty cool:
J. Arturo of http://www.komodosoft.net is using a modified version of the HTTP server that powers this app in the ShareFolder app (http://www.windowsphone.com/s?appid=e2b9c82e-eaa1-4a3b-9d4a-8a2933a8bdb4) to support opening video files directly from Windows network shares! This was done to work around a limitation of the WP8 media control: it can only source from an isolated storage file or a HTTP URL. By running a server in the background and streaming the video file through it, and pointing the video player control at the localhost URL, it becomes possible to play the file on the phone without first copying it to the app's isolated storage. A very cool way to solve the problem! Also, reviewing the changes that were made to the network code of the server pointed me toward those threading fixes I made that have hopefully much improved version 0.4.9.
Please note that the updated version of ShareFolder with this feature may not yet be available, although it should be soon. It is a commercial (paid) app, but the author sought and received permission to use my code (although the license does not require such permission be received).
What exactly is the problem with sockets? I am battling myself with sockets atm too, maybe we can share knowledge?
Strictly speaking, the problem was with the phone's limited subset of the Sockets API forcing me to access it through functions I wouldn't normally use (asynchronous everything, SocketAsyncEventArgs and lambdas and AutoResetEvents and so on everywhere...) but I've got a pretty good handle on it now, at least for the System.Net.Sockets.Socket and its friends. The new .NET 4.x ones (using the async keyword and all) are in a different namespace; I didn't mess with them. They are more abstracted from the Bekeley sockets interface that I'm used to from C, but they are also (supposedly) more user-friendly, especially if you don't feel like writing all your own thread management code (and in fairness, I should re-write the webserver's threading to use threadpools; they're better for this type of work).
If you want to ask questions about the topic, I suggest starting a new thread (possibly in the Q&A subforum, although it's also dev related...) and I'll answer if I can.
GoodDayToDie, just an idea: how about sharing your source code via CodePlex or GitHub?
Oh man, this is pretty nice! GoodDayToDie does it again!
So far, I can read \Windows, the current install folder which you access just by typing "." with no quotes and the current application folder by typing ".." I can access the .dlls, .winmd and AppManifest.xml from the current install, but from everywhere else, it goes boom. This is a great step towards something awesome though!
EDIT:
I was wrong. For some reason, when you click on a folder it's trying to "download" it, rather than chdir. I can get pretty far into the Windows directory.
THAT's what you meant by "Click on a file (note: there's no current way to tell the difference between files and folders) to download it.
You might see an error code (error 5 is "ACCESS_DENIED", you'll see it a lot). Or you might see a status 500 message because of an exception in the server. It's getting a lot more resilient but there are surely still some bugs. ".
If you see a folder, just type the full path to it instead of clicking on it and you will be able to read the contents.
ANOTHER EDIT:
I just found a file inside of the \Windows\System32 directory named [guid].devicemetadata-ms (It's easier to just search for "devicemetadata-ms"). It's a cab file with some metadata about WP8 with a sign.cat and packagesign.cat file in the archive. I don't know what these files could potentially be useful for.
New version in a day or two (busy tonight). Features I plan to implement (not necessarily in the next version or at any particular time):
File upload (IsoStore and, of all crazy things, install directory are writable. I think I'll put a flag on each FS page that says whether the current dir is writable...).
File deletion (where possible, of course).
File and Directory distinction in the listing (clicking a dir should open it, not error out).
Filesystem index page with links to folders that can be accessed successfully (since the root isn't readable).
Some more file info (size, probably attributes, possibly permissions).
Possibly an option to preview a file (as plain text) without downloading it.
Some kind of background mode (the server uses minimal resources when not actively servicing a request, so I'll see if I can get it to work in the background, perhaps by abusing the music transfer agent...)
Some kind of offline mode (at least basic file browsing within the app, as an alternative to using the web interface, though I might just make a second app for that).
Source code changes: separate the server code from the webapp / phone app code (move it into its own project).
Source code changes: move to a hosted version control service, probably CodePlex (good suggestion sensboston).
Maybe add an icon and such...
Any other suggestions?
I also want to try experimenting with various non-standard capabilities and see if I can get access to more of the system . I've already added the ability to access removable storage, but I've also found a bunch of really weird and frequently undocumented capabilities in the OS's policy configuration files, and I need to look into those... The interesting (and possibly the uninteresting) ones are probably blocked for unsigned sideloaded apps, but it's worth checking on anyhow.
Yeah sorry, I should have been more explicit about clicking on dirs. not working in 0.2.0. Also, it's "unofficial" but if you check the URL bar you'll see a URL parameter called something like "pattern" (by default, it's *) and if you change that, you can filter the results. For example, "foo*.exe" (note: no quotes!) will search for EXE files whose names start with "foo". Among other uses, this makes it a lot faster to load large dirs like System32. This will be added to the UI at some point. Also note that URL decoding is applied correctly to querystring parameters (Probably already noticed with the path sometimes written using %5C for \) so you can add special characters that way if needed, though currently any of them but \ will probably just cause an exception.
...
Actually, does this filesystem support Alternate Data Streams? If so, you should be able to download them by appending a : and the ADS name to the filename in the download URL...
OK, so that was a new version in five days. Sorry, stuff takes time.
The source code is now on Codeplex. The native access portion is at https://wp8nativeaccess.codeplex.com/, and the web server portion is at https://wp8webserver.codeplex.com/. Both are licensed MS-PL and use Git for version control. The full XAP is also available for download from the Webserver project on Codeplex.
GoodDayToDie said:
OK, so that was a new version in five days. Sorry, stuff takes time.
The source code is now on Codeplex. The native access portion is at https://wp8nativeaccess.codeplex.com/, and the web server portion is at https://wp8webserver.codeplex.com/. Both are licensed MS-PL and use Git for version control. The full XAP is also available for download from the Webserver project on Codeplex.
Click to expand...
Click to collapse
You are a god. I'll be sure to post my findings .
Hmm. When I first load up WebServer File Access then access from my laptop, I get the main page then the program crashes on my phone. It seems to hold a lock on to the socket as i can no longer access port 9999 from any other device when re-opening the app. I can access it again when I reboot, but the same thing happens.
EDIT: I think it may be due to the WiFi at work... it's junky. I'll try again when I get home. I was just able to browse some directories.
Wow, that's completely unexpected... I can beef up the error chacking and handling around the listener port though. That part of the code is really straightforward, so I actually haven't hardened it very much. I can also put in a Finally block to close the socket and/or mark the socket as re-usable so that other apps (or the same one again) can listen on it in the future.
I also plan to add support for setting your own port, but that doesn't solve the underlying problem. I'll put in more error reporting as well, to enable better debugging. Thanks for the report! Always good to have users report problems so I know where to prioritize fixes.
GoodDayToDie said:
Wow, that's completely unexpected... I can beef up the error chacking and handling around the listener port though. That part of the code is really straightforward, so I actually haven't hardened it very much. I can also put in a Finally block to close the socket and/or mark the socket as re-usable so that other apps (or the same one again) can listen on it in the future.
I also plan to add support for setting your own port, but that doesn't solve the underlying problem. I'll put in more error reporting as well, to enable better debugging. Thanks for the report! Always good to have users report problems so I know where to prioritize fixes.
Click to expand...
Click to collapse
I tried the app at home and it DOES crash on the first hit of the home page, but I'm able to open it up again and it works fine.
The new version 0.3.3 should be more rebust; try it and let me know if you still have issues. If you do, let me know what the exception message is (and any other info you can provide) and I'll try to track it down.
Downloading really big files should also work now. The app will read and push files in smaller chunks (the code to do this existed in the NativeAccess library before, but wasn't used).
a simple SDK?
Dear Sir
Will it be possible for you to make some sort of SDK from this so other developers can integrate this into their apps and enable browsing isolatedstorage?
Sorry if it is a stupid question.
Bruce_X_Lee said:
Dear Sir
Will it be possible for you to make some sort of SDK from this so other developers can integrate this into their apps and enable browsing isolatedstorage?
Sorry if it is a stupid question.
Click to expand...
Click to collapse
With the restrictions in permissions, this app only allows browsing of the app's isolatedstorage locally. You are able to use the IsolatedStorage API within your app to browse files and directories already.
snickler said:
With the restrictions in permissions, this app only allows browsing of the app's isolatedstorage locally. You are able to use the IsolatedStorage API within your app to browse files and directories already.
Click to expand...
Click to collapse
That's right. What I want is to allow the end user to be able to browse the isolatedstorage. Imagine I have a video download app, I want the user to be able to transfer those downloaded videos from the app's isolated storage to, say, a PC.
One can do this by integrating the webserver code into the said app.
Bruce_X_Lee said:
That's right. What I want is to allow the end user to be able to browse the isolatedstorage. Imagine I have a video download app, I want the user to be able to transfer those downloaded videos from the app's isolated storage to, say, a PC.
One can do this by integrating the webserver code into the said app.
Click to expand...
Click to collapse
Ahh I see what you mean now. That sounds like a pretty nice idea. I think more research needs to be done to see whether it would even be allowed in the marketplace.
The webserver portion is stand-alone (builds to its own .NET DLL with no dependencies on the other parts) and has a pretty clean interface. You'd need to implement the web application portion of it yourself - the thing that generates the response pages for a given request - but the HttpResponse class in the server does a lot of the work of that for you; you basically just specify the content you want to send (as a String or byte array) and it sends it.

[Q] Spawning native processes from java

according to developer.android.com/reference/java/lang/Process.html you can spawn a native executable from within your java application. This is not working for me as I had hoped....
I have an ARM Linux Forth that I have developed and this runs just fine from adb shell. I have placed this in my assets directory and copied it out to /data/data/blah.blah/ and tried to execute it there from my app. it runs but is instantly killed. dmesg tells me it was killed because it is an untrusted app.
How is one supposed to execute native binaries from within a security enhanced android? or has this functionality been buggered up by google now?
P.S. i click yes this is a question and am told im breaking the rules. I back out, i follow what LOOKS like the links to the Q/A forums which leads me right back to here so if im breaking the rules YOUR site is screwed up.
p.p.s the capcha that you have implemented for the registration with this site is PERFECT. the capcha you have chosen for posting is a HORRENDOUSLY BAD capcha, its almost completely and utterly unreadable by a human... i bet a bot could read it just fine though!
Plese delete this dumbass capcha and use only the one used for registering here.. i.e. the one that asks you to enter the numbers not totally butchered words that are so skewed as to be incomprehensible!
???
mark4th said:
according to developer.android.com/reference/java/lang/Process.html you can spawn a native executable from within your java application. This is not working for me as I had hoped....
I have an ARM Linux Forth that I have developed and this runs just fine from adb shell. I have placed this in my assets directory and copied it out to /data/data/blah.blah/ and tried to execute it there from my app. it runs but is instantly killed. dmesg tells me it was killed because it is an untrusted app.
How is one supposed to execute native binaries from within a security enhanced android? or has this functionality been buggered up by google now?
P.S. i click yes this is a question and am told im breaking the rules. I back out, i follow what LOOKS like the links to the Q/A forums which leads me right back to here so if im breaking the rules YOUR site is screwed up.
p.p.s the capcha that you have implemented for the registration with this site is PERFECT. the capcha you have chosen for posting is a HORRENDOUSLY BAD capcha, its almost completely and utterly unreadable by a human... i bet a bot could read it just fine though!
Plese delete this dumbass capcha and use only the one used for registering here.. i.e. the one that asks you to enter the numbers not totally butchered words that are so skewed as to be incomprehensible!
Click to expand...
Click to collapse
nobody can tell me how to spawn native processes without them being instantly killed?
You didn't post any code or something...
Regards
1. Post your code.
2. Since more than half of your question was about complaints, go here.
www.xda-developers.com/contact/
Code.
EmptinessFiller said:
You didn't post any code or something...
Regards
Click to expand...
Click to collapse
would it be possible for you to private message me an email address, my code is not "secret" but it is not released yet and the site i host my projects on is currently down due to my domain name expiring. this will take a few days to resolve still.
Basically i have an ARM forth compiler that I developed on my BeagleBoard XM (in ARM assembler). This runs on the XM, the raspberry pi and of course android. Well, it runs in adb shell on a rooted device just fine, if my java launches it as a native process (not a native application) it is instantly killed due to being an untrusted executable. This does not happen on older androids but I would like this to run on any newer device too.
I would be MORE than happy to send you the entire sources to my ARM forth so you can observe the instant death first hand. I will also post the "java" code i use to launch it from my main android app - im not yet ready to release this arm forth to the general public yet so im not going to be posting it on any site like github etc.
Part of the problem is that on launch the Forths process resides within a contiguous 1 meg region (code and data) that I mprotect to +r +w +x. If i cannot have the entire process space readable, writeable AND executable then this forth will never run on a security enhanced android. I seriously hope this is not the case and that there is a fix.
I think it's better to post smallest part that is necessary for ur problem public in this forum, so that all the other great members can help u too. You needn't post everything.
Regards
code..
EmptinessFiller said:
I think it's better to post smallest part that is necessary for ur problem public in this forum, so that all the other great members can help u too. You needn't post everything.
Regards
Click to expand...
Click to collapse
create any native executable using the NDK or any other armv6/v7 compiler/assembler. put this in /data/data/com.somewhere/ then use the every so INCOMPLETE example snippet provided by google at developer.android.com/reference/java/lang/Process.html to run that executable from within some hello-world android app. I do this with my forth compiler (www dot isforth dot com/a4.tar.bz2) and the executable is instantlhy killed by the android security enhancement bs.
it only took about 200 ish tries on this stupid capcha to finally be able to HUMANY FREEKING READ IT!
hate this bull****
mark4th said:
create any native executable using the NDK or any other armv6/v7 compiler/assembler. put this in /data/data/com.somewhere/ then use the every so INCOMPLETE example snippet provided by google at developer.android.com/reference/java/lang/Process.html to run that executable from within some hello-world android app. I do this with my forth compiler (www dot isforth dot com/a4.tar.bz2) and the executable is instantlhy killed by the android security enhancement bs.
it only took about 200 ish tries on this stupid capcha to finally be able to HUMANY FREEKING READ IT!
hate this bull****
Click to expand...
Click to collapse
well nobody seems to be able to tell me why i cannot spawn a native process so i converted my native process into a native dynamic library. this instantly segfaults any time i try exeucte a swi 0 opcode. can someone please tell me why i am not able to make system calls in native code? please dont tell me to link to some external library, this IS the external library.
some code...
.section userData, "w" @Nobits
userList:
.space 0x00100000
this enlarges the resultant object module by 0x01000000 bytes so the android NDK seems to be ignoring the @Nobits
ldr r1, = userList
str r1, [r1]
this segfaults so the android NDK seems to be ignoring the "w" flag.
:/
any swi 0 anywhere inside my library, no matter what the system call instantly segfaults. is there some perms i need to set in my manifest to allow my library to make system calls?

ExtensibilityApp class in WP 8.1 Silverlight

Hi all,
If you've read the text that USED to exist here before, scratch that. Big Thanks to @Sunius1 for clarifying what I thought was a win. Due to this, I DID find something interesting in regards to the ExtensibilityApp class (Windows.Phone.System.LockscreenExtensibility.ExtensibilityApp). I happened to also find a hidden capability "ID_CAP_SHELL_DEVICE_LOCK_UI_API" (Seems to be a locked CAP because it only works on Emulator. I get a deployment error on my if I try including this capability). I suspected that these two worked together, but I wanted to make sure of this.
Before we get started, read through the documentation from this site: http://msdn.microsoft.com/en-us/lib...lockscreenextensibility.extensibilityapp.aspx.
We have the following methods:
BeginUnlock
EndUnlock
GetLockPinpadHeight
IsLockScreenApplicationRegistered
IsSystemOverlayApplicationRegistered
RaiseToastNotifications
RegisterLockScreenApplication
RegisterSystemOverlayApplication
UnregisterLockScreenApplication
UnregisterSystemOverlayApplication
EDIT: After the release of the Live Lock Screen app, my speculations about the ID_SHELL_CAP_DEVICE_UI_API capability and the ExtensibilityApp object were correct. Thanks to @jessenic for finding out a good bit of info on this with me.
It seems that in order to get this working, we have to add an Extension to the WMAppManifest.xml
<Extension ExtensionName="LockScreen_Application" ConsumerID="XXXXX" TaskID="_default" ExtraFile="Extensions\\LockAppExtension.xml" />
In the LockAppExtension.xml:
<?xml version="1.0"?>
<x:Extension xmlns:x="urn:LockApp">
<AppID>AppNameForLockScreen</AppID>
</x:Extension>
As usual, Microsoft doesn't really give us much in terms of documentation.. Probably because it isn't meant to be used by the normal developer Confirmed: For now we have to actually ask for permission in order to use the cap. As to whether we'll get that granted? Who knows....
All of these methods have no parameters at all, but I can almost guarantee this has to do with having an application that can control the lock screen.
This thread will be for efforts in breaking this open and seeing whether we can create lockscreen applications..
Homebrew Lockscreen Apps:
Lockscreen App by @-W_O_L_F-
There are actually two Windows.winmd files in Windows Phone SDK, one for Silverlight 8.1 apps and one for Jupiter 8.1 phone apps (located in C:\Program Files (x86)\Windows Phone Silverlight Kits\8.1\ and C:\Program Files (x86)\Windows Phone Kits\8.1\). There's only one the phone. And some APIs support only one app type (it's phone limitation it seems: faking .winmd file results in Platform::InvalidOperationException, saying you cannot use that API from this app type). That explains why the one on the phone has more APIs available than either of for single app type.
As for LockscreenExtensibility - it's documented, just not available for Jupiter apps:
http://msdn.microsoft.com/en-us/lib...ows.phone.system.lockscreenextensibility.aspx
Sunius1 said:
There are actually two Windows.winmd files in Windows Phone SDK, one for Silverlight 8.1 apps and one for Jupiter 8.1 phone apps (located in C:\Program Files (x86)\Windows Phone Silverlight Kits\8.1\ and C:\Program Files (x86)\Windows Phone Kits\8.1\). There's only one the phone. And some APIs support only one app type (it's phone limitation it seems: faking .winmd file results in Platform::InvalidOperationException, saying you cannot use that API from this app type). That explains why the one on the phone has more APIs available than either of for single app type.
As for LockscreenExtensibility - it's documented, just not available for Jupiter apps:
http://msdn.microsoft.com/en-us/lib...ows.phone.system.lockscreenextensibility.aspx
Click to expand...
Click to collapse
Well that is very good to know! Thanks for the clarification. The best part is that I was actually able to compile without receiving an error (somehow).
I found something that may be of use in order to get the LockscreenExtensibility working (I just tried on a Silverlight 8.1 app and got access denied).
<Capability Name= "ID_CAP_SHELL_DEVICE_LOCK_UI_API"/> <----. Can't be used OOTB
EDIT: I just tested this in the Emulator and it really IS the capability that the LockscreenExtensibility needs in order for it to work.
snickler said:
I found something that may be of use in order to get the LockscreenExtensibility working (I just tried on a Silverlight 8.1 app and got access denied).
<Capability Name= "ID_CAP_SHELL_DEVICE_LOCK_UI_API"/> <----. Can't be used OOTB
EDIT: I just tested this in the Emulator and it really IS the capability that the LockscreenExtensibility needs in order for it to work.
Click to expand...
Click to collapse
I assume this is the thing Rudy Hyun used to create the lockscreen app at Build?
TheInterframe said:
I assume this is the thing Rudy Hyun used to create the lockscreen app at Build?
Click to expand...
Click to collapse
I speculate that this is what he's using. I bet there's more going on that we have yet to figure out. It also could be that the base class EXISTS, but the full implementation isn't available yet. Who knows.
snickler said:
I speculate that this is what he's using. I bet there's more going on that we have yet to figure out. It also could be that the base class EXISTS, but the full implementation isn't available yet. Who knows.
Click to expand...
Click to collapse
Ah, Yes that makes sense. I wonder if there are any other "half-baked" API's in the SDK?
Edit: I Know it sounds stupid but honestly I think we should have a thread dedicated to finding odd API's (Just found one: Windows.Phone.System.SystemProtection, nothing terribly useful though)
TheInterframe said:
Ah, Yes that makes sense. I wonder if there are any other "half-baked" API's in the SDK?
Edit: I Know it sounds stupid but honestly I think we should have a thread dedicated to finding odd API's (Just found one: Windows.Phone.System.SystemProtection, nothing terribly useful though)
Click to expand...
Click to collapse
there are also some hidden APIs in the current SDK for 3D Touch-enabled Apps!
From WP Central:
Some of the features include APIs for gestures, side interactions and even heat maps.
Crazy stuff.
Believe it or not, some of these APIs for developers are in the current SDK, they're just not visible. What this mean though is developers will have access to this 3D Touch technology for their apps. It also means that Microsoft will have a small batch of third-party apps supporting this 3D Touch technology on launch day.
Click to expand...
Click to collapse
source: http://www.wpcentral.com/microsofts-next-flagship-windows-phone-november-3d-touch
Yea, even though those 3D touch APIs may be available, they're not particularly useful, as they require special hardware to work.
Sunius1 said:
Yea, even though those 3D touch APIs may be available, they're not particularly useful, as they require special hardware to work.
Click to expand...
Click to collapse
That is true. Sort of of a side question though, has anyone made a OEM account and looked over the API documentation there? There maybe some useful things we could learn about WP and maybe further a jailbreak for all WP devices....
TheInterframe said:
That is true. Sort of of a side question though, has anyone made a OEM account and looked over the API documentation there? There maybe some useful things we could learn about WP and maybe further a jailbreak for all WP devices....
Click to expand...
Click to collapse
API isn't much useful as long as you cant really use most of functions due to policies.
ultrashot said:
API isn't much useful as long as you cant really use most of functions due to policies.
Click to expand...
Click to collapse
Ah, Yes that makes sense....
http://www.wpcentral.com/joe-belfiore-announces-new-updates-sheds-details-lock-screen-app
Sounds like there will be a dev preview update to enable lockscreen functionality quite soon. Joe also mentioned keeping the lock screen in memory. So 512 MB devices won't get the functionality soon....
Good stuff. Another question: can apps show the action center? Because I want code an app to show notifications on lockscreen. Thanks
Marocco2 said:
Good stuff. Another question: can apps show the action center? Because I want code an app to show notifications on lockscreen. Thanks
Click to expand...
Click to collapse
something to force the volume/music control on the lock screen to automatically open would be really useful as well
Updated first post with some more data since the Live Lockscreen App debuted yesterday. There's more I didn't get into, but I want others to dig in and find out
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Sunius1 said:
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Click to expand...
Click to collapse
I don't think its that but most likely the fact that the API is un-optimized, some of the facts you stated (i.e. Slow start up, documentation is lacking) etc... The fact the OS needs to be updated to show a section telling the user what lock screen app has taken over (since the setting page doesn't now)
Edit: Remember what Joe said about keeping the lockscreen in memory and 512MB devices might not be supported for that reason? Yeah seems like they aren't doing that since you can see the resume time for the lo screen is wayyy to much
Sunius1 said:
I suppose we can only speculate how it works at this point, but if I had to guess, it goes like this:
1. You have 2 projects in your LockScreenApp solution, one for the application to register the lockscreen, and the second one for the actual lock screen application.
2. The former would use ExtensibilityApp APIs to register the the second one, coupled with the manifests so it's all "valid".
3. The second application is just a another app that is able to process input and draw whatever it wants on the screen. That would explain why there's a delay at it starting when you press lock screen button while the phone is sleeping (probably it's a time for .NET to startup? Direct3D app should be able to start much faster).
Although this is only speculation, I think this makes sense, because that's how background tasks work on Windows, at least. I wonder though, why Microsoft is not releasing the APIs to be used in public - are they afraid somebody will make a lockscreen application that will drain the battery fast or something?
Click to expand...
Click to collapse
You are correct. Two projects: One is the settings page, which is the main entrypoint of the app when it's opened from the start menu and the second one is the actual lockscreen app.
The settings page uses the ExtensibilityApp APIs to register the second one as a lock screen application. That second application is another 8.1 Silverlight app that uses a LockScreen_Bridge WinRT component that has native access to read what is shown on the lockscreen from the WP Settings item.
It then uses some storyboards to make it do different things as you're swiping up and down on the LayoutRoot grid. It does use a timer so that's where that little lag comes from.
The only background stuff it's doing is latching on to system events ("Start button being touched for example").
I can see where MS would be protective of this. They DID say that they would be releasing a public version of the API at some point. I'm hoping it's not one of the situations that leaves it public only when they've approved you to be able to use it.
It does suck that it's restricted to 8.1 Silverlight though. I could see some Music Apps wanting to take advantage of the lockscreen like this.
snickler said:
You are correct. Two projects: One is the settings page, which is the main entrypoint of the app when it's opened from the start menu and the second one is the actual lockscreen app.
The settings page uses the ExtensibilityApp APIs to register the second one as a lock screen application. That second application is another 8.1 Silverlight app that uses a LockScreen_Bridge WinRT component that has native access to read what is shown on the lockscreen from the WP Settings item.
It then uses some storyboards to make it do different things as you're swiping up and down on the LayoutRoot grid. It does use a timer so that's where that little lag comes from.
The only background stuff it's doing is latching on to system events ("Start button being touched for example").
I can see where MS would be protective of this. They DID say that they would be releasing a public version of the API at some point. I'm hoping it's not one of the situations that leaves it public only when they've approved you to be able to use it.
It does suck that it's restricted to 8.1 Silverlight though. I could see some Music Apps wanting to take advantage of the lockscreen like this.
Click to expand...
Click to collapse
Quite interesting...!
The API in itself is quite powerful, custom lockscreens with weather animations are possible! http://wmpoweruser.com/wp8-1-live-l...amazing-lock-screen-weather-animations-video/

Categories

Resources