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

Dupe - ignore

$
0
0

(Sorry for all the duplicates, the forum was reporting 'service unavailable' when posting and I didn't realize that it has posted)


Can't prevent screen rotation

$
0
0

Okay, I feel like an idiot because I've done this before but I've been stuck now for a couple of days.

In my app I do want to allow rotation in many (most) cases. So in my Info.plist file I have 3 of the 4 device orientations selected (which I think is the default when creating a new project). On a couple of screens I want to keep the app in Portrait mode. In a plain vanilla UIViewController class I went ahead and added:

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
{
  return UIInterfaceOrientationMask.Portrait;
}

public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
{
  return UIInterfaceOrientation.Portrait;
}

and for good measure

public override bool ShouldAutorotate()
{
  return false;
}

Yet the damn thing still rotates! What gives? Am I missing something obvious?

JB

This class is not key value coding-compliant for the key

$
0
0

Hi,

I'm a beginner at C# and very new to iOS and Xamarin - but am teaching myself and making some progress towards my first app (a battle calculator for an iOS game). I have two issues which I have been unable to resolve on my own after hours of fiddling and scouring the web.

For my root controller I have a TabBarController which has 2 NavigationControllers and one standard ViewController set as its tabs. The page that is being loaded has several buttons of which I have one wired via an outlet to push a new ViewController onto the NavigationController in the first tab. Loading this up in the simulator has no problems. Deploying to my device throws me this exception:

Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<screenAttacker 0x16593570> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnWall.

I've seen that this could be caused by setting a Main Interface in the info.plist and can confirm that both the iPad and iPhone sections are blank for this field.

Also this can be caused by outlets not being deleted correctly or objects being linked to outlets which no longer exist etc. I deleted all entries in the .h and .m files and removed all outlet connections (in deleted and re-added all buttons also) and created a fresh one.

The second (and I'm assuming unrelated) issue is warnings MT3005 & MT3006 - also only when deploying to device:

Warning MT3005: The dependency 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' of the assembly 'monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' was not found. Please review the project's references. (MT3005)

Warning MT3006: Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details. (MT3006)

Any help with these two issues would be greatly appreciated. Its driving me nuts. Below I've included that AppDelegate, ViewController and .h / .m files associated. Please let me know if you need any more info.

Cheers!

AppDelegate.cs:

`using System; using System.Collections.Generic; using System.Linq; using MonoTouch.Foundation; using MonoTouch.UIKit;

namespace KEBC { [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate {

    public static UIWindow window;
    public static UITabBarController rootTab;
    public static UINavigationController navAttacker;
    public static UINavigationController navDefender;
    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {

        window = new UIWindow (UIScreen.MainScreen.Bounds);

        screenAttacker screenAttacker = new screenAttacker ();
        screenDefender screenDefender = new screenDefender ();
        screenSummary screenSummary = new screenSummary ();
        navAttacker = new UINavigationController (screenAttacker);
        navDefender = new UINavigationController (screenDefender);
        navAttacker.Title = "Attacker";
        navDefender.Title = "Defender";
        screenSummary.Title = "Summary";


        rootTab = new UITabBarController ();
        UIViewController[] tabs = new UIViewController[] {
            navAttacker,
            navDefender,
            screenSummary
        };
        rootTab.ViewControllers = tabs;

        window.RootViewController = rootTab;

        // make the window visible
        window.MakeKeyAndVisible ();

        return true;
    }
}

}`

screenAttacker.cs:

`using System; using System.Drawing; using MonoTouch.Foundation; using MonoTouch.UIKit;

namespace KEBC { public partial class screenAttacker : UIViewController { static bool UserInterfaceIdiomIsPhone { get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; } }

    public screenAttacker ()
        : base (UserInterfaceIdiomIsPhone ? "screenAttacker_iPhone" : "screenAttacker_iPad", null)
    {
    }

    public override void DidReceiveMemoryWarning ()
    {

        base.DidReceiveMemoryWarning ();

    }

    public override void ViewWillAppear(bool animated)
    {
        base.ViewWillAppear (animated);
        this.NavigationController.SetNavigationBarHidden (true, animated);
    }

    public override void ViewWillDisappear(bool animated)
    {
        base.ViewWillAppear (animated);
        this.NavigationController.SetNavigationBarHidden (false, animated);
    }

    public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();
        this.Title = "Attacker";
        btnWall.TouchUpInside += (sender, e) => {
            AppDelegate.navAttacker.PushViewController(new screenWall(), true);
        };

    }

}

}`

screenAttack.h:

`#import <Foundation/Foundation.h>

import <UIKit/UIKit.h>

@interface screenAttacker : UIViewController { }

@property (retain, nonatomic) IBOutlet UIButton *btnWall;

@end`

screenAttacker.m:

`#import "screenAttacker.h"

@implementation screenAttacker

  • (void)dealloc { [_btnWall release]; [super dealloc]; } @end`

Searching a mono nosql db : BrightstarDB, siaqodb, others ?

$
0
0

Hi all, like all apps, my apps need to store local data, as well as support data sync. I've worked all day searching for existing solutions, pro and cons for each.

Requirements:

  • Database manipulation:

    • uses linq syntax
    • may use the "optimized" api of sqlite on android
  • Database generation

    • may support support poco generation by using an edmx model file ("model first" style), using T4 templates
    • index support would be better, small memory footprint, fast startup / execution
  • Offline database / sync with an online db

    • support for offline change tracking
    • support online syncing with optimistic concurrency exceptions
    • Using the opensourced Microsoft Sync Framework would be a "+"

I found:

  • siaqodb + Microsoft Sync Framework
+ all requirements met
+ 3 years, some big customers
- proprietary db format
- not free
  • BrightstarDB
+ requirements met, but it misses a Microsoft Sync Framework offline provider
- young (1 year)
+ free
+ was a commercial product, now open sourced
- the company may not release new versions / fixes
- proprietary db format
  • Tiraggo
- messy
- uses mono sqlite
  • TouchDb
+ requirements met, offline sync not compatible with MsSyncFramework
- compatible only with crouchDb

As the information about sqlite and nosql dbs compatible with mono/android is hard to gather, I suppose I have missed one.

What ORM framework do you use ?

Proper steps to create a new View Controller

$
0
0

I would like to create a new View Controller that I will use in my application. I'm not sure how I should go about creating the controller. When I add a new class (Universal View Controller), I see the proper class and designer class get created but when I go back to the storyboard in xcode I do not see the controller there. I can however create a new view controller manually in storyboard but I'm not sure how I can think link it to the class I created so I can link outlets and actions. Any advice?

Ton of intellisense issues /w VS2013, Latest Stable Release, & Resharper

$
0
0

I've been having a ton of intellisense issues with the latest release. PCL libraries almost entirely get marked as "Missing System.Runtime v4...". Other project types only mark my class types as unknown. Everything compiles though. I believe the problem is between resharper & xamarin somehow as everything returns to normal if I remove one of them. I've tried cleaning out all of the resharper and VS cache folders and that did not help.

Has anyone had similar issues and perhaps a workaround?

Is each listview requires separate adapter?

$
0
0

Hi,

In my project, i would need different listviews like noteslist, contactslist, folderslist, groupslist etc... But is it necessary for each listview whether separate ListViewAdapter is required? or is there any other better way available to implement it?

Currently i have noteslist with corresponding NotesListAdapter.cs for its View. But before creating other adapters, i need to clear this doubt

Thanks...

ActionBar Tabs withh View Pager using Compatibility Library

$
0
0

I'm attempting to recreate the following Android example using Xamarin: http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/

The error that I'm getting is when I try and get the instance of the action bar. The code for my initial Activity is below. The error is on line 27: actionBar = this.ActionBar; The error is: Error CS0030: Cannot convert type 'Android.App.ActionBar' to 'Android.Support.V7.App.ActionBar'

using Android.OS;
using Android.Views;
using System;
using Android.Support.V4.App;
using Android.Support.V4.View;
using Android.Support.V7.App;

namespace MyApplication
{
    public class MainActivity : FragmentActivity
    {
        private ViewPager viewPager;
        private TabsPagerAdapter mAdapter;
        private ActionBar actionBar;    
        // Tab titles
        private String[] tabs = { "Top Rated", "Games", "Movies" };

        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Initilization
            viewPager = FindViewById<ViewPager>(Resource.Id.pager);
            actionBar = this.ActionBar;
            mAdapter = new TabsPagerAdapter(this.SupportFragmentManager);

            viewPager.Adapter = mAdapter;
            actionBar.SetHomeButtonEnabled(false);
            actionBar.NavigationMode = Convert.ToInt32(Android.App.ActionBarNavigationMode.Tabs);       

            // Adding Tabs
            foreach (String tab_name in tabs) {
                ActionBar.Tab tab = actionBar.NewTab ();
                tab.SetText (tab_name);
                tab.SetTabListener (new TabListener<ParentFragment> (this, tab_name));
                actionBar.AddTab (tab);
            }
        }

        public override bool OnCreateOptionsMenu (Android.Views.IMenu menu)
        {
            // Menu items default to never show in the action bar. On most devices this means
            // they will show in the standard options menu panel when the menu button is pressed.
            // On xlarge-screen devices a "More" button will appear in the far right of the
            // Action Bar that will display remaining items in a cascading menu.

            menu.Add (new Java.Lang.String ("Normal item"));

            var actionItem = menu.Add (new Java.Lang.String ("Action Button"));

            // Items that show as actions should favor the "if room" setting, which will
            // prevent too many buttons from crowding the bar. Extra items will show in the
            // overflow area.
            MenuItemCompat.SetShowAsAction (actionItem, MenuItemCompat.ShowAsActionIfRoom);

            // Items that show as actions are strongly encouraged to use an icon.
            // These icons are shown without a text description, and therefore should
            // be sufficiently descriptive on their own.
            actionItem.SetIcon (Android.Resource.Drawable.IcMenuShare);

            return true;
        }

        public override bool OnOptionsItemSelected (Android.Views.IMenuItem item)
        {
            Android.Widget.Toast.MakeText (this, 
                "Selected Item: " + 
                item.TitleFormatted, 
                Android.Widget.ToastLength.Short).Show();

            return true;
        }
    }
}

Any help you can give would be really helpful. Thanks!


noesisGUI

$
0
0

Hi!

Not sure if this is the best place to post, sorry in advance for the inconvenience.

We are the developers of noesisGUI, a multiplatform WPF implementation. We think that our product is ideal to be integrated with Xamarin and we just started to evaluate this port.

What do you think about it? Would be this technology interesting for the community?

http://www.noesisengine.com/

Thanks!

How to create .apk file of xamarin Android application to deploy on server

$
0
0

I am creating .apk file of my application according to the given xamarin document but that apk file is not useful for my server build.

Quick JSON serializer performance test (Json.NET vs ServiceStack)

$
0
0

No pun intended but this is just a quick test between two popular JSON (de)serializers available for Xamarin iOS and Android. I will run iOS comparison later on but from previous experiments Android shows more difference between the two libraries.

Source code is available at GitHub in case you want to extend the tests or run them yourself: https://github.com/sami1971/SimplyMobile

Tests were compiled and ran in Release mode.

[NUnitLite] NUnit automated tests loaded.
[Runner executing:  Run Everything]
[M4A Version:   ???]
[Board:     tuna]
[Bootloader:    PRIMELA03]
[Brand:     samsung]
[CpuAbi:    armeabi-v7a armeabi]
[Device:    maguro]
[Display:   JOP40D.I9250XWMA2]
[Fingerprint:   samsung/yakjuxw/maguro:4.2.1/JOP40D/I9250XWMA2:user/release-keys]
[Hardware:  tuna]
[Host:      DELL123]
[Id:        JOP40D]
[Manufacturer:  samsung]
[Model:     Galaxy Nexus]
[Product:   yakjuxw]
[Radio:     unknown]
[Tags:      release-keys]
[Time:      1359045633000]
[Type:      user]
[User:      dpi.sec]
[VERSION.Codename:  REL]
[VERSION.Incremental:   I9250XWMA2]
[VERSION.Release:   4.2.1]
[VERSION.Sdk:       17]
[VERSION.SdkInt:    17]
[Device Date/Time:  11/6/2013 11:07:32 PM]
TextSerializationTests
JsonNetTests
    [FAIL] TestBase.CanSerializeInterface : Newtonsoft.Json.JsonSerializationException : Could not create an instance of type TextSerializationTests.IAnimal. Type is an interface or abstract class and cannot be instantated. Path 'Pets[0].Name', line 1, position 62.
          at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultConstructor) [0x00000] in <filename unknown>:0 
          at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in <filename unknown>:0 
          at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in <filename unknown>:0 
          at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList (IWrappedCollection wrappedList, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id) [0x00000] in <filename unknown>:0 
SimplyMobile.Text.JsonNet.JsonSerializer took 1583ms deserializing 10000 iterations.
    Passed TestBase.DeserializationSpeed
SimplyMobile.Text.JsonNet.JsonSerializer took 425ms serializing 10000 iterations.
    Passed TestBase.SerializationSpeed
JsonNetTests : 2583.71 ms
ServiceStackTests
    Passed TestBase.CanSerializeInterface
SimplyMobile.Text.ServiceStack.JsonSerializer took 364ms deserializing 10000 iterations.
    Passed TestBase.DeserializationSpeed
SimplyMobile.Text.ServiceStack.JsonSerializer took 187ms serializing 10000 iterations.
    Passed TestBase.SerializationSpeed
ServiceStackTests : 1332.855 ms
TextSerializationTests : 3936.737 ms
Tests run: 6, Passed: 5, Failed: 1, Skipped: 0, Inconclusive: 0

Unable to deploy non-trivial app (UploadChanges timeout)

$
0
0

I've been working on porting a multi-platform (Win/WinPhone) app to Android and iOS using Visual Studio 2013 and Xamarin. I have been able to build and deploy my app using the Xamarin.iOS build host on my Mac for the past week or so. All of the sudden I can no longer deploy the app (to a device or the simulator). I can still build/deploy the HelloWorld iOS app just fine.

I've only added half a dozen classes, with maybe a few hundred lines of code total, since it was working. I also added the ModernHttpClient component from the Xamarin component store (which includes AFNetworking, which isn't exactly small). I've tried pulling ModernHttpClient/AFNetworking, but that had no effect.

When building my app on the Visual Studio client I see:

1>Done building target "_PrepareApplicationBundle" in project "MaaasClientIOS.csproj". 1>Target "_BuildNativeApplication" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets" from project "C:\Users\Bob\dev\Maaas\MaaasClient\MaaasClientIOS\MaaasClientIOS.csproj" (target "_RemoteBuild" depends on it): 1>Server command 'UploadChanges': failed to upload changes to the server 1>Command execution task ended with exception 1>Exception System.Net.WebException: The request was aborted: The operation has timed out. 1>Exception details can be found in the log file 1> 1> 1>Remote build step failed. 1>Done building target "_BuildNativeApplication" in project "MaaasClientIOS.csproj" -- FAILED. 1>Done building project "MaaasClientIOS.csproj" -- FAILED. 1>Build FAILED.

And when checking the mtbserver.log file on my Mac I see a bunch of correct looking steps and then:

[28-Dec-2013 01:26:54] Handling with command: [UploadChanges: CommmandUrl=UploadChanges] (12) [28-Dec-2013 01:26:54] Attempting to acquire command execution lock, timeout set to 00:10:00

And then nothing after that.

I'm not sure what that lock is waiting for, but even with two relatively decent machines (the Windows machine is a Surface Pro and the Mac is a 2.5Ghz i7 8Gb MacBook Pro) the builds are not exactly smoking (the full deployment of my app when it was working was easily a minute plus). These machines are sitting next to each other and are connected via a very reliable and high speed wifi connection (they're connected to the same AP).

Before I started trying to prune my app back a file at a time to see if I could get it to work, I thought it would be good to see if someone who knew what it was timing out on could take a look at this. I'd heard horror stories about Xamarin kind of falling apart once apps got to a real-world size, but was pretty skeptical of that until now.

I am up to date on the "stable" channel on Windows and running Xamarin.iOS 7.0.6.166 on the build server.

At this point I'm stuck.

Actionbar tabs at bottom of the screen

$
0
0

I am using ActionBar tabs in my xamarin android application. Now my application looks as the following (Please see the attachment).

I need to place the tabs at the bottom of the screen. How is it possible?

I know it is against design recommendations of android. But it would be really appreciable if someone could help me with this.

Thanks.

Nullreference exception while running project in Genymotion, but not in Android Sdk Emulator

$
0
0

Hi,

I was running my project in Android Sdk emulator, but just for more convenience, for the past two days i am running the project in Genymotion. My project loaded successfully in Genymotion, but in the below line its throwing null reference exception

JsonSerializerSettings microsoftDateFormatSettings = new JsonSerializerSettings
            {
                DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
            };

            data = JsonConvert.SerializeObject (new { moduleLastSyncTime = Datetime.MinValue, module = "syncModule", clientItems = syncItems}, microsoftDateFormatSettings);

Below exception

Instance    {System.NullReferenceException: Object reference not set to an instance of an object
  at Newtonsoft.Json.Utilities.DateTimeUtils.GetUtcOffset (DateTime d) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Utilities.DateTimeUtils.WriteDateTimeString (System.Char[] chars, Int32 start, DateTime value, Nullable`1 offset, DateTimeKind kind, DateFormatHandling format) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonTextWriter.WriteValue (DateTime value) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.JsonWriter.WriteValue (Newtonsoft.Json.JsonWriter writer, PrimitiveTypeCode typeCode, System.Object value) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializePrimitive (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonPrimitiveContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <filename unknown>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <filename unknown>:0 }    System.NullReferenceException

The same code working in Android Sdk emulator, but why its not working in Genymotion? I don't have any idea, nothing is null, please someone help me

Thanks...

Need Multiselect Spinner

$
0
0

Hi,

I want Multiselect Spinner. Searched in Google, solution available in Java, but i don't have any idea on how to implement it in Xamarin. Found this link, but its for Java.

Plz someone help me...


Amazon GameCircle for iOS - Monotouch Binding/Linking

$
0
0

Hi guys, I've a problem on binding GameCircle library by Amazon. They offer the Unity plugin for they library, I want to use classes they made for Unity on Monotouch. I've extracted unity plugin and now I want to use it on Monotouch. I've created a project and hosted it on GitHub (https://github.com/mapo80/GameCircle.Monotouch).

There are two libraries: - AmazonInsightsSDK.a - GameCircle.a

I'm using this linkWith parameters: [assembly: LinkWith ("AmazonInsightsSDK.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, ForceLoad = true, IsCxx = true, LinkerFlags="-lsqlite3.0 -lstdc++", Frameworks = "AdSupport GameKit MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory Foundation")]

[assembly: LinkWith ("GameCircle.a", LinkTarget.Simulator | LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, IsCxx = true, LinkerFlags="-lsqlite3.0 -lstdc++", Frameworks = "AdSupport GameKit MessageUI CoreTelephony SystemConfiguration Security ExternalAccessory Foundation")]

When I reference dll on my iOS projects I obtain these errors:

Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache" --nomanifest --nosign -sim "/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app" -r "/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleBinding/bin/Debug/Monotouch.AmazonGameCircleBinding.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -debug -nolink -sdk "7.0" -targetver "7.0" --abi=i386 "/Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.exe" Xamarin.iOS 7.0.6 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk Process exited with code 1, command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -lsqlite3.0 -lstdc++ -Wl,-pie -gdwarf-2 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2 -mios-simulator-version-min=7.0 /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/main.i386.o -force_load /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/AmazonInsightsSDK.a -force_load /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a -o /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/bin/iPhoneSimulator/Debug/MonotouchAmazonGameCircleTestApp.app/MonotouchAmazonGameCircleTestApp -framework CFNetwork -framework AVFoundation -framework Accelerate -framework AddressBook -framework AudioToolbox -framework QuartzCore -framework CoreBluetooth -framework CoreData -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreText -framework Foundation -framework GameKit -framework ImageIO -framework MobileCoreServices -framework Security -framework SystemConfiguration -framework CoreMedia -framework CoreMIDI -framework CoreVideo -framework StoreKit -framework AssetsLibrary -framework Accounts -framework CoreTelephony -framework EventKit -framework EventKitUI -framework CoreMotion -framework GLKit -framework iAd -framework MapKit -framework MediaPlayer -framework MessageUI -framework NewsstandKit -framework OpenGLES -framework Social -framework Twitter -framework UIKit -framework PassKit -framework SpriteKit -framework JavaScriptCore -framework MultipeerConnectivity -framework AddressBookUI -framework SafariServices -framework ExternalAccessory -framework AdSupport -framework QuickLook -lz -liconv -u _mono_pmip -u _xamarin_init_nsthread -u _xamarin_get_block_descriptor -u _monotouch_get_locale_country_code -u _monotouch_log -u _monotouch_start_wwan -u _monotouch_timezone_get_data -u _monotouch_timezone_get_names -u _monotouch_IntPtr_objc_msgSend_IntPtr -u _monotouch_IntPtr_objc_msgSendSuper_IntPtr -u _monotouch_release_managed_ref -u _monotouch_create_managed_ref -u _CloseZStream -u _CreateZStream -u _Flush -u _ReadZStream -u _WriteZStream /Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmonoboehm-2.0.a /Developer/MonoTouch/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmonotouch-debug.a duplicate symbol _MD5 in: /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a(AGHelper.o) /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a(md5_one.o) ld: 1 duplicate symbol for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

error MT5212: Native linking failed, duplicate symbol: '_MD5'. error MT5213: Duplicate symbol in: /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a(AGHelper.o) (Location related to previous error) error MT5213: Duplicate symbol in: /Users/matteo/Desktop/Monotouch.AmazonGameCircleBinding/Monotouch.AmazonGameCircleTestApp/obj/iPhoneSimulator/Debug/mtouch-cache/GameCircle.a(md5_one.o) (Location related to previous error) error MT5309: Native linking error: 1 duplicate symbol for architecture i386 error MT5202: Native linking failed. Please review the build log.

Any help? What to do?

Thanks

Simplest Parcelable way to pass Complex and List datas.

$
0
0

Hi everyone!

I am exercising my android knowledge. I met the Parcelable before but now i have more questions. As we know with Parcelable can we pass datas between activities. Right now the SharedPreferences and other data storing procedures don't count. The serializable does. That is the other way to pass data between activites? Which is the better (Parcelable vs. Serializable)?

Generally we handle the datas as extras. We put the data in the intent with

Intent subActivity = new Intent(this, typeof(SubActivity));
subActivity.PutExtra("dogName", "Fluffy");

and the other side we get the data with

string name = Intent.GetStringExtra("dogName");

The dogName is the identifier to get the correct data if we specified more.

But this working so simple only with atomic types(string, int, float, short, etc.). When we want to pass complex data, a Dog object with name, age, etc. then we need a class.

A data container class creation is very simple. We create the fields, the properties to get or set them, and for example a constructor to set them at the beginning. But to pass them is not so easy.

1) First step is to implement the IParcelable interface. Ok this is not so difficult because we do this before more time for example by IOnClickListener. The compiler warn us to implement the missing methods.

Let me ask a question: Is it possible to autogenerate these methods? When i must implement them i need to search on the internet how those methods looks like(parameters, return type, public/private/protected, the name is available in the error message).

2) Ok, i implemented the missing methods( DescribeContents, WriteToParcel). But this is not enough. As i saw i need to specify a static InitializeCreator method:

[ExportField ("CREATOR")]
public static DogsCreator InititalizeCreator()
{
    return new DogsCreator ();
}

For this ParcelableCreator, named "DogsCreator" i need an another class. Implementing an interface (IParelableCreator) again.

Ok it is not so difficult because the compiler warned me about this two methods and these are understandable. But i think this is so complex.

3) I like to use it as with the atomic types:

Dog dog = new Dog("Fluffy", 12);
Intent subActivity = new Intent(this, typeof(SubActivity));
subActivity.PutExtra("fluffyDog", dog);
StartActivity(subActivity);


In SubActivity.cs

Dog dog = Intent.GetParcelableExtra("dog") as Dog;


This method is understandable too. The "Dog" is not a string, int or float, it is an object. The GetObjectExtra would be better name but ok the GetParcelableExtra is good too. It is easly notable.

I could reach that to pass object between activites but what about to pass object list? I cannot do that:

List<Dog> dogies = new List<Dog>();
Intent subActivity = new Intent(this,typeof(SubActivity));
subActivity.PutParcelableArrayListExtra("puppies", dogies);
StartActivity(subActivity);

In the SubActivity.cs

List<Dog> puppies = Intent.GetParcelableArrayListExtra("puppies");

This one is not working. Can someone show me a working example for this in Xamarin?
Is this a simplier method to pass datas (atomic types, objects, list of objects) between activities as i presented above?

Huge thanks in advance.

Why is my Google Map not displaying?

$
0
0

Using the "SimpleMapsDemo", when trying the "Map with Markers Demo", the map is not showing. If I press the "Zoom In", "Zoom Out", "Animate to Location", no map is displayed.

Why is this map not showing?

Emulator API level for Google Maps

$
0
0

I am using the Google Maps SimpleMapDemo sample and the app is not deploying to the emulator properly. What are the details I should use for an emulator?

I am currently using GoogleAPI level 19... should I be using something else, and what other emulator settings should I use?

Does OpenTK-1.0 GraphicsMode support MSAA?

$
0
0

Hi All-

I am trying to get Multi-Sample Anti-Aliasing switched on in both a MonoTouch and a MonoDroid app using OpenTK-1.0. OpenTK.Platform.iPhoneOS and OpenTK.Platform.Android both show GraphicsMode classes, but I can't seem to switch on MSAA. For example, on Android, I've tried:

GraphicsMode = new AndroidGraphicsMode (16, 16, 0, 4, 2, false);

To no avail. It always switches back to "low mode" or a default setting.

Does anyone have examples of how to switch on MSAA with OpenTK-1.0 using ES 2.0? I'd rather not manually create the MSAA buffers myself as OpenTK should handle this.

Thanks in advance.

Viewing all 204402 articles
Browse latest View live


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