I have been trying to save contact into contact book via the following code,
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.putExtra(ContactContracts.Intents.NAME, "Ryan");
While the above code works perfectly on most of the devices but not working in Oxygen OS 11 One plus devices. The name field comes empty while saving while other fields are inserted properly
The code works fine on Android 11 emulator and the issue seems to be specific to Oxygen OS 11.
I assume they replaced the accepted "key" for name field in ContactsContract class.
For anyone still looking for an answer,
I tried changing the key, it does not work.
What worked for me is either opening google contacts / adding contact directly via content provider.
Related
Hello Everyone I want to share the Text on Xamarin Form using Library plugin.share. I have successfully implemented the library and on android i can able to share the text but in iOS it returns me nothing. i have done the share code on button click event so when i click on button in iOS its doesn't returns me anything.i tried the Below code but doesn't got succeed
CrossShare.Current.Share("Hii alll", "Share");
please help me to get out of this,thanks in advance
You want to take a look at UIActivityViewController, you can find the documentation here https://developer.xamarin.com/api/type/MonoTouch.UIKit.UIActivityViewController/
And Xamarin.Forms specific example http://devcenter.wintellect.com/jwood/implementing-sharing-in-xamarin-forms
This is a bit old, but I was having a similar issue and was able to resolve it.
First of all, you need to add the plugin Plugin.Share to ALL Xamarin.Forms projects (Portable, iOS, Android, UWP).
In the class that references the share code, add...
using Plugin.Share;
using Plugin.Share.Abstractions;
CrossShare.Share() doesn't work with strings, directly. You need to new up a ShareMessage.
var title = "Title For The Share";
var message = "Text to share.";
await CrossShare.Current.Share(new ShareMessage { Text = message, Title = title });
I can't say specifically to iOS, as I don't have a Mac and can't test that project, but Android and Windows 10 is working.
I am busy creating a small note taking application but I have run into a bit of an issue.
I cannot seem to get an NSTextView to work with core data. I have watched this video https://www.youtube.com/watch?v=qypMqkT20LU and I have also read "Swift development with Cocoa".
"Swift development with Cocoa" uses an nstextview but they are not using core data. From the this book I have gathered that I need to use NSAttributedString for the content of the NSTextView.
The issue that I am having is that I cannot find out how to use that with Core Data.
I am trying to make this app like the video is so that I do not need to use any code but just use pure bindings.
I have also tried using binary data type for the attribute in my entity as well as transformable but then I get an issue where the application cannot start because it cannot find the applications saved data.
Any help would be much appreciated on how to use a NSTextView with core data and bindings.
It turns out that the storedata file that is created when the application launches was not being overwritten, so every time I changed and attribute in the storedata it would break because the attributes were not the same.
To fix this issue I had to delete the storedata every time I ran the app. The file can be found in /Users/{user}/Library/Application\ Support/{app name}
Usually the app name would be com.yourcompany.appname
I've problem with using BingMapsDirectionsTask on device with Windows Phone 7.8 and set polish language (pl-PL). In my app I'm trying to call:
var bingMapsDirectionsTask = new BingMapsDirectionsTask();
var destination = new LabeledMapLocation(dest.Name, dest.LocationItem);
bingMapsDirectionsTask.End = destination;
bingMapsDirectionsTask.Show();
When I change device location to other culture, for example en-US the same code works correctly, so I can assume that my code is ok.
I've found some info in Internet about similar problems with other non en cultures. The main workaround based on temporary changing application culture info to en-US:
http://www.apeoholic.se/post/How-to-use-BingMapsDirectionsTask.aspx
http://grenangen.se/node/71
Unfortunately this approach doesn't work with set pl-PL main culture on device. Do you have any suggestions how can I resolve this problem and run Bing maps to show direction to my point?
I can confirm the same behavior with el-GR (Greek) device language. Your code is obviously OK. This is a bug of BingMapsDirectionsTask. Unfortunately it is present even if destination is given in GeoLocation form. Currently there seems to be no way of bypassing this bug.
I'm using Marmalade to develop iOS applications via VisualStudio and a PC. The integration of a social feature like HeyZap needs its initialization by the use of:
loadHeyzap("YOUR_APP_ID_HERE","YOUR_APP_URL_HERE", true);
App_ID is the ID as defined in the itunes app page (I got it).
App_URL "should also similarly be replaced with your URL scheme for the iPhone" [from the HeyZap integration doc].
Well, the HeyZap help desk weren't useful to obtain this string via the use of VisualStudio+PC (in fact, they told me "use XCode+Mac instead...").
Since this is a simple string, I suppose I could obtain it starting from known parameters of my app. I suppose to find inside it something like [app_name]&=other-chars-....
Is there a way to build this string without the use of XCode, just starting from info I already have and putting here and there some special chars?
In other words, is there a standard way to automate the build of this string without the neeed to do it via XCode? I wonder to prepare a function in which I would pass my app parameters and I got the URL Scheme string as a result.
Cheers,
Zapp
The answer by Creator is incorrect. A URL schema is how apps can communicate with each other in iOS.
Here is what Apple has to say
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899
An example would be:
yourgame://
Here's how you would define one in XCode
When you define a URL schema in XCode, you can call that URL from Safari or any app installed on the device and it will switch to your game.
The way you define it in XCode is by going to your project settings, clicking the Info tab at the top, going to the bottom where it says "URL Types", expand that, and click the + button at the bottom. Then define both the identifier and the URL schemes with something reasonably unique like "yourgamename". Done!
http://i.stack.imgur.com/pxEKd.png
URL scheme is most probably the url of your app in App Store. You can obtain it from iTunesConnect. Go to your application and copy the url of View in App Store link. That's the string you wanted ;-)
Let me know if it doesn't work.
Edit:
Well App url worked for me, dunno why its not working for you. If you want to edit the URL scheme, you can do it without using XCode too. You need to include Info.plist file in the mkb settings. You can edit or check the current URL scheme being used by marmalade there. The default plist file is in the s3e folder. Don't know the exact location.
I'm having an issue with the localization in my converters. So, I tried a new project and still have problems.
So, I created a fresh new Silverlight for Windows Phone application (7.0, but 7.1 don't resolve my problem).
I added two resources files: Strings.resx and Strings.fr.resx. This two files have two string property: HelloString and ByeString, all initiated correctly.
Then, I go to the Mainpage.xaml.cs, in the ctor and add the following simple line.
PageTitle.Text = Strings.HelloString;
Whenever I have the emulator or my phone set to English or French, I always got the same strings (Hello).
I tried to rename the file Strings.fr-FR.resx. Still the same issue.
The CurrentUICulture returned from the current thread is correct.
I also tried to force culture on the resource:
Strings.Culture = new System.Globalization.CultureInfo("fr-FR");
Does anyone have an idea?
You don't say that you've set the SupportedCultures for the project. Without this the additional language resource files will never be used.
See http://msdn.microsoft.com/en-us/library/dd941931(v=vs.95).aspx