Mobile App Using Remote Web Server

天大地大妈咪最大 提交于 2020-01-06 05:47:35

问题


I must say that I am reaching the end of my tether with Flash Builder and Flex. Firstly, I have built this wonderful app that I want to start using but it is data driven meaning that when I built it, I created it on my localhost. The PHP scripts were generated from Flash Builder and I have edited them to make them more secure. I have all my services working 100% and I have this brilliant app, but I can only run it on localhost. I have done everything necessary and installed Zend Framework on both servers, I have configured Zend properly but I cannot work out how to change the mobile app to now read from my remote web server.

To me this is useless as I want to be able to deploy this app to others to use when they are out and about.

Does anyone have any clue whatsoever as to how to change it from looking at a localhost to looking to my remote web host? Any tutorials or anything that you can think of? Any help would be appreciated.


回答1:


Does anyone have any clue whatsoever as to how to change it from looking at a localhost to looking to my remote web host?

Usually, I don't have to do anything. It just works. But, for some reason, the "first migration" from localhost to production seems to be hard for every Flex developer. Here are some things I wrote about that frustrated me.

Before moving forward; I'll add that your post is inherently confusing. You talk about running your app on localhost; but you also talk about building mobile apps. Were you building a native mobile app? If so; how are you running it on localhost? Mobile Native Apps don't run on a local web server; they run in an emulator.

The rest of this post assumes you are building a browser based app, but even if not should give you some good debugging tips.

Most likely you did something ignorantly which is preventing things from working. Once you figure it out you'll never have the problem again. So, here are some things to check:

It sounds like you have URLs hard coded somewhere within your app that point to localhost. I'd look for that first.

If you're using AMF with RemoteObject; it may be in your services-config file that is hard coded into your app. Be sure to check that if you are compiling a services-config into your app.

Beyond that, it is possible that your remote server is not configured properly. When using ColdFusion we have a special URL ( localhost/flex2gateway ) that we can check to verify that Flash Remoting is set up properly. I'm not sure about PHP, but I bet it is something similar.

You didn't tell us your specific setup, but if you're using a locahost SWF with services on you remote server, your remote server will need a crossdomain.xml file to allow the "off-server" access.

You didn't tell us your specific error, which makes it hard to provide more information. But, be sure to test your services--outside of the Flex app--to make sure they don't have remote errors. Be sure to check case sensitivity of URLs on your localhost vs your server. Be sure to use a Network Sniffer such as the Flash Builder Network Monitor to or ServiceCapture or Charles to check the traffic being sent from the browser/Flash Player to your server. You may discover errors that way.



来源:https://stackoverflow.com/questions/9770166/mobile-app-using-remote-web-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!