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

Error in debug window on startup

$
0
0

After all of these continual reboots on the Xamarin.iOS SDK update, I noticed this error on startup in Visual Studio 2013. Not sure if anything is related or not, but I wanted to post it. It looks like an error in the startup of the X.i toolbar in VS.

Mono.IOS.VisualStudio.MonoTouchPackage Warning: 0 : Initializing Mono.IOS.VisualStudio.MonoTouchPackage Mono.VisualStudio.Extension.TastyPackage Error: 0 : Failed to show control 'Standard' in toolbar 'Build.SolutionPlatforms' System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) at EnvDTE.Command.get_IsAvailable() at Mono.VisualStudio.Extension.TastyPackage.DoToggleToolbarControlVisibility(String aToolBarName, String aControlName, String aControlDisplayName, String aAfterControlName, String aAfterControlDisplayName, Boolean visible) at Mono.VisualStudio.Extension.TastyPackage.ToggleToolbarControlVisibility(String aToolBarName, String aControlName, String aControlDisplayName, String aAfterControlName, String aAfterControlDisplayName, Boolean visible)

[2013-12-04 14:57:59.7] INFO:Found Xcode, version 5.0.2 (3335.32). [2013-12-04 14:57:59.9] INFO:Found Xamarin.iOS, version 7.0.4.209. Mono.Android.VisualStudio.MonoAndroidPackage Warning: 0 : Build server returned an Warning. Mono.IOS.VisualStudio.MonoTouchPackage Warning: 0 : Build server returned an Warning. Mono.Android.VisualStudio.MonoAndroidPackage Warning: 0 : Negotiating server information for pairing process. Mono.IOS.VisualStudio.MonoTouchPackage Warning: 0 : Negotiating server information for pairing process.


How to Manage the UITextView in UITableView Cell?

$
0
0

I am struggling to solve this.

I have UItextview in UITableviewCell. For Example, My table contain 10 records and In my frame 4 records can view. When I scroll my table another records are display by cell reuse. My problem here, when I type the text in first cell's textview , It will display in fifth cell textview too when I scroll. Like the same If I type in second cell,It will display in 6th cell textview too. I think problem in cell reuse.

**_ CommentCustomCell cell = tableView.DequeueReusableCell(cellIdentifier) as CommentCustomCell;

        if (cell == null) 
            cell = new CommentCustomCell (cellIdentifier);



            cell.UpdateCell (indexedTableItems [keys [indexPath.Section]] [indexPath.Row].userName, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].body, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].creationdate, null, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].likes.ToString (), indexedTableItems [keys [indexPath.Section]] [indexPath.Row].disLikes.ToString (), tableView, indexPath);

            //To assign the selected Row Color
            UIView BGViewColor = new UIView ();
            BGViewColor.BackgroundColor = UIColor.Orange; //or whatever color you want.
            BGViewColor.Layer.MasksToBounds = true;
            cell.SelectedBackgroundView = BGViewColor;

_** return cell;

This is my code. Please help me to solve this. Thanks in advance.

Why does Tasky have separate .csproj files for the core projects?

$
0
0

I am trying to understand Tasky. I see there are separate .csproj files -- Tasky.Core.iOS and Tasky.Core.Android. Furthermore, they contain separate copies of the same code.

What is the purpose of this? I thought the whole point of cross-platform was to use the same core for both projects.

Toolbar buttons not clickable when orientation changes

$
0
0

I am having a rather strange issue in iOS 7.

I have a view controller with a toolbar that has several UI bar buttons on the right. If I initially open the app in portrait mode, all the buttons respond to their click events. However, when I rotate the device and switch to landscape, some of the buttons stop responding to clicks. On the other hand, if I were to open up the app in landscape mode, buttons work, and when I switch back to portrait, buttons still work.

Is this a known issue? I'll be checking out the forums as well for any similar posts.

Does Xamarin iOS support Core.Data?

$
0
0

Does Xamarin.iOS support Core.Data? If yes, does anyone have information on how to use it and examples?

I can't seem to find any information about it. Most information I find is mostly just pointing to using SQLite, which seems to be only half the battle. I am interested in the ability to perform fetches, etc.

Thanks!

Phone, Tablet or Phablet

$
0
0

What is the best way to detect if my Xamarin.Android application is running on a phone, tablet or phablet device?

Esc key trouble?

$
0
0

Hi,

In version 4.2.2.2 (beta) of Xamarin Studio the 'esc' key are working for you? I'm not sure if it's a bug, or configuration, but when I call the intelisense (ctrl+espace) it shows fine, then I press 'esc' and nothing happens. It's a normal behavior?

Thanks

How to respond to Google Map custom marker popup box press to activate an new activity

$
0
0

I have a Google mapping application that displays one or more markers on the map. I have successfully implemented a custom marker popup that displays details of the location the marker is pointing to. Now I need the application to, when the user presses the details box displayed when the marker is pressed, to launch a new activity that will open the web browser and display details of the location.

I have search the web to find a C# example of using the GoogleMap.OnInfoWindowClickListener which I believe is what I need to implement without any success.

I have spent all day on this and it feels that it should be simple, so I just missing something very obvious.

namespace BedfordBC { using Android.App; using Android.Gms.Maps; using Android.Gms.Maps.Model; using Android.OS; using Android.Widget; using System; using Android.Text; using Android.Text.Style; using Android.Views;

using System.Collections.Generic;

[Activity(Label = "@string/activity_label_mapwithmarkers")]
public class DisplayMap : Activity
{
    private GoogleMap _map;
    private MapFragment _mapFragment;

    //BBC Map stuff
    private List<MapItem> siteDetails = null;  //new List<MapItem>();

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

        //Get site details sent from calling screen either single site or 
        // multiple sites if Map button pressed in header of listview

        string siteCount = Intent.GetStringExtra("SiteCount");

        if (siteCount == null) {
            siteDetails = LeisureListAdapter.SelMap;  //Single button in list pressed
        } else
            siteDetails = LeisureServices.SelMap;   //Map button at the top of the list selected

        SetContentView(Resource.Layout.MapLayout);

        InitMapFragment();

        //SetupZoomInButton();
        //SetupZoomOutButton();
    }

    protected override void OnResume()
    {
        base.OnResume();
        SetupMapIfNeeded();
    }

    private void InitMapFragment()
    {
        _mapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment;
        if (_mapFragment == null)
        {
            GoogleMapOptions mapOptions = new GoogleMapOptions()
                .InvokeMapType(GoogleMap.MapTypeNormal)
                .InvokeZoomControlsEnabled(false)
                .InvokeCompassEnabled(true);

            FragmentTransaction fragTx = FragmentManager.BeginTransaction();
            _mapFragment = MapFragment.NewInstance(mapOptions);
            fragTx.Add(Resource.Id.map, _mapFragment, "map");
            fragTx.Commit();
        }
    }

    private void SetupMapIfNeeded()
    {
        if (_map == null)
        {
            _map = _mapFragment.Map;
            if (_map != null)
            {
                //If Header Map button pressed there will be more than one site to add a marker for

                foreach (var  item in siteDetails) {
                    MarkerOptions markerOpt1 = new MarkerOptions();
                    markerOpt1.SetPosition(new LatLng(item.Latitude, item.Longitude));
                    markerOpt1.SetTitle(item.Name);
                    //string snippet = "Address 1 " + System.Environment.NewLine + "Address 2 " + System.Environment.NewLine + "Address 3";
                    SpannableString titleText = new SpannableString(item.Address);
                    //titleText.
                    markerOpt1.SetSnippet (titleText.ToString());
                    _map.AddMarker(markerOpt1);

                }
                // Custom Marker 
                _map.SetInfoWindowAdapter(new CustomMarkerPopupAdapter(LayoutInflater));

                // We create an instance of CameraUpdate, and move the map to it.
                CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(new LatLng(siteDetails[0].Latitude, siteDetails[0].Longitude), 15);
                _map.MoveCamera(cameraUpdate);

            }
        }
    }

}

public class CustomMarkerPopupAdapter : Java.Lang.Object, GoogleMap.IInfoWindowAdapter
{
    private LayoutInflater _layoutInflater = null;

    public CustomMarkerPopupAdapter(LayoutInflater inflater)
    {
        _layoutInflater = inflater;
    }

    public View GetInfoWindow(Marker marker)
    {
        return null;
    }

    public View GetInfoContents(Marker marker)
    {
        var customPopup = _layoutInflater.Inflate(Resource.Layout.CustomMarkerPopup, null);

        var titleTextView = customPopup.FindViewById<TextView>(Resource.Id.custom_marker_popup_title);
        if (titleTextView != null)
        {
            titleTextView.Text = marker.Title;
        }

        var snippetTextView = customPopup.FindViewById<TextView>(Resource.Id.custom_marker_popup_snippet);
        if (snippetTextView != null)
        {
            snippetTextView.Text = marker.Snippet;
        }

        return customPopup;
    }
}

}


objectAnimator

$
0
0

how to do the same animation using objectAnimator as

  <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" >
    <alpha android:interpolator="@android:anim/accelerate_interpolator"
            android:fromAlpha="0.0" 
            android:toAlpha="1.0"
            android:duration="500"/>
     <translate xmlns:android="http://schemas.android.com/apk/res/android"
        android:fromXDelta="100%p"
        android:toXDelta="0"
        android:duration="500"/>
    </set>
and this one
    <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" >
      <alpha android:interpolator="@android:anim/accelerate_interpolator"
        android:fromAlpha="1.0" 
        android:toAlpha="0.0"
        android:duration="500"/>
      <translate xmlns:android="http://schemas.android.com/apk/res/android"
        android:fromXDelta="0"
        android:toXDelta="-100%p"
         android:duration="500"/>
    </set>

UIWebView Help

$
0
0

Hello,

I'm using Xamarin with XCode Storyboards to build my app. Within my app I have a ViewController with a custom class. I have added a WebView to the storyboard and control dragged the web view to the .h file and created an outlet for that WebView. There is some code generated in the designer.cs file for the Outlet but I'm unsure where to go from here. The code generated for the outlook looks like this: MonoTouch.UIKit.UIWebView WebView { get; set; }. I would like to be able to access this WebView from the regular cs file so that I can add controls to the web view. How do I got about initializing the WebView in the regular cs file? I have seen how you create a WebView programmatically but I wasn't sure how to get the WebView to fit between my other elements. I was hoping that adding it to the storyboard would be easier but so far that doesn't appear to be the case. Any pointers or tutorials that you can point me to would be most helpful.

I'm having difficulty Serializing and Deserializing an XML. Getting path is denied problems.

$
0
0

I'm not completely sure how to solve this issue as I'm new to xamarin things are a bit more straight forward when dealing with Native code and apps etc. Anyways I have this piece of code I"m using.

SharpSerializer serializer = new SharpSerializer(); serializer.Serialize(myProfile, "test.xml");

        var mySecondprofile = serializer.Deserialize("test.xml");

I set everything above so the object isn't empty. But ever single time I run it I get access to path denied when doing the serialization. I"m using SharSerializer that I found. Obviously I'm not accessing the file system correctly I went into the android manifest and clicked on all the permissions I could find to see if that was the issue but no dice. So... How do I do access the file system then?

Visual Studio 2010 Xamarin activation error

$
0
0

Hi, I get the attached error when activating my Xamarin account in VS2010 Prof. Xamarin.Android version: 4.10.01073 Xamarin.iOS version: 1.3.250 Thanks in advance for your help

How to? Crash due to memory error ?

$
0
0

Hi all, I am developping with xamarin since a few weeks, being happy with it.

My "test application" is working quite well now, except that after using it a few minutes it is crashing ...! Unfortunatly it is not stopping in the develoment environement while debugging (Visual Studio or Xamarin) on the line where something is wrong, it is just closing/stopping ...!

The application is working with listview and images. I resizes the images to fit their destination (full HD images are converted to about 500*200 images). The problem seems to have something to do with the images as the problem occurs when decoding a jpeg file (after having viewed hundreds of them).

To prevent memory issues I am using a list view adapter that recycles views as much as possible, my application is regularly cleaning the Garbage Collector and displaying the used memory (that is quite stable) ...!

I don't know anymore where/how to search :( Any advice is welcomed on how to proceed to find the issue or if Xamarin tools that might help exist ?

Thanks,

jcr

Using Tasks

$
0
0

Hi, My code looks like this:

class MyScreen { ... Task VeryLongTask; public override void ViewDidLoad { VeryLongTask=new Task(LongTask); VeryLongTask.Start(); ... } private void MyButton_TouchUpInside(...) { if(VeryLongTask.Status==TaskStatus.Running) {// set the button's text to tell user task is still running this.MyButton.SetTitle("Still running"); } // block here and wait for the task to finish VeryLongTask.Wait(); // task finished, now change button's text, though it will not be seen by the user this.MyButton.SetTitle("Ready"); // Show another screen } public void LongTask(){...} }

Basically, I first run a long task and then wait on it in the button's event handler. The problem is that when I click the button, according to the code the button's text should change, but it does not. I would have thought it should change since the task runs in the background and the UI should be responsive. I am running this on the iOS simulator. Have not tested yet with a real iPhone

What am I doing wrong?

Thank you, donescamillo@gmail.com

Job: Expert Xamarin Mobile Developer for iOS Application

$
0
0

We are looking for an expert Xamarin developer to join our team to work on a new iOS application. This would be a short term 10-12 week project, with possible extension. You would be working on a new application as part of an existing health care platform. Preference would be for a developer in the Dallas/Fort Worth area, but we are open to remote workers as well.

If you are interested, please send the following: 1. Up-to-date resume. 2. Any examples of work completed, open-source code published, etc. 3. Rates and availability.

You can contact me directly at daniel.dura@graphiumhealth.com

Thanks! Daniel


Using Vernacular

$
0
0

Hello,

I'm starting a project that contains an iOS and Android apps. These apps should be properly localized and we have chosen Vernacular to achieve this localization.

General question:

1) Is there any other cross-platform method/framework out there? I had been playing around with Vernacular for less than a day, and even when it seems cool and promises to work fine, it lacks documentation and examples out there.

Vernacular specific:

1) How do you add vernacular to your project? I'm working on the iOS portion and -after compiling vernacular solution- I could add Vernacular.Catalog.dll as a reference to both my Core and iOS applications. Is this the right way to do it? I would love to see a vernacular component.

2) Can I run vernacular in a mac? I haven't found how (I'm a newbie mac user). I could run it on my pc only.

Thanks, R.

Streaming Audio - examples ?

$
0
0

Hi All,

I found the sample app for streaming audio which works (although it's pretty full of bugs, crashes a lot) and I can stream an mp3 file ok. However due to the huge lag associated with mp3, and I need to stream audio with as little lag as possible, I need to stream a different file type, ideally PCM.

Does anyone have a super simple example of streaming different file types? What kind of minimum lag would we be expecting?

Thanks.

Where i can read about "How C# code is complied to Objective C"

$
0
0

Hi, I'm new to Xamarin platform. Where i can read about how mtouch tool working, how the compilation is done, some other low level thing. I think it will help me to create better apps. Any documentation about this topic available?

Scaling images that are @2x size (CurrentScale=2)

$
0
0

Greetings,

I have images that are 2X sized, I.E. in 1/2 pixel sizes. a 28x28 image that is 56x56 in number of pixels. In other words, I have a foo.png and a foo@2x.png file, and in this case, it is loading the @2x.

I want to rotate it correctly, here is code that works perfectly fine for "normal" images, but how do you set the CurrentScale Factor for an image? It appears to be in the constructor at the iOS level.

Here is my code:

    public static UIImage RotateImage (UIImage src, float angle)
    {
        UIImage Ret;
        float newSide = Math.Max (src.Size.Width, src.Size.Height);
        SizeF size = new SizeF (newSide, newSide);

        UIGraphics.BeginImageContext (size);
        CGContext context = UIGraphics.GetCurrentContext ();
        context.ScaleCTM (src.CurrentScale,src.CurrentScale);
        context.TranslateCTM (newSide / 2, newSide / 2);
        context.RotateCTM (angle);

        {

            context.RotateCTM (angle);
            src.Draw (new PointF (-src.Size.Width / 2, -src.Size.Height / 2));
            Ret = UIGraphics.GetImageFromCurrentImageContext ();        
        }

        UIGraphics.EndImageContext ();  // Restore context
 // Failed attempt:
 //         Ret.Scale (Ret.Size, src.CurrentScale);
        return Ret;
    }

Any ideas?

-Traderhut Games

About Xamarin for Visual Studio Tutorial

$
0
0

Hi All, Sorry for my ignorance but I am starting with Xamarin and I would like to get some tutorial about Xamarin for Visual Studio? Would it be possible? Could anybody help me to get it? Thanks for your time Best Regards Alejandro

Viewing all 204402 articles
Browse latest View live




Latest Images