I'm currently designing a speed test app that obviously includes Ping, Download & Upload tests among others.
I already developed the logic behind the multithreaded tests so I can define create as many threads as I need for each test, being able to set multiple connections to avoid throttling for high speeds or unstable networks and having more precise results.
I'm not currently asking for code but I'm asking for the logic behind of the number of threads to use for each test for every network type and available bandwidth.
As a piece of additional information, my download test uses https connections and the upload test uses socket connections. Any required additional information, please let me know.
I've tried research about that but the only thing I could find is that Ookla Speedtest (browser version) uses 4 threads if the speed is at least 4Mbps and 2 threads on lower but browser multithreading limitations are different than the ones we have in Android apps. -> Link
I don't expect that someone gives me the exact logic behind this but it would be really useful if I could be pointed in the right direction. Any article, post, book, resource about the topic would be much appreciated.
Related
I'm knee deep in this commercial game and currently working on the in-game chat. How I code the chat system depends on rather or not threading will work.
My question(s)....
Does anyone know for sure calling a thread on android or ios will result in a separate process and not hold up the app until complete?
This worries me because I came across another python user who was developing some form of app and they stated that their thread did not run as an individual and their app froze up until the thread completed. (which sucks because python is a cross-platform language)
What I wanna do is have a thread periodically fetch chat data from the server without causing the whole app to pause while doing so. This will allow for a more professional looking chat system and better user experience.
However, if for some reason python threads will not act as expected, I'll have to use a different logic for the chat system.
I'm sure some of you will probably be like, "just test it" but that's just it....I don't wanna (want to, lol) write all that code just to re-write it all over again if for some reason threading doesn't act right on a phone.
I'm not asking for code here....God knows I can code the hell out of an alien battle cruiser from planet Zars equipped with warp 7.5 engines.
If no one can give me a for sure answer then.... (sigh)...... I'll have to just write the code and cross my fingers in hopes of accurate threading behavior on phones for python programmers or be faced with the devastating task of re-writing a large chunk of code..... on the client and server side!
=====================Update as of July 14 2017==============================
I went ahead and wrote the code anyway. Turns out the Kivy API set has some back-end issue with creating Rectangle draw instructions in a python thread. This issue doesn't seem to be relevant when creating widgets from within a thread.
I did find a work around for the draw instruction issues and had things the way I pictured it all but in the end... I saw more cons than pros in the way I was planning my chat system and decided to re-write it anyway.
The new chat system is easier to work with and I don't have to implement code and fonts for multiple languages. (phew!)
So....looking at my original question now....
Yes,
Python threads will run on their own cpu cycle on an Android phone but what you're trying to accomplish depends on your entire setup...back-end and front end APIs.
I'm surprised to see people assume python can't thread when the language has the modules for threading.
Hell I run threaded processes separate from the main thread all the time on PC. In fact, I have this nice email app which can generate emails and send out ads/flyers and maintain a valid email database.
The app uses threading to update the UI system so the user of the app knows what's going on in the background. It's a marketing tool I plan on using later after I release the current app I'm designing now.
I might even release my marketing tool but such a high quality app wouldn't be cheap on the market. Not when marketing cost so much money. Being able to reach your target audience at little to no cost... Sounds too good to be true.
:)
I've been programming for over 20 years, but mostly in the VB and SQL. As a side job, I host game shows at local bars and restaurants (Trivia, name that tune, etc.) and I'd like to develop an android app that I can install on mobile devices to give to customers to interact with the game.
I'm trying to make the game shows more interactive than just pen and paper (and time-consuming, manual scoring). I can get Kindle Fires for $40 each, so I thought it would be cool to create an app that will allow the user to do 3 things:
Choose an answer from a list (Multiple choice), and everyone can answer
Buzz in (blocking other users out)
type in an answer
I'd like the tablets to send the responses to a central "hub" or application that will record the answers so it can automatically do the scoring for me. If possible, I'd prefer to be able to have everything connect through an ad hoc wifi network that I would set up on site (that part I know how to do, too).
I'm not looking to have the questions appear on the phone at this point; I have an office-based application that automates a powerpoint presentation based on questions/answers and other parameters imported from a database/spreadsheet. (VBA is nice and easy for me.)
Ideally, the quiz questions would work like this:
I project the answer where everyone can see it.
After announcing the questions, the tablet apps are "activated" and
the user can then select their A, B, C or D answer (or buzz in, or
type an answer depending the type of questions/quiz).
My hub application would then receive the following information:
team/player name, answer choice, time it took to answer the question
(because I'm thinking of using a points tier that gives faster
players get more points, either based on time ).
The catch is, I don't even know where to begin from an android development standpoint, as I have no experience in that realm. In most programming cases, I know keywords to search on, but I'm totally flying blind here.
Does this seem like a feasibly application? There are systems online that I can buy, but the buzzers are expensive and the software has some significant limitations that prevent me from spending the money. I'd rather develop something myself and spend $40 per client unit and load it up with my software.
(Then, of course, license the whole kit and kaboodle and make a mint and retire in 5 years, living the good life off of my pub quiz empire...)
So, if you have any suggestions on starting points, or specific methods and processes to being fiddling with, an IDE...any help would be greatly appreciated. Once I'm up and running, I will reward you with extra points if you ever come to one of my events.
Go full kotlin !
Android works well with Kotlin and you can have a server quickly setup with : https://start.spring.io/#!language=kotlin
https://kotlinlang.org/docs/tutorials/kotlin-android.html
A good client for Android is provided here :
https://github.com/square/retrofit
You will probably have hard time to get started. Using same language for every part of the system will make things easier.
Also, Kotlin is less verbose than Java and will prevent you to make the usual mistakes found in Java world.
Also, if you create an open source project out of it, you may be eligible for IntelliJ.
Your very first stop is : http://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
Get to know the language by trying it out. When you are in ease with it, start looking at Anko (https://github.com/Kotlin/anko).
To do the project in an easy way, break it down in milestones.
Simple app which shows 4 buttons (choices) and shows a message for each button. (Eg. you clicked "1")
Small server with spring boot. It should display whatever you post to it. (An "echo" server)
Improvement of the simple app to POST something to the server and display the answer in a dialog.
At that point, you application is practically done! You would have understood enough to complete it. The hardest thing would be behind.
Don't think your are smarter than the flock. Do these milestones, at least. You will be thankful to yourself.
This post may seems unrelated, but I explain how good Kotlin can be in such projects : https://www.linkedin.com/pulse/why-do-android-projects-cost-less-than-ios-christian-baune
My plan is, to create a instant video chat App for Android. I've found Sipdroid wich gives me the opportunity to make video and voice calls using the SIP.
The user should just open the App and be able to instantly video chat with another stranger from the pool.
Now the question is: I only need to setup a SIP-Server and create a pool of SIP-Accounts or create them on demand. Then I'm able to use Sipdroid and modify it, so it fit's my needs.
Is this all? How about this STUN-Server thing? Am I missing something?
How many connections could take a avarage root-server? Actually it should be a lot, because the stream is transmitted using P2P.
Other suggestions to create a P2P anonymous video chat app? I've seen similar Apps. But they use FLEX. This is not what I want to do.
Seems like you are in the good direction. You will need to do the matching logic between 2 idle users and incorporate that feature into SipDroid. There may be some complexity in finding the idle users due to all kinds of corner cases you will get. It may be similar in features as implementing presence in an IMS system.
For STUN, it is synonym to NAT traversal. You may need to care about that but it depends of your network setup.
For the performance, it will vary upon server implementations and hardware you use. You will need to do your own benchmarks. I would guess you don't need to worry unless you have a few dozen concurrent users.
Im writing up a business plan and im having some trouble with the finance part. I put an estimate on the cost of developers, web designers and everything but server costs. Im not a programmer so I dont know all the details. But how much would you think servers are going to cost for a complex app. I cant get into too many details but it keeps track of user preferences, stores data about the user and there is quite alot of back-end to it.
As i said in my response to your comment to #mark; this is a tough question as we don't know enough to make good predictions. To help you make your own predictions
As its only a business plan (i.e. not set in stone) think of a number of users that you want to run on a given piece of hardware - for the data / web servers.
Be aggressive but in the real world as the developers will have to code to make this target and make that part of the spec for the software - 200 concurrent users on a web server for example and that 10 web servers needs a dual core xeon database server or whatever the app needs.
Then you can plot a graph of expansion as it goes; they tend not to be linear so have a lying weasel factor to handle that that rolls the graph off as you go.
Then don't forget about backup, load balancers, firewalls, content managers, caching proxies and all the other network kit you will need.
You will also need to budget for someone to run it all... If its a web app probably 3 to handle it in shifts. Either that or make sure your IT people are the most dedicated so that the servers get restarted in the night when it all goes wrong.
Finally ... Does the system need DR? if so that will need to be included.
It really depends upon the complexity of the app, how much traffic you expect and what platform you need. The real cost is in the time managing the thing.
I would consider amazon aws (http://aws.amazon.com/ec2/pricing/). There's even a free level to get started.
They have system images prebuilt, free and purchasable, that might have the configuration you'll need. You can use one to build an image of your own and deploy it to many servers quite easily if your app takes off.
This heavily depends on the numbers of users that concurrently use your service and of course how much traffic you will have. Without more details it is not possible to estimate any costs.
Edit:
Possibly it is the best if you sit down with a developer, explain her/him what you want to do. There is a good calculation program from amazon webservices (cloud).
You can find it here: http://calculator.s3.amazonaws.com/calc5.html
For example if you would need 5 Linux CPU medium instances for one year + Load Balancers (they will spread the load to the instances) + Traffic (50000GB out + 500GB in) (per user out 1GB/month + in 100MB/month)
This would be all together a One-Time payment $2275 and monthly $7101
http://calculator.s3.amazonaws.com/calc5.html?key=calc-DE0DC116-63C1-440E-BE15-213263DC4E2B
But this is a too complex question to rely only on guesses. The advantage of Amazon AWS is, that you can grow with the application. Perhaps it would be the best to start small and see what you will need.
Take a look at the Dell, IBM or HP sites, say, and see if they quote rough figures. Compare with the cost for services like Amazon's EC2, or Microsoft's Azure. It's impossible to tell you what you need, without knowing what you're actually doing.
I am looking to profile my web application on Android for starts...what is the best way to get the kind of information that a tool like Web Inspector would give me on the desktop? Since I cannot use Web Inspector or Speed Tracer on the mobile device...how can I get such data/info ?
You could use WebDevTools for Android :
https://play.google.com/store/apps/details?id=com.voltcode.webdevtools
It's a web profiler that gives basic information on how a mobile web page loads on the device.
Loading times can and often differ on a per device/menufacturer basis - this is due to internal HTTP settings and loading, processing and javascript execution differing speeds.
disclaimer I am connected to the author of this tool.
I would use a split lap timer in one hand, and load the application on an Android with the second. Refresh multiple times, and then calculate the average. That should give a good estimate of the startup times. No kidding.
Is your web application heavy on Javascript? Or is it intensive on the server-side, or maybe both? Network latencies may vary, so it's better to not factor that in your profiling. Instead profile the server side separately, which will give you a solid estimate of how fast is a response getting generated. Android uses Webkit so the Web Inspector should give you a fairly good idea of how the Javascript will perform on an Android device. Also, checkout v8 benchmark test suite on your device. Similar to these test suites, you could write your own benchmarking tests specific to your web application. There will be lot of things that can affect those benchmarks that are outside your control so keep that in mind when writing those tests.