Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Android PCL support missing

$
0
0

I want to port my existing Android project from VS2012 to Xamarin Studio on my Mac, but I'm a little confused as to the PCL support.

When I create a PCL in Xamarin Studio there is no checkbox for neither Android or iOS support. How can that be? I want to use profile 158 by the way.

I'm using the latest stable version of Xamarin Studio which is 4.2.2.


Displaying ads in a Xamarin Android project?

$
0
0

What is the easiest way to display ads in a Xamarin Android project?

I found this 'Google AdMob' component: http://components.xamarin.com/view/googleadmob But it's listed as iOS only.

I also found this AdMob SDK Binding Sample: http://docs.xamarin.com/samples/AdMob/ [https://github.com/xamarin/monodroid-samples/tree/master/AdMob

](https://github.com/xamarin/monodroid-samples/tree/master/AdMob)Bug the instructions are a bit unclear and I'm unable to compile and run the example. (what is "this directory" or "here" in "either create a symbolic link to {android-sdk}/extras/google/admob_ads_sdk in this directory, or simply copy the directory here.)

I'd prefer to use AdMob as I've already created an account and my ad units, but I'm open to any platform that works on a Xamarin Android project.

How to change the highlight color in a list click?

Why can't Fiddler detect traffic from Xamarin apps?

Does any body know how I can reduce user code size ?

$
0
0

I am trying to develop my ever first todo app via xamarin tutorials; but cannot release it due to user code size. How can i reduce the user code size ?

PS: I attached the cs files

Scrolling + MouseEvent Not Working

$
0
0

The idea is the following: I want to generate a amount of views based on data As you can see in the code, in addition to generate the event mouseExited and mouseEntered. But this crashes.

     //Init controller
     public override void AwakeFromNib()

 {  

            base.AwakeFromNib();
    this.scrollview.HasHorizontalScroller = true;
    this.scrollview.HasVerticalScroller = true;
    this.scrollview.ScrollsDynamically = false;
    panel = new NSView(new RectangleF(0,0
        ,this.scrollview.Frame.Width
        ,this.scrollview.Frame.Height*3));
    float indexer = 5;
    foreach (var name in Data)
    {
        var customData = new CustomData(new RectangleF(5,indexer,this.scrollview.Frame.Width - 5,70))
        {
            Text = name.Key
        };
        indexer += 90;
        customData.MouseEnter += MouseEnterEvent;
        customData.MouseExited += MouseExitedEvent;
        panel.AddSubview(customData);
    }
    this.scrollview.DocumentView = panel;
}
    //Finish Controller


public class CustomData : NSView
{

    public override void DrawRect(RectangleF dirtyRect)
    {
        base.DrawRect(dirtyRect);
        var context = NSGraphicsContext.CurrentContext.GraphicsPort;
        var rectangle = new RectangleF (0,0, this.Frame.Width, this.Frame.Height);
        NSColor.Blue.Set ();
        context.FillRect (rectangle);
                    //Text is a string
        s = new NSString (Text);
                    //attributes is stringAttributes
        s.DrawString (new PointF(20,this.Frame.Height/3), attributes);

    }
    public override void UpdateTrackingAreas()
    {
        if (tracking != null)
        {
            this.RemoveTrackingArea(tracking);
            tracking.Release();
        }
        tracking = new NSTrackingArea(this.Frame,NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveAlways ,this, null);
        this.AddTrackingArea(tracking);
    }

    public override void MouseEnter(NSEvent theEvent)
    {
        Console.WriteLine("MouseEnteredTest");
    }

    public override void MouseExited(NSEvent theEvent)
    {
        Console.WriteLine("MouseExitedTest");
    }
}

Any suggestions will be highly appreciated. Thanks!

Is there a 2 GB file size limit?

$
0
0

Hello, when I write a file to disk I receive the following error when the file arrives to 2 GB:

System.IO.IOException: Win32 IO returned 25

Also doing a myFilestream.Seek(position, SeekOrigin.Begin) with a position larger than 2 GB raises the same exception. So it seems that Xamarin.Android can not work with files larger than 2 GB.

Is this correct? any workaround?

GetCell Button Event problem

$
0
0

Hey All,

I'm very new to Xamarin, and though there are some threads that seem to deal with similar issues, I am having a heck of a time getting a VERY simple custom button added to my UITableViewCell without its TouchUpInside event causing the horrible crash that everyone has run into. I would great appreciate any advice as to what exactly I'm doing wrong here. Thanks in advance!

        // Customize the appearance of table view cells.
        public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
        {
            var cell = (UITableViewCell)tableView.DequeueReusableCell (CellIdentifier, indexPath);

            cell.TextLabel.Text = objects [indexPath.Row].ToString ();

            var button = new UIButton (UIButtonType.System);
            button.TouchUpInside += (sender, e) => 
            {

// var buttonCell = ((UIButton)sender).Superview as UITableViewCell; string s = "string"; // var cellIndex = tableView.IndexPathForCell(buttonCell); // var objectInstance = objects[cellIndex.Item]; };

            button.SetTitle ("Submit", UIControlState.Normal);
            button.Frame = new System.Drawing.RectangleF (150.0f, 5.0f, 150.0f, 30.0f);

            cell.AddSubview (button);

            return cell;
        }

Can Xamarin provide a strong name signed version of the Xamarin.Mobile component?

$
0
0

We are trying to build a signed version of our app for release. Currently, all of our third-party DLLs are signed or can be re-built from source and signed... except for Xamarin.Mobile. Specifically, we are using the Xamarin.Media.MediaPicker from this component and without a signed DLL, we get the following error when building:

CSC : error CS1577: Assembly generation failed -- Referenced assembly 'Xamarin.Mobile' does not have a strong name

Is it possible to provide a signed version of the Xamarin.Mobile component?

appflyer or flurry ?

$
0
0

Hi, what stat service would you use between appflyer and flurry ?

Advantages / differences / features / stability ?

thks !

Facebook Login

$
0
0

Hi all

Want to try find out what the majority of the community are using for Facebook login functionality?

I have tried Xamarin.Social but it uses the old webview login dialog which is not allowed by facebook anymore: https://developers.facebook.com/docs/facebook-login/checklist/#usenative

The FacebookSDK component has the same issue, and the sample app doesn't really work. Just keeps reporting that I am not logged in when I actually am.

Is the FacebookSDK component an actual binding of the Android Facebook SDK?

Any help appreciated Adrian

PCL with Web Services, getting error: Are you missing `System.Web' assembly reference?

$
0
0

I am getting this error Are you missing `System.Web' assembly reference? I added the Schools web service as a test and assumed it would have brought in the libs I needed but I guess not.
Now I need to add System.Web I assume but when I go to Edit References > All on the new PCL project its not there, in fact nothing is there :(

Using Google Analytics

$
0
0

Hey I'm trying to use Google Analytics, and I saw John Miller wrote an interface for using it. I downloaded his project from GitHub (https://github.com/therealjohn/GoogleAnalytics), compiled it and added the dll file to my project's references. It does recognise the GAI, GAILogger and the rest of the classes, but it does not recognise their instances and variables. For some reason, the code lines he gave as examples cause a compilation error with the message of "unexpected symbol '=' in class, struct or interface member declaration". Did anyone use it and can explain what I did wrong? Thanks

MonoTouch.UIKit.UIViewController could not be resolved to Obj-C

$
0
0

Hi,

Any ideas on how to fix this? I'm getting it on every view controller.

Error updating Xcode project. Could not generate class 'ftrack2ios.DeviceLocation' as its base type 'MonoTouch.UIKit.UIViewController' could not be resolved to Objective-C.

Hint: Try adding [Register ("UIViewController")] to the class definition for MonoTouch.UIKit.UIViewController.

I don't really want to be recreating every view controller - this project has tonnes of them!

Paul

NUnit Async Testing Not Working


Async methods (and event handlers) missing from web service proxy

$
0
0

I am following the web services guide (http://docs.xamarin.com/guides/cross-platform/application_fundamentals/web_services/). Everything works fine, except the ASYNC methods are missing from the proxy!

  1. I have added a .wsdl file to my project, and added a Web Reference using that file as the web service definition.
  2. Xamarin studio has created a web service proxy. For every Get____ method in my web service, the proxy contains a BeginGet____ and an EndGet____ method. BUT it did NOT generate a Get_______Async method, nor did it generate a Get_______Complete event.

I am using the free version of Xamarin Studio. Can anyone tell me why the Async functionality was not generated?

Upload Image from Gallery, real file path

$
0
0

Hello Xamarin community!

I'm trying to upload an image to a website using webclient but i'm havin a problem getting the real path of an image from the image gallery. I use the code from this sample: http://docs.xamarin.com/recipes/android/data/files/selecting_a_gallery_image/ to choose the picture from the gallery. then i use string path = data.DataString; to set the path. Unfortunately for some reason this path appears not to be the "real" path.

Any help would be really appreciated Kind regards xsx

google speech to text

$
0
0

hello. please help, how do I use text-to-speech api I need in my application give a speech and textbox gets the text with speech

[Xamarin Blog] Android Support Library v7: Hello ActionBarCompat

$
0
0

Just posted: Android Support Library v7: Hello ActionBarCompat on the Xamarin Blog.

Read the full article to learn how to use the ActionBarCompat to provide Action Bar backwards compatibility support in you Xamarin.Android app all the back to Android 2.1 with the Android Support Library v7 AppCompat Component.

Use this thread to discuss or ask question.

Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform

$
0
0

As per http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-xamarin-ios/ I have implemented some stock standard code in my Xamarin iOS project for using Azure Mobile Services for push notifications:

public static MobileServiceClient MobileService = new MobileServiceClient(
        "https://[appurl].azure-mobile.net/",
        "[appkey]");

However when the the app starts up (the above property is on AppDelegate) it fails with:

System.TypeInitializationException: An exception was thrown by the type initializer for JG.AppDelegate ---> System.Exception: Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00094] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:326 at System.Activator.CreateInstance (System.Type type) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:222 at Microsoft.WindowsAzure.MobileServices.Platform.get_Instance () [0x00054] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\Platform\Platform.cs:64 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.GetApplicationInstallationId () [0x00004] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:582 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey, System.Net.Http.HttpMessageHandler[] handlers) [0x00028] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:195 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:149 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.String applicationUrl, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:134 at JG.AppDelegate..cctor () [0x00000] in /Users/markgibaud/Projects/JG.Mobile/JG/AppDelegate.cs:23 --- End of inner exception stack trace --- at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pp-UIApplication.cs:38 at JG.Application.Main (System.String[] args) [0x00008] in /Users/markgibaud/Projects/JG.Mobile/JG/Main.cs:12

I have removed and re-added the Windows Azure Mobile component, with no luck.

What should I try next?

Using: -Latest stable Xamarin.iOS -Xamarin Studio

Viewing all 204402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>