Code:
[U][SIZE="5"]new Microsoft.Xna.Framework.Game().Exit();[/SIZE][/U]
To exit app at any place in silverlight.
Add reference to:
> Microsoft.Xna.Framework.Game (.dll)
> Create class named eg Quit that inherits "Game" from XNA framework
Code:
public class Quit : Microsoft.Xna.Framework.Game { }
> Make random silverlight click handler or other that will capture the event
Code:
private void Root_Start_Click(object sender, RoutedEventArgs e)
{
new Quit().Exit();
}
OR
> Anywhere in the code there YOU want it to exit.
Code:
new Quit().Exit();
Explanation (complicated)
The XNA framework is based on a way that will make an infinitive loop where the "Exit();" ends the loop that get the !
Code:
private GameHost host;
! of XNA, the XNA and silverlight share the same base host,
the "taskhost.exe" %1 (args).
Now, to the point, the GameHost (host) includes a !void! that is completely !internal! witch calls the main taskhost, "yep im done, saved everything and you can now kill (shutdown) me (app/silverlight/XNA).
So, shorthanded.
> call
Code:
new Quit().Exit();
OR
> direct baseclass-call
Code:
new Microsoft.Xna.Framework.Game().Exit();
Goods:
-Passes Microsoft Application submission (no p/invoke what so ever)
-No GetMethods()[x].Invoke (CF 3.7 blocked))
-No need to make an "QuitException", submission fails probably.
Tested in emulator & [Europe] Omnia 7, Obi One Kanobie: "may the invokes be with someone else" (no, invokes) =D
If you use a QuitException the app will pass submission. That's the recommended method and my app passed just fine using it.
RustyGrom said:
If you use a QuitException the app will pass submission. That's the recommended method and my app passed just fine using it.
Click to expand...
Click to collapse
Its not recommended (source?), did you thought about Visual Studio 2010 catches all exceptions?, it gets extra anoying.
Rule: Do never burry exceptions and let them go unhandled.
Silverlight apps that use XNA methods and classes (and vice-versa) will fail certifications. It's in the guidelines:
4.2.5 The application must not call any APIs in the Microsoft.Xna.Framework.Game assembly or the Microsoft.Xna.Framework.Graphics assembly when using any methods from the System.Windows.Controls namespace
Click to expand...
Click to collapse
Hello it was some days I encounter a difficulty to play music that is in the internal memory of the mobile phone.
I want to play music that is in phone memory with a "MediaElement"and not with the "MediaPlayer.play ()".
Here's my example:
Code:
foreach( var source in mediaSource.GetAvailableMediaSource())
{
mediaelement test= new mediaelement();
ml =new MediaLibrary(source);
mediaelement test = ml.songs[1]; // !!!! Erreur ici!!!
}
Is it possible to convert a "media.library.song [0] " to "MediaElement"?
please help me I'm losing hope ^ ^
In any case I find it unfortunate that we can not access the music from the phone without having to go through the application of basic phone
up please ...
kingmiddle said:
Hello it was some days I encounter a difficulty to play music that is in the internal memory of the mobile phone.
I want to play music that is in phone memory with a "MediaElement"and not with the "MediaPlayer.play ()".
Here's my example:
Code:
foreach( var source in mediaSource.GetAvailableMediaSource())
{
mediaelement test= new mediaelement();
ml =new MediaLibrary(source);
mediaelement test = ml.songs[1]; // !!!! Erreur ici!!!
}
Is it possible to convert a "media.library.song [0] " to "MediaElement"?
please help me I'm losing hope ^ ^
In any case I find it unfortunate that we can not access the music from the phone without having to go through the application of basic phone
Click to expand...
Click to collapse
drop mediaelement control to your layout , rename it to ml , and it should works
Tom
Thank you very much for your response! I'm glad to see that there may be a solution.
However I have a question for "xm" you advise me ..
Do I have to rename my MediaElement in the file format "XM"?
Is that correct?
thank you very much, I realized my mistake.
But do I convert a music "Medialibrary" to "MediaElement?
Oh damn... MediaElement != Song
You must use MediaPlayer.Play(Song song);
Yess i say ^^ but i need use a mediaElement to read a music from "mediaLibrary"
it's possible ?
Because the "mediaPlayer" from windows phone can't set position (seek position) of the song ... :-(
Thanky you for your futur's responses..
Today I found very annoying and strange bug (or, may be, MS call it "feature" ). Seems like directories on isf can hold 1024 files only...
Try code below:
Code:
Random rnd = new Random();
using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{
byte[] data = new byte[1024];
isf.CreateDirectory("test");
for (int i=0; i<1025; i++)
{
string fileName = "test\\" + i.ToString("D4") + ".bin";
using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream(fileName, FileMode.Create, isf))
{
rnd.NextBytes(data);
fs.Write(data, 0, data.Length);
}
}
}
After loop completed, resulting directory "test" will be empty! But change i<1024 and you'll get all yours 1024 files...
Tested on emulator and HTC Surround, same results. Can't find any documentation about this limitation... Shame on you, MS!
Update: another strange behavior ('cause of this bug) - if you already have 1024 files and try to add one more, the whole directory content is "magically" disappear But exception isn't thrown...
Interesting, I'll try it as well. This would be lame to have to work around.
Dbeattie said:
Interesting, I'll try it as well.
Click to expand...
Click to collapse
Yes, please, confirm...
I can't test this at the moment but I know I write well over 1000 files to /shared/media so I'm curious to tet this.
sensboston said:
Yes, please, confirm...
Click to expand...
Click to collapse
Hey just tried it out, wrote 2k items to a folder called "Data".
While it didn't show up in the Windows Phone Power tools, the file does exist in the folder itself.
bool success = storage.FileExists(Path.Combine("data", "1999"));
So it's either a problem with the WPConnect api or with the power tools, haven't tried the command line tool.
Yep, fortunately you are right, it's a ISETool.exe (or drivers) bug, not a WP7 ISF.
sensboston said:
Yep, fortunately you are right, it's a ISETool.exe (or drivers) bug, not a WP7 ISF.
Click to expand...
Click to collapse
Could you therefore edit the title of the thread please?
Thanks.
Hello alltogether,
I digged into the Lollipop code to look for a solution to restore the old Kitkat silent mode in Lollipop with Xposed.
I got a working prototype now but would like to add the silentmode icon back to the statusbar.
Unfortunately it got removed in Lollipop so I have to port it forward from an older ROM.
To do that I need to hook into the PhoneStatusBarPolicy class, which for some reason fails.
This is my code:
Code:
private static final String CLASS_PHONE_STATUSBAR_POLICY = "com.android.systemui.statusbar.phone.PhoneStatusBarPolicy$1";
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (lpparam.packageName != "android")
return;
final Class<?> classStatusbarPolicy = XposedHelpers.findClass(CLASS_PHONE_STATUSBAR_POLICY, lpparam.classLoader);
XposedHelpers.findAndHookMethod(classStatusbarPolicy, "updateVolumeZen",
new XC_MethodReplacement() {
...
});
}
}
But for some reason it fails:
Code:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.systemui.statusbar.phone.PhoneStatusBarPolicy" on path: DexPathList[[zip file "/system/framework/services.jar", zip file "/system/framework/ethernet-service.jar", zip file "/system/framework/wifi-service.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Does anyone have an idea?
Thanks!
You should change lpparam.packageName != "android"
to
lpparam.packageName.equals("android")
Why android? This class is within com.android.systemui package.
C3C076 said:
Why android? This class is within com.android.systemui package.
Click to expand...
Click to collapse
Ah I guess I misread rovos post about the new API with the dummy android package.
In detail, this means: If you want to hook a system service like PackageManagerService, you can no longer do that in initZygote(). Instead, move your code to handleLoadPackage() and check for dummy package "android". Make sure you use lpparam.classLoaders when looking for classes and hooking methods. This way has worked in older Android versions as well, so you don't lose backwards-compatiblity.
Click to expand...
Click to collapse
After reading it again this just applies to system services. And based on some code I saw at your Gravitybox repo it doesn't even seem to apply to all system services as you are still hooking a couple during initZygote
Xposed is new to me, but it's an amazing toolset!
So hooking works fine now, unfortunately it just got a bit ugly as the StatusBarManager which I'd like to use for the icons can't get imported. I guess I'll have to use some reflection to get into the class hehe.
In the spirit of open-source, if there's one ROM that deserves to be "home-brewed" in addition to AOSP and Lineage, it's LineageOS4Microg. This guide will explain how to do so using Docker. LineageOS and Microg are explained below followed by the guide.
{
"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"
}
Code:
/*
* I'm not responsible for bricked devices, damage, loss of Google services, you getting fired because the alarm app failed, etc. Do this at your own risk.
* Please do some research if you have any concerns about features included in the products you find here before flashing it!
* YOU are choosing to make these modifications.
* Your warranty may/will be void if you tamper with any part of your device / software.
* Same statement for XDA.
*/
About LineageOS4MicroG & LineageOS
LineageOS unofficial fork with built-in microG gapps implementation.
Full Play Services compatibility [Well-almost...YMMV]
Our ROM has built-in microG free-as-in-freedom re-implementation of Google's proprietary Android user space apps and libraries. This enables you to use every Google service you need without keeping another closed-source binary blob in your Android system.
Native F-Droid support
LineageOS for microG comes with F-Droid already installed. You can use it to access plenty of FOSS applications or even a Play Store bridge repository like Playmaker or GPlayWeb.
About LineageOS
LineageOS is a free, community built, aftermarket firmware distribution of Android 9 (Pie), which is designed to increase performance and reliability over stock Android for your device.
LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.
All the source code for LineageOS is available in the LineageOS Github repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review.
Learn more at:
LineageOS: https://lineageos.org/
LineageOS4MicroG: https://lineage.microg.org/
Click to expand...
Click to collapse
Rom Built by Bernie_nixKnown issues:
USB-C headphones work for music, watching videos, etc. They don't work in the phone app...yet. (working on this)
Some users report VOIP calls don't work properly. YMMV. Skype, Whatsapp, Nextcloud Talk, working great for me.
Automatic updates not yet implemented but will be in a future build.
You tell me.
Building Requirements
1. A fast PC or VPS account such as Google Compute Engine. Minimum PC recommended requirements are Intel i5 or equivalent, 4 cores 8 threads minimum (more cores and better CPU recommended), 16GB ram, SSD and 300GB free drive space minimum, fast internet connection (you will download over 30GB of sources).
2. Ubuntu 18.04 is supported here. If you use Windows or another version of Linux, let others know of your tweaks and workarounds.
3. Patience and time. Downloading sources, setting up and building a rom will take hours if not days (depending on your PC hardware and internet speed).
Environment Setup & Build1. Install Docker on Ubuntu (run each command once in terminal)
Code:
sudo apt-get update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
2. Test that docker is running (run command in terminal)
Code:
docker run hello-world
You should see something like this, "docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world ca4f61b1923c: Pull complete Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. ..."
3. Pull lineageos4microg docker onto your pc (run command in terminal)
Code:
docker pull lineageos4microg/docker-lineage-cicd
4. After pull is complete, create the following directories in your home/YOURUSERNAME directory
lineageos4microg
lineageos4microg/src
lineageos4microg/ccache
lineageos4microg/local_manifests
lineageos4microg/keys
lineageos4microg/logs
lineageos4microg/zips
So it might look something like this: home/JoeAndroid/lineageos4microg
5. Copy the 4 attached xml files (bottom of this post) to your local_manifests folder
These are: ocean.xml, include_proprietary.xml, proprietary.xml, and custom_packages.xml
6. In terminal, cd into the lineage4microg folder, and copy and paste the following commands all at once after changing YOURUSERNAME to your username in ubuntu. For an explanation of options, see the link at bottom of post. This code will download sources, sync your repos with newest updates and start your build. This step could take hours. It is downloading sources, syncing repos and building your rom!
Code:
sudo docker run \
-e "BRANCH_NAME=lineage-16.0" \
-e "DEVICE_LIST=ocean" \
-e "SIGN_BUILDS=true" \
-e "SIGNATURE_SPOOFING=restricted" \
-e "WITH_SU=true" \
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension " \
-e "INCLUDE_PROPRIETARY=false" \
-v "/home/YOURUSERNAME/lineageos4microg/lineage:/srv/src" \
-v "/home/YOURUSERNAME/lineageos4microg/zips:/srv/zips" \
-v "/home/YOURUSERNAME/lineageos4microg/logs:/srv/logs" \
-v "/home/YOURUSERNAME/lineageos4microg/cache:/srv/ccache" \
-v "/home/YOURUSERNAME/lineageos4microg/keys:/srv/keys" \
-v "/home/YOURUSERNAME/lineageos4microg/manifests:/srv/local_manifests" \
lineageos4microg/docker-lineage-cicd
7. Your build should be in the zips folder when complete! Flash in twrp/ofox.
8. If your build fails, check the log in lineageos4microg/logs/ocean folder. If you receive the following error, "Can not locate config makefile for product "lineage_ocean"" you will need to copy the 4 xmls from lineageos4microg/local_manifests to lineageos4microg/manifests.
References and links:
https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04
https://github.com/lineageos4microg/docker-lineage-cicd
Telegram group for additional ROMS, files and support: https://t.me/mG7Power
Thanks to Dark98, Electimon, Barry and many others for initial help and repos when building this rom.
Reserved #1
Reserved #2
Thanks, been wanting to try to build this.
I tried am running this on ubuntu 18.04 vm, followed all the instructions.
after I type in the docker commands get this after a few minutes:
sed:can't read build/core/version_defaults.mk:no such file or directory
can't detect the android version.
Any suggestions?
skalnas said:
Thanks, been wanting to try to build this.
I tried am running this on ubuntu 18.04 vm, followed all the instructions.
after I type in the docker commands get this after a few minutes:
sed:can't read build/core/version_defaults.mk:no such file or directory
can't detect the android version.
Any suggestions?
Click to expand...
Click to collapse
Can you take a picture of the screenshot including how you typed in the commands? Need a bit more info
I just pasted the code changing username screenshot attached
skalnas said:
I just pasted the code changing username screenshot attached
Click to expand...
Click to collapse
I wonder if it's related to "steve" in your build commands but your username is Steven on the VM?
Bernie_nix said:
I wonder if it's related to "steve" in your build commands but your username is Steven on the VM?
Click to expand...
Click to collapse
I did rerun the script with the username steven and it appeared to be working.
went to bed and when i woke up I was excited to see it said build completed. however i could not
find the zip file in the zips folder. looking at the logs error: Can not locate config makefile for product "lineage_ocean".
I saw in the op to move the 4 xml files to manifests dir, however I had gotten permission denied when trying to
copy to the manifests dir. i deleted the dir, recreated the dir and moved the files.
I am going to try building again.
skalnas said:
I did rerun the script with the username steven and it appeared to be working.
went to bed and when i woke up I was excited to see it said build completed. however i could not
find the zip file in the zips folder. looking at the logs error: Can not locate config makefile for product "lineage_ocean".
I saw in the op to move the 4 xml files to manifests dir, however I had gotten permission denied when trying to
copy to the manifests dir. i deleted the dir, recreated the dir and moved the files.
I am going to try building again.
Click to expand...
Click to collapse
You need to sudo cp -R (drag 4 files to terminal here) /YOURUSERNAME/lineageos4microg/manifests. Then re run script
Bernie_nix said:
You need to sudo cp -R (drag 4 files to terminal here) /YOURUSERNAME/lineageos4microg/manifests. Then re run script
Click to expand...
Click to collapse
Thanks for the assistance, I am new to linux, hence the vm. My PC is amd fx8350 chip 8 core, 16 gb ram on win10 pro 64 bit on
PNY 480 gb ssd drive.
Just a few questions: The vm i set up to build this I set at 150gb. Prior to syncing the repos and running
the build script again i had about 135 gb free. It's been on starting build for ocean lineage-16.0 branch
for about 5 hours.
Should it have completed or thrown an error by now?
Also, lineageos4microg folder states it's using 57gb, I now have 32 gb free space 5 hours into build.
Not sure if I should keep waiting to see if build completes?
I have attached the log which i think is for the build in progress.
Thanks again
skalnas said:
Thanks for the assistance, I am new to linux, hence the vm. My PC is amd fx8350 chip 8 core, 16 gb ram on win10 pro 64 bit on
PNY 480 gb ssd drive.
Just a few questions: The vm i set up to build this I set at 150gb. Prior to syncing the repos and running
the build script again i had about 135 gb free. It's been on starting build for ocean lineage-16.0 branch
for about 5 hours.
Should it have completed or thrown an error by now?
Also, lineageos4microg folder states it's using 57gb, I now have 32 gb free space 5 hours into build.
Not sure if I should keep waiting to see if build completes?
I have attached the log which i think is for the build in progress.
Thanks again
Click to expand...
Click to collapse
Not recommended to run in a VM as it will take considerably longer to build but if you have the time (hours, days). As far as hard drive space, 150gb is cutting it very close. Better to have 250gb minimum. Don't know if you'll have enough. As far as your log and actual build, it's building! Congrats. If you scroll down to the bottom of your log, you'll see it's at 23%.
Bernie_nix said:
Not recommended to run in a VM as it will take considerably longer to build but if you have the time (hours, days). As far as hard drive space, 150gb is cutting it very close. Better to have 250gb minimum. Don't know if you'll have enough. As far as your log and actual build, it's building! Congrats. If you scroll down to the bottom of your log, you'll see it's at 23%.
Click to expand...
Click to collapse
Yes, as I feared i did run out space, but at least I know it was building. I may try to install ubuntu in a dual boot.
Thanks
skalnas said:
Yes, as I feared i did run out space, but at least I know it was building. I may try to install ubuntu in a dual boot.
Thanks
Click to expand...
Click to collapse
Awww... Well I had that happen before. Even if you have an old platter hdd (not ssd) as long as it's got the GBs of space it will take a little longer to build but for these purposes will do just fine. I use both SSD and hdds to build.
Got my dual boot set up. First tried Ubuntu but it kept locking up, went with Linux mint. Got a 250 GB partition, going to give it another go tommorow.
View attachment 4980819well, after switching from VM to dual boot, I gave it another go, and i got a msg in linux mint that i ran out of space about 3 1/2 hrs into build. I had set up 250gb partition as you suggested. I did 30gb root, 220 GB home,4 GB swap.
Can you take a look at the logs, i'm not clear looking at logs how much of build completed.
There was the zip file about 604 mb in the zips folder, which I could open(along with an sha and md5 files, which i dont know anything about.) I'm thinking possibly the build completed despite the warning in linux about running of free space.
I shrank the /root partition in gparted to 20gb and tried to extend the extra 10gb to home, but i couldn't.
Is it possible to specify 25gb ccache in the docker script somehow so that instead of the 50 it seems to allocate, maybe that will solve the space issue?
Thanks again, looks like progress.
Freed up some more space for build, now when trying to sync repos i get this msg Missing "vendor/lineage", aborting.
suggestions?
skalnas said:
Freed up some more space for build, now when trying to sync repos i get this msg Missing "vendor/lineage", aborting.
suggestions?
Click to expand...
Click to collapse
I looked at the last lines in your log... it looks like it built. Did you check your zips folder?
boot.img already exists, no need to overwrite...
dtbo.img already exists, no need to overwrite...
system.img already exists, no need to overwrite...
vendor.img already exists, no need to overwrite...
Total of 704512 4096-byte output blocks in 23 input chunks.
Total of 147456 4096-byte output blocks in 13 input chunks.
done.
Click to expand...
Click to collapse
Where is "Missing "vendor/lineage", aborting." appearing?
Bernie_nix said:
I looked at the last lines in your log... it looks like it built. Did you check your zips folder?
Where is "Missing "vendor/lineage", aborting." appearing?
Click to expand...
Click to collapse
Thanks, yes there was a zip there, wasnt sure if it was safe to flash, with the error space ran out ,but figured build did complete, as the zip wasnt corrupted.
As far as repo error:
"OSError: [Errno 17] File exists: '/srv/src/LINEAGE_16_0/device/generic/mini-emulator-arm64/.git.tmp'
error: Cannot checkout bernie-nix/android_device_motorola_sdm632-common-1: ManifestInvalidRevisionError: revision lineage-16.0 in bernie-nix/android_device_motorola_sdm632-common-1 not found
error: in `sync -c --force-sync`: revision lineage-16.0 in bernie-nix/android_device_motorola_sdm632-common-1 not found.
I did switch to the ocean.xml listed in your other thread posted by dark98 and the repo did sync., but I didn't proceed with the build.
Thanks again for all your help, think i will try to dirty flash my succesful build over yours, unless i should clean flash.
skalnas said:
Thanks, yes there was a zip there, wasnt sure if it was safe to flash, with the error space ran out ,but figured build did complete, as the zip wasnt corrupted.
As far as repo error:
"OSError: [Errno 17] File exists: '/srv/src/LINEAGE_16_0/device/generic/mini-emulator-arm64/.git.tmp'
error: Cannot checkout bernie-nix/android_device_motorola_sdm632-common-1: ManifestInvalidRevisionError: revision lineage-16.0 in bernie-nix/android_device_motorola_sdm632-common-1 not found
error: in `sync -c --force-sync`: revision lineage-16.0 in bernie-nix/android_device_motorola_sdm632-common-1 not found.
I did switch to the ocean.xml listed in your other thread posted by dark98 and the repo did sync., but I didn't proceed with the build.
Thanks again for all your help, think i will try to dirty flash my succesful build over yours, unless i should clean flash.
Click to expand...
Click to collapse
Yes, use the other xml if you want. They should both be about the same...you might even get updated sources, you might not...but it should build. I looked at the error above. The only suggestion I would make in your current xml if you want to continue using it is to remove revision="lineage-16.0" on the bernie-nix/android_device_motorola_sdm632-common-1 entry. As far as the zip that completed, how big is it?
Bernie_nix said:
Yes, use the other xml if you want. They should both be about the same...you might even get updated sources, you might not...but it should build. I looked at the error above. The only suggestion I would make in your current xml if you want to continue using it is to remove revision="lineage-16.0" on the bernie-nix/android_device_motorola_sdm632-common-1 entry. As far as the zip that completed, how big is it?
Click to expand...
Click to collapse
The zip was 604mb, i did successfully flash it, thanks again for your help and guide building my first rom!
so the xml file should be edited to:
<project name="bernie-nix/android_device_motorola_sdm632-common-1" path="device/motorola/sdm632-common" remote="github"/>
?
btw, i don't see your repos on github anymore.