I am working on Xamarin.Forms app and it's working perfectly fine on Android device. Anyway, when I am trying to run it on iPhone simulator it's just showing the main screen of the app, but none of the features are working.
The main screen consists of two parts of which one is to browse and open files and the other is to open a menu. The layout consists of Browse, process and exit buttons and when I click on the browse button to open file explorer an alert is displayed, that something went wrong.
I enabled breakpoints and tried debugging it, but the control is going to catch exception part directly.
Here is the code for it can anyone please help me with this part? I am using Xamarin.Plugin.Filepicker NuGet package. When I place the cursor on the Exception I can see that
System.NotImplemented Exception:This functionality is not implemented in the portable version of this assembly,you should reference the NuGet Package from your main application project in order to reference the platform specific
and the code is
private Plugin.FilePicker.Abstractions.FileData file =
default(Plugin.FilePicker.Abstractions.FileData);
public async void OnBrowse(object o, EventArgs args)
{
try
{
// var file_path =
this.file = await CrossFilePicker.Current.PickFile();
if (this.file == null)
{
return;
}
string extensionType = this.file.FileName.Substring(
this.file.FileName.LastIndexOf(".",
StringComparison.Ordinal) + 1,
this.file.FileName.Length -
this.file.FileName.LastIndexOf(".", StringComparison.Ordinal) -
1).ToLower();
fileName = this.file.FileName;
if (extensionType.Equals("csv"))
{
csv_file.Text = (fileName);
}
else
{
await this.DisplayAlert("Name of the file:" + file.FileName, "File info", "OK");
}
if (SettingsPage.loggingEnabled)
{
LogUtilPage.Initialize("/storage/emulated/0");
}
}
catch (Exception e)
{
await DisplayAlert("Alert", "Something went wrong", "OK");
if (SettingsPage.loggingEnabled)
{
LogUtilPage.Log(e.Message);
}
}
}
Related
I'm a new xamarin developer and this is my first post :)
So, I'm develop a xamarin forms application with prism framework. Everything works in debug mode but in release mode the app crash on start on ios.
This is my OnInitialized function
protected override async void OnInitialized()
{
try
{
InitializeComponent();
if (DataContext.GetContext().CurrentUser == null)
{
if ((await NavigationService.NavigateAsync(nameof(LoginScreen))).Exception is Exception e)
throw e;
}
else
{
if ((await NavigationService.NavigateAsync("NavigationPage/MainScreen")).Exception is Exception e)
throw e;
}
}
catch (Exception ex)
{
Debug.WriteLine($"[ERR] in {nameof(OnInitialized)}");
Debug.WriteLine(ex.Message);
await UserDialogs.Instance.AlertAsync(AppResources.Error_Label);
}
However when I debug in release mode with check "Enable debugging" i catch an exception that said "navigation uri is empty". I dont understand why.
Debug option in release mode
All advice is welcome, thanks in advance
I have been trying to address an error generated in SharePoint 2010 that occurs when I update a list item that has a Microsoft Office document attached. If I make changes to the attached document (by clicking its link in the list item) and then attempt to save the list item I get the error message below.
save_conflict_error
I am trying to capture and deal with this error using the ItemUpdating event receiver
The receiver never catches the save conflict exception in the try catch.
I have tried everything that has been suggested in about 4 pages of google searches and I have run out of things to try. This is a last desperate attempt to find a solution (if there IS one).
Below is my code for the ItemUpdating event receiver.
public override void ItemUpdating(SPItemEventProperties properties)
{
try
{
base.ItemUpdating(properties);
using (SPSite site = properties.OpenSite())
{
using (SPWeb web = site.OpenWeb())
{
//determine list
if (properties.List.Title.ToLower() == "mytestlist")
{
web.AllowUnsafeUpdates = true;
this.EventFiringEnabled = false;
properties.List.Update();
} //endif
} //end using
} //end using
}
catch (Exception ex) {
{
//abort the update
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = ex.Message;
properties.Cancel = true;
} //end try
}
} //end function
Here is my Elements.xml file also.
elements_xml
Thank you in advance.
:)
It appears that using the itms-apps//.... URL scheme doesn't work in iOS 6 with the new App Store to show the product reviews area. Now I'm using the code below, but it just shows you the product. How do you get to the review area to ask for a review and take the user to the right tab of the product displayed?
void DoReview()
{
var spp = new StoreProductParameters(appId);
var productViewController = new SKStoreProductViewController();
// must set the Finished handler before displaying the view controller
productViewController.Finished += (sender2, err) => {
// Apple's docs says to use this method to close the view controller
this.navigationController.DismissViewController(true, null);
MySettings.AskedForReview = true;
};
productViewController.LoadProduct(spp, (ok, err) => { // ASYNC !!!
if (ok)
{
this.navigationController.PresentViewController(productViewController, true, null);
}
else
{
Console.WriteLine(" failed ");
if (err != null)
Console.WriteLine(" with error " + err);
}
});
}
Hello you could try iRate from Nick Lockwood and see if that fits your needs, you can find the MonoTouch bindings of iRate here.
btw it uses the following URL to open AppStore in review mode:
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id= your-AppID-here
Alex
I have created a tab bar which appears when I enter first time in database screen, this code is working fine. But when we go on another tab and again go on database screen tab it throws an exception
net.rim.device.api.database.DatabaseIOException: File system error (12)
I have closed database properly.
This error occurs when you try to open database which already open.
In first tab, you have opened database connection but when you switch another tab then how you close your database connection.
You should close database connection before reopen.
see following link for more details
http://docs.blackberry.com/en/developers/deliverables/29299/Opening_and_closing_databases_1585333_11.jsp
If you still not able to resolve your issue, please paste your database code.
To open database code
public void openDb(){
try{
closeDb();
// Open the database
URI uri = URI.create("Go2Reward.sqlite");
Logger.debug("-----URI-----"+uri);
_db = DatabaseFactory.open(uri);
}catch(Exception e){
Logger.error("--------- in open db====="+e.getMessage()+"----"+e);
}
}
// close database
public void closeDb(){
try{
if(_db != null)
{
Logger.debug("----close db---");
_db.close();
_db = null;
}
}catch(Exception e){
Logger.error(" ---------in close db" , e);
}
}
code to get data from database is as follow
public Vector getCategoryVector() {
Vector categoryVec = new Vector();
try{
openDb();
Statement statement = _db.createStatement("SELECT category FROM CategoriesTable");
statement.prepare();
Cursor cursor = statement.getCursor();
Row row;
while(cursor.next()) {
row = cursor.getRow();
categoryVec.addElement(row.getString(0));
}
cursor.close();
statement.close();
}catch (Exception e) {
Logger.error("---error getCategoryVector---"+e.getMessage());
}finally{
closeDb();
}
return categoryVec;
}
but when i open the database it work fine but within 10 transaction it returns the exception net.rim.device.api.database.DatabaseIOException: File system out of resources
I have coded to get the info from the user and send an email of clicking a button. The program is getting executed for a while and then the simulator is crashing showing error
"DE427"-Message queue full... Here's the code that i have done...
if(field==SendMail)
{
Message m = new Message();
Address a = null;
try {
a = new Address("user#xyz.com", "Rahul");
} catch (AddressException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Address[] addresses = {a};
try {
m.addRecipients(net.rim.blackberry.api.mail.Message.RecipientType.TO, addresses);
m.setContent("Name:"+Name.getText().toString()+"\n"+ "Phone :"+Phone.getText().toString()+
"\n"+ "Date & Time:"+DateShow.getText().toString()+"\n"+"Make:"+Make.getText().toString()+
"\n"+"Model:"+Model.getText().toString()+"\n"+"Miles:"+Miles.getText().toString()+"\n");
m.setSubject("Appointment Request (Via Blackberry app)");
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(m));
}
Can anyone tell me what the error is and how to rectify the problem....Plz...
It seems there is an issue with certain versions of Windows XP and the Blackberry simulator version. Check this link http://supportforums.blackberry.com/t5/Testing-and-Deployment/Simulator-quot-device-Error-DE427-quot/m-p/556321
If you clean up the simulator (delete .dmp files from simulator directory) and restart the simulator it works fine