User Profile & Activity

Arief Handany Member
Page
of 20
Posted: August 27, 2015 6:59 AM

Hi Gabriel,

Continuation from last thread:

If you want to use basic method (without AppFramework) you can refer to this http://developer.intersoftsolutions.com/display/crosslight/Local+Data+Access and its child articles.

Also one thing you must remember is if you want to use Async & Await method you must dowload the Bcl.Async from Nuget (Add NuGet Packages in Xamarin Studio, Manages NuGet Packages for Solutions in Visual Studio).

I think the problem with your code is you are not yet initialize your DB, second problem is because you are using task method (toListAsync()), please check the attachment for examples, also don't forget to download the Bcl.Async for this project!

Notes: as this is just for practice i put the table exist inside viewmodel, the best practice is by putting it in onstart method in appservice.cs

Hope that'll helps!

Posted: August 27, 2015 6:35 AM

The next method is if you dont want to use our framework which i will explain in your other thread:
http://www.intersoftsolutions.com/Community/Crosslight/Problem-saving-object-in-sqlite/

Posted: August 27, 2015 4:20 AM

Hi Gabriel

First of all i will show you how to make it the right way (using Crosslight, and Our AppFramework which simplify everythings):

You can check your project in the attachment named Teste which already go through these steps

here is my steps:
1. Add reference to Intersoft.AppFramework in both Android and Core

2. Go to nuget packages and add Bcl.Async (To Use Async and Await )

3. In your Teste.Core/Infrastructure/AppService.cs, register your needed service, and on application start create table if not yet created

4. Don't forget to delete your modelBase.cs and container.cs in your Teste.Core because we will be using the one in AppFramework

5. In your PessoaModel you can add [DataMember] for field that you want to save in local database, [IgnoreDataMember] if you don't want to save to local database, but please remember this is actually not necessary, the most important is only [Primary Key]

6. Now you can Update Delete or Save from anywhere whenever you call LocalDataRepository using IOC Container as you can see in PessaoDetailViewModel

Posted: August 26, 2015 2:53 AM

Hi Gabriel,

You must add the reference to the assemblies first before Import/Using the Crosslight.Data, you can find your assemblies in you Packages folder in your project, i attach your project with complete references

You can try these 2 samples: http://git.intersoftpt.com/projects/CROS-SUPP/repos/sqlite-sample and for more advance: http://git.intersoftpt.com/projects/CROS-SUPP/repos/sqlite-sample-businesstemplate

also you can check our tutorial for SQLLite here: http://developer.intersoftsolutions.com/display/crosslight/Using+Crosslight+SQLite+for+Local+Data+Storage

Hope that'll helps!

Posted: August 25, 2015 9:11 AM

Hi Thomas,

I attach my sample for your requirement,

There are however things that need to be noted:

  • Persistent View is actually a native function, you don't to code anything to use it, so if you navigate to different view it actually saved the state of your previous/neighbouring view, thats why it can also remember your scroll location.
  • For Android, I actually make the detail in a new view/ activity because design wise it was to conform with android guidelines you can compare it with google play. However it was possible to do things you mentioned above but may create a problem in the long run based on my conversation with developer.
  • For iOS, this is actually inelegant solutions (as you can see in Tab View Controller) but i will ask our developer the true method to achieve this. But meantimes it should be qualified for your requirement above.
  • Above solutions happened because i must sets the title before tab view slider starts, because i show the navigation bar (using navigation context), title in both View Controller become assigned in navigation bar rather than Tab Bar
Hope that'll helps!

Best Regards,
Arief

Posted: August 25, 2015 8:39 AM

Hi Thomas,

Just an update from our developer, most likely this will be released in september as Update 

Best Regards, 
Arief

Hi Jimmy,

Sorry for your inconvenience, could you copy paste your output  (the one that have UNHANDLED EXCEPTION)

From what i see there are a few possibility for cause of this error possibly in your form view model (caused by different value type between FormMetaData and Parameter inside Model on that view model).

Also looks like your code work in our end.

Posted: August 24, 2015 3:44 AM

Hi Thomas,

You can try our sync sample (http://git.intersoftpt.com/projects/CROS/repos/samples/browse/SyncSample) for our Login, you can also create new Apps using business template in Visual Studio.

After that you can easily add these codes to where you want to be:

If user access this codes while not login to their account, they will be prompted to login first.

This interaction are actually through Facebook API & Twitter API (access low level graph) but we don't use their SDK so you don't need to worry about SSL permission and Both Platform Apps Review. You can submit your apps after done developing directly to App Store/Google Play/Windows Store.

Hi Jimmy,

I will ask our developer it should be on progresses right now!

Posted: August 21, 2015 1:35 AM

Hi Thomas,

Look like this is not the case, 

We actually test in different kind of API 15, 17, 21 in different kind of phone (4.12, 4.21, 4.42, etc. Even in API 10 still work if i not wrong, we are using galaxy tab 1).

This problem actually exclusively happened when using 4.42 in Automatic uses target framework version, in other option if we test it it will work as intended. My suggestion is just sets your minimum to API 15 or any API that you want but set the target API as highest as you want.

I suspect this is Xamarin problem that using wrong API when use automatic mode but we will investigate our code more if needed.

Hope that'll helps and sorry my late response.

All times are GMT -5. The time now is 2:51 AM.
Previous Next