Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the demo app source link? #560

Open
roelve opened this issue May 30, 2023 · 4 comments
Open

How to change the demo app source link? #560

roelve opened this issue May 30, 2023 · 4 comments
Labels
question Further information is requested

Comments

@roelve
Copy link

roelve commented May 30, 2023

This may be a bit of an unusual question but bear with me:

I used to be able to change the source URL of the supplied demo app so I could load app screens that are being served by my own local server rather than the integrated demo app folder. It seems however that with some relatively recent changes in how the demo app is viewed on Android, I am no longer able to do that because it is necessary (as far as I can tell) for a port to be forwarded for the demo to work which didn't use to be the case. Is there something I'm missing? Is there a way to still achieve this? Keep in mind: I'm not a developer but rather an aspiring full stack designer looking at Hyperview to extend my reach into the mobile development sphere, mainly so I can hypothetically reuse already acquired skills I have on the web on developing for mobile devices (HTMX is what brought me here).

@adamstep
Copy link
Contributor

Hi @roelve ,

I believe the port forwarding use case is covered in the README here: https://github.com/Instawork/hyperview#running-on-an-android-virtual-device

If you change the demo app source link here to something that uses a port other than 8085, you will need to re-run the adb reverse command with the new port being used. Is that something you've already tried?

@flochtililoch flochtililoch added the question Further information is requested label Nov 18, 2023
@roelve
Copy link
Author

roelve commented Jan 2, 2024

I know this was some time ago but I finally had some time to look into this again and I managed to make it work.
(It was an issue with the local WordPress installation that I was using. I eventually reconfigured it so that it would work).

I can now serve a Hyperview app directly from WordPress (which is awesome!)

@adamstep
Copy link
Contributor

adamstep commented Jan 2, 2024

That's great, thanks for the update!

I looked into using WordPress to serve Hyperview XML a while ago, it was a bit tricky since WordPress stores HTML blocks directly in the database. Would love to learn more about who you added support.

@roelve
Copy link
Author

roelve commented Jan 2, 2024

Well, I basically just added a plugin that generates the HXML using PHP (adding a PHP header("Content-type: text/xml"); in order to serve it as XML rather than HTML).
I don't actually see what you describe as being an issue, unless perhaps one would use the wbdb class to pull data from the database directly.

I imagine building the hyperview app up using functions like get_the_title() or even the standard WordPress loop should be possible without running into HTML issues. Like creating a custom post type and then adding the same header("Content-type: text/xml"); header to the custom post type template file should all theoretically work as I see it (and then add hxml as markup instead of html).

As for using the block editor to build up a hyperview app, that is going to be a bit trickier indeed (though I intend to find out whether it is possible or not). Although, I think, using an alternative, it might be possible to have a similar kind of functionality. ACF flexible content could potentially mimic the block editor functionality to an extent https://www.advancedcustomfields.com/resources/flexible-content/ without the added hassles gutenberg may cause in conjunction with Hyperview.

I'll keep you posted in any event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants