Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

FeatureSample Testing; Quickstart & FormsSample Xamarin Android Demo working #52

Open
ghost opened this issue Oct 14, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2017

I had downloaded the whole package of FeatureSample and compiled it with no errors into an APK file.

It was 40 mb and I started to run the app. The first page selection is running fine with all the selection of the 43 samples listed but when I try to test each one of them - there is a black screen that follow on - every single one of the declared activity.

  • Do you have similar problems running the FeatureSample app or is it just me?
  • I noticed in the Visual Studio that there is obsolete statement of AbsoluteLayout. What should I do with this?
  • I have disable Cocoa package to be compiled because of missing assemblies references, does this relate to building solution up of the whole package?

Thanks

@ghost
Copy link
Author

ghost commented Oct 15, 2017

I don't have a working solution for this because of how it is coded (eg - obsolete class, UrhoSurfacePlaceholder doesn't work) but I previously had made FormsSample demo working - UrhoSurface & Xamarin+Forms.

You can port the (eg. 01_HelloWorld.cs activity - from Core FeatureSample file) into FormsSample project and change its setting of App.cs line StartUrhoApp() (from Show Charts into Show HelloWorld as their super class is Application) and start a demo from there. Obviously it may resemble the original layout but the words display accordingly.

This is just an hack to see how does it work - maybe you can try other harder examples if it does fit into the criteria rather than waiting for the answer.

https://www.bountysource.com/issues/48864595-urhosurface-createsurface-mygame-activity

@ghost
Copy link
Author

ghost commented Oct 15, 2017

I have another one working for 27_Urho2DPhysics.
The files can be added to the existing project running on FormsSample.

JoystickLayoutPatches.cs - FeaturesSamples/Core github
Sample.cs - FeaturesSamples/Core
Urho2DPhysics.cs - FeaturesSamples/Core/27_Urho2DPhysics

Remember to add in Asset/Data files according to the files in github
for:
Asset/Data/Textures/LogoLarge.png
Asset/Data/Textures/UrhoIcon.png
Asset/Data/UI/DefaultStyle.xml
Asset/Data/UI/ScreenJoystick_Samples.xml
Asset/Data/Urho2D/Ball.png
Asset/Data/Urho2D/Box.png
Asset/Data/Fonts/Anonymous Pro.ttf

They load the graphics into the screen.

What does the line for the App.cs look like:


public class UrhoPage : ContentPage
{
UrhoSurface urhoSurface;
//Charts urhoApp;
//HelloWorld hwApp; -- example from last comment.
Urho2dPhysics u2dApp;
Slider selectedBarSlider;

...

async void StartUrhoApp()
{
//urhoApp = await urhoSurface.Show<Charts>(new ApplicationOptions(assetsFolder: null) { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });

//hwApp = await urhoSurface.Show<HelloWorld>(new ApplicationOptions(assetsFolder: "Data") { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });

u2dApp = await urhoSurface.Show<Urho2DPhysics>(new ApplicationOptions(assetsFolder: "Data") { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });

}

Happy Demoing!! :)
( - make sure everything does load such as correct namespaces when copying the files from Github)

@ghost ghost changed the title FeatureSample Testing on Demo FeatureSample & FormsSample Testing for Demo Oct 15, 2017
@ghost ghost changed the title FeatureSample & FormsSample Testing for Demo FeatureSample Testing for Demo & Quickstart demo Oct 15, 2017
@ghost
Copy link
Author

ghost commented Oct 15, 2017

More for readers on the topic Xamarin Quickstart demo.

For those who had finished the Quickstart demo from the Xamarin, there is a few clues left hidden in producing the same results as us.

For those who had the emulators not working for them (too slow machines), they can try producing a signed apk file to their Android phone following this part of the story: https://developer.xamarin.com/guides/android/deployment,_testing,and_metrics/publishing_an_application/part_2-_signing_the_android_application_package/

*** Important to know how to *** if you wanted the build the apk file!!

Go to Project's Build tab -> Rebuild solution (*no errors) then Build -> Archive .

This builds the dll files in the folder then View Archive -> Select your Archive file -> Distribute

Make sure it has been signed properly (Ad-hoc - with alias: (eg a name), password: (eg. abcd - remember this as you would do it for every signed apk) ) or otherwise it may suffer "parsing the package" error when the phone tries to do during the installation process. (you are actually port this file to your phone apk storage with your phone set to developer's mode and settings. )

What other things should be aware of: API settings of your phone to the correct version from the manifest file (right-click to properties of your project "Phoneword" (From Solution Explorer). Go to Application tab and select the correct settings.)

NB: There is the application ICON settings that needs to be aware of. https://forums.xamarin.com/discussion/104884/issue-about-application-icon-present-in-hello-android-quickstart-document

** I have spent six hours to get this far and it has been my first Xamarin app ever :)

@ghost ghost changed the title FeatureSample Testing for Demo & Quickstart demo FeatureSample Testing, Quickstart & FormsSample Demo working Oct 15, 2017
@ghost
Copy link
Author

ghost commented Oct 15, 2017

Similarly making this work would make FormsSample demo work as well by the same lines.

Happy demoing~~~

@ghost ghost changed the title FeatureSample Testing, Quickstart & FormsSample Demo working FeatureSample Testing, Quickstart & FormsSample Xamarin Demo working Oct 15, 2017
@ghost ghost changed the title FeatureSample Testing, Quickstart & FormsSample Xamarin Demo working FeatureSample Testing; Quickstart & FormsSample Xamarin Demo working Oct 15, 2017
@ghost ghost changed the title FeatureSample Testing; Quickstart & FormsSample Xamarin Demo working FeatureSample Testing; Quickstart & FormsSample Xamarin Android Demo working Oct 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants