cross-platform

Xamarin Forms image size mismatch

[亡魂溺海] 提交于 2019-12-23 06:59:02
问题 I'm implementing a cross-platform app using Xamarin Forms and I'm struggling with a strange bug: I'm trying to create a button with a text upon it. To achieve it, I'm using AbsoluteLayout . I've added a image to the iOS project for each iOS resolution types (.png, @2x.png, @3x.png). Everything works fine with standard <Image /> tag. However, when wrapping the image in absolute layout - the Image lose its resolution proportion and it results in borders. The code above: <AbsoluteLayout

HandleNotificationOpened are not handled if app is closed before i open the notification

喜欢而已 提交于 2019-12-23 04:56:29
问题 HandleNotificationOpened is working perfectly if App is on the background or running but it's not fired if i open the notification when app is closed. I've tried to persist the data from event with SecureStorage, because i'm not sure if the event run but in the wrong time or it doesn't run at all. public App() { OneSignal.Current.StartInit("onesignal-id").HandleNotificationOpened(HandleNotificationOpened).HandleNotificationReceived(HandleNotificationReceived).EndInit(); } private async void

Alternative ways for developing for Android

巧了我就是萌 提交于 2019-12-23 04:29:43
问题 I am an Android developer. I know of a few cross-platform development tools such as Rhomobile Anscamobile's Corona SDK Phonegap Titanium Appcelerator Google App Inventor. If you know any tools apart from the ones I have listed please reply. Thanks in advance. 回答1: Of course there is Monodroid... 回答2: Sencha Touch 回答3: Air for Android Monodroid Android scripting http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html 回答4: App Inventor is fun. This is what I have 回答5:

Weird pcap header of byte sequence 0a 0d 0d 0a created on Mac?

烈酒焚心 提交于 2019-12-23 03:09:19
问题 I have a PCAP file that was created on a Mac with mergecap that can be parsed on a Mac with Apple's libpcap but cannot be parsed on a Linux system. combined file has an extra 16-byte header that contains 0a 0d 0d 0a 78 00 00 00 before the 4d 3c 2b 1a intro that's common in pcap files. Here is a hex dump: 0000000: 0a0d 0d0a 7800 0000 4d3c 2b1a 0100 0000 ....x...M<+..... 0000010: ffff ffff ffff ffff 0100 4700 4669 6c65 ..........G.File 0000020: 2063 7265 6174 6564 2062 7920 6d65 7267 created by

How to handle code that is synchronous on one platform but async on another

ぐ巨炮叔叔 提交于 2019-12-23 02:09:12
问题 In writing my Xamarin-based cross-platform C# app, a situation I encounter fairly often is code that is synchronous on one platform but async on another. For example, file access is synchronous on iOS, Android, and Mac, but async on Windows. This leads to some tricky issues. First of all, on a pure coding level, the compiler wants a method to be either async or not. But it's worse than that. For example, if the iOS UI thread discovers that it needs to load a small file, and does so,

Cross-platform way of having non-blocking console input

a 夏天 提交于 2019-12-23 02:08:14
问题 I need a crossplatform way of calling std::cin in non blocking way. I know it's possible with threads, but maybe there is a better option? Threds seem to be overkill for this. 回答1: Standard C and C++ do not provide any means to do non blocking I/O. Typically, the C and C++ runtime environment does not see any input at all until the user has pressed the <ENTER> key. So, the only options are really to use a separate thread to read the input, or to use platform-specific methods to do the non

How to change the file's permission and last modified in Java?

岁酱吖の 提交于 2019-12-22 16:29:39
问题 To my knowledge, Java's File class does not support to change the file's permission and last modified date. Is there any proper way to do this in a cross-platform style? 回答1: I'm looking at the Java 6 documentation, and there is a setLastModified() method, as well as setReadable(...) and setWritable(...) and setExecutable(...) methods (all in the java.io.File class). So yes, there is a way... 来源: https://stackoverflow.com/questions/459622/how-to-change-the-files-permission-and-last-modified

How to change the file's permission and last modified in Java?

和自甴很熟 提交于 2019-12-22 16:29:10
问题 To my knowledge, Java's File class does not support to change the file's permission and last modified date. Is there any proper way to do this in a cross-platform style? 回答1: I'm looking at the Java 6 documentation, and there is a setLastModified() method, as well as setReadable(...) and setWritable(...) and setExecutable(...) methods (all in the java.io.File class). So yes, there is a way... 来源: https://stackoverflow.com/questions/459622/how-to-change-the-files-permission-and-last-modified

How do I load an image from the Asset Catalog on cross-platform xamarin XAML?

我们两清 提交于 2019-12-22 08:52:02
问题 It seems like a really easy thing to do, and in theory it looks very straight forward: create the Asset Catalog add an Image Set and name it "imageName" (without .png) add the images done or at least that's what i read pretty much everywhere, but I still can't get it to work. My XAML looks like this: <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:CrossBaiscs" x

Crossplatform library for uniquely identifying the machine my app is currently running on?

自作多情 提交于 2019-12-22 08:40:35
问题 So I have next situation - shared file system, over N alike machines. My app is run on all of them. I need to understand on which machine my app runs in each instance - some unique ID... Is there such thing, is it possible to emulate it? Is there any crossplatform library that would help with that? 回答1: There are two concerns here, security and stability of your matching. Hardware characteristics are a good place to start. Things like MAC address, CPU, hdd identifiers. These things