Posts by Amin Mousavi

Show threads by Amin Mousavi
142 posts found, page 2 of 10

Amin Mousavi (In thread: HTML Compiler and sqlite?)
Bryce Beattie, PhoneGap has a SQLite plugin that you can install on App builder and use. I have not used in AB myself to give you the details but since I am using other phone gap plugins here, you should be okay. On a general note though, I recommend you to stick to objects and arrays and store them in local storage if your data is small. Running SQLite and the errors is causes when building the app on cordova is a pain in the neck. So after a few month of use we got rid of it and wend back to good and easy to use objects and local storages. Hope it helps

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi David,

Sure thanks, doesn't look very complicated! I am considering https://github.com/bloatless/php-websocket at the moment but there are other options too.
Thanks a mill!

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi David,

Thanks a lot indeed for taking the time to respond to this question and following it up with your colleagues despite your busy schedule.

It was so much help, I will follow the links you recommended for the server side implementation.

All the best

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi David,

Thanks a lot for your great help as always!
Yes I meant push notifications, sorry for the confusion. We currently use FCM for one of our AB projects and started off with the PHP codes you provided on the samples and as you described they work like a charm hence the third option design. Yet the chance for the delays and the fact that it is a third party service made us to decide to implement it with the WebSocket and use push notifications for error handling. So David, if you don't mind me asking, you mentioned earlier that you have implemented the websocket with JAVA and can provide more details, I appreciate it so much if you can elaborate.

Thanks again for the great support

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi David,

You are exactly right. Errors should be handled at the app level and has nothing to do with the network part. For plan 3 and implementing all the communication by notifications the down side in my opinion is that even though in principle it must reduce the number of times systems should communicate with each other but after considering the error handling and high probability of them occurring, number of times that systems should communicate with each other increase and it may defeat the whole point of the design. Any how, cross fingers I will start working on it on Monday if nothing else goes on fire in the mean time :D and will keep you posted here how I get it done.

Thanks a million for your assistance as always

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi David,

Thanks as always for your great help. It is very much appreciated.

I also did not like the second option but because its implementation is very convenient, it was tempting and an evil voice in my head was saying "don't worry it will work, it can pull the weight, you don't need to redo every thing over again" :D well but I know it is not the best option myself.

We don't really need a real time bidirectional connection between the players because the pace of the game is very slow and the amount of data being sent and received is very small. The only part in option 3 that worries me is the error handling. The maximum number of players in one game is 4. So lets say one of them makes a move, the three other should receive a notification and if all deliver then the player who has made the move also should be notified. So what if one them don't deliver, or delivers 1-2 seconds late? it disrupts every thing, if not handled properly. It still is a raw idea but risks associated to it I think is very serious so it is likely that I discard that too.

I think I need to make the hard choice here, go with the harder but more reliable solutions. I study MQTT that Samuel suggested and Websockets a bit more, study more about VPS, and any other options that I might have in a budget price range, and then finalise the plan. I think so far that I am better off with getting a VPS and implement either MQTT or websocket on it for the communication and rest assured that I did it the right way.

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi Samuel,

Thanks a million for taking the time and respond. I actually am using a shared hosting sorry for misprinting. Honestly so far I have only used shared servers on CPanel and Plesk and Virtual machines on windows and was not familiar with option of VPS. From what I gather with a fraction of cost of VM I can get a VPS and that is great! It just puzzles me how come an enterprise level shared hosting is this much more expensive in comparison to a VPS? (I came across OpenStack KVM, 1 vCore(s) From 2 GHz, 4 GB RAM, 40 GB SSD, Local RAID for 72 euro a year but this shared hosting costs 260 on Spiralhosting that is one of the cheap ones! 25GB SSD Diskspace, 500GB Monthly Bandwidth,1.5GB RAM, 50 Concurrent Connections). My plan was to upgrade the shared hosting plan when resources run low to avoid migration but it seems like I have to migrate at the end :)

I read about MQTT and found a PHP library for it. I should study more about it and weigh the pros and cons for my implementation.

Your insights were very very helpful, I greatly appreciate that. As I said when it comes to server hardware I am a newbie. My expertise is SQL, I hope I can return the favour there some day :) Will keep you posted here on how I proceed.

Amin Mousavi (In thread: Seek opinion on a networking problem)
Hi all,

It is not AB relevant but more a generic network question. I am building a multiplayer puzzle game, using AB for its UI. To give a bit of context, each player can make a move every 15 seconds so it is not a real time networking matter. For the networking I have googled a lot and my findings and thoughts end up to the below options:

1- Use a websocket for communication
2- Clients call an API once every second and to learn about any updates by the other player
3- When a player makes a move calls an API that uses FCM to send a push notification with the data needed to the other and receive a confirmation notification in return

I did not come across the third option anywhere so it gets me thinking maybe it is not a good idea. Given the very low amount of data that goes and returns, many suggest option 2 (I expect a 10 letter string every 10 seconds or so to be sent to the other player, but I need a call every second to avoid delays). But it seems like option one is the fastest and easiest to scale.

Now what brought me here is lack of my knowledge on servers and specially websockets. Could a shared server serve 100 players live and all calling an API once a second? or I better off get a websocket from somewhere even though I do not really need a real time communication.

Any insight is very much appreciated

Amin Mousavi (In thread: Mediaplayer Loop)
Hi David,

Tried to reproduce the error for you but out of the environment everything works fine. Anyhow, the JS piece fixed it for me, I had tried changing the variable names and so but no success, I think it is one of the bugs the is fixed but we never know why it was not working in the first place, I hate the sound of it but time pressure is high and we need to power through :) thanks a mill for your great help and support as always :)

Amin Mousavi (In thread: Mediaplayer Loop)
Hi David,

Thanks for your quick responses as always David :) I don't think it is because of the media, it is local and I used the below JS code instead of AB media player and it works fine. I can not think of any thing really that why loop in my media player does not work!


Amin Mousavi (In thread: Mediaplayer Loop)

Hi David,

For some reason when I set Loop on media player True, it does not repeat the media, it used to work fine!

To explain the context a bit better, I have 4 media players but only two of them work simultaneously, one play the background music and one of the others play something else once on in while and they all play only mp3. I used to have 2 media players but some times media sources had to be changed so quickly that was too quick for media player to load the other mp3, hence I used 4 media players! I appreciate your advice on how I can fix media player loop issue.


Amin Mousavi (In thread: Image Resizing)
Hi John,

For height and width I suggest assigning a class to your object and use "vw" for your width and set height to auto. In the below example width of your picture regardless of the size of the phone will take 40% of the "viewable width" and height will be defined accordingly. Depending on your design you can assign a size to height and set width to auto. You also can use "vh" or "vw" for the height if you wish. From the top of my head, I think auto does not work properly all the time, so you might perhaps use the second class since your picture's height and width are equal.


Regards

Amin Mousavi (In thread: Change the language direction of the app)
Hi again David,

Found the problem, sound obvious but anyhow it was my mistake/lack of understanding of how themes work.
First I thought only adding the bootstrap css into AB files is enough! but then I noticed when there are more than one theme to switch between I need to include them in the design time first. So that is why when I was putting the RTL bootstrap on default it was working fine but then at run time it was not because I had not included it! Any how, now I included default and the bootstrap you suggested at design time and switch between them at run time and every thing work like magic!!

I thought I better leave some clarifications here for future reference in case it helps some else later, in App options there is a list titled "included" and I read it as all below are included, but infact only the highlighted ones are included! which you wont see the first time as you use only the default theme!

You are so great David, I don't think I have said that enough, THANK YOU :)

Amin Mousavi (In thread: Change the language direction of the app)
Hi David,
I had tried [App.TextDirection] before, works for most parts except Labels that are inside containers, Alert Boxes and message boxes. I tried applying themes at run time, it works but it messes up every thing, drop downs don't work any more, and many of the classes don't apply after switching theme, Applying theme at design time was alright though, no such issues. Any how, There are infact two classes that I need to modify at run time if doable and add "text-align: right !important;" to. These classes are ".alert" and ".model-content" for the alert and message boxes, problematic labels are two or three and I can add the class to them manually. Not sure if doable as I could not find a JS code doing that for me. Any idea or suggestion is greatly appreciated.

Amin Mousavi (In thread: Change the language direction of the app)
Hi David,
Thanks for your help as always! It worked as instructed but there is only one issue with it. It is a multilingual app and we need to be able to change the direction at run time. Is there any way I can load this CSS or theme at run time?
Thanks a lot for your great support :)

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.