Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I would like to make an app which can slow down a user's internet speed. Is there any ways? It's for a gym sports events where whenever the runner is running on the threadmill and with their speed on the threadmill,the download speed of a file is changed. For example if the running speed is faster,download speed is faster. Is there any codes that are able to control the internet speed? I looked up on stacksoverflow but all is on simulator.
There are no public APIs for doing this. I would suggest that you instead fake the reporting of progress.
If it is your app which is doing the downloading then if you implement the HTTP/FTP/whatever communication yourself over TCP/UDP your app can insert delays; or it can just download at network speed to a temporary location and transfer it from there to the correct destination at whatever speed it chooses.
If you are trying to slow down standard apps like Safari you could add a HTTP/FTP proxy to your system, which rather than simply proxying slowed down transfers. If you don't want to write a proxy from scratch take a look at Squid or GlimmerBlocker (I think its source is available, its in Java, this proxy is a Mac ad blocker demonstrating a proxy can be used for more than just proxying).
HTH, Have fun!
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I am working on a project where I need to display network bandwidth value on a screen, which will keep on changing with the Network speed on my device. I don't want to implement a solution where I have to download a file every time and then check the speed. Please provide some alternate solution to it. Thanks
I have tried below mentioned solutions, but doesn’t suits my requirement.
Determine the speed on internet programmatically
Right way of determining internet speed in iOS 8
How to check if device is having poor internet connection in swift
https://stackoverflow.com/a/26436392/21203365
How to find wifi speed in iOS programmatically
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I would like to know what are the best practices regarding, Modeling data when no network connection available, if the app you are building is cloud computing based, but still you want to be able to have basic functionality and I guess some persistent data?
PD: I am kind of new to IOS development
UserDefaults is okay for small bits of data that don't change often, but as it has to rewrite the entire user defaults dataset to a file each time a change it made, it is not robust enough for anything of volume or with frequent changes. For that you would want CoreData or a third party open source solution like Realm.io.
You can try to using the 'cache' where you store temporary data.
One way to achieve this is NSUserDefaults where you set a variable (let's say users profile photo) and when the user opens his app again, the image will be loaded even if there is no internet connection since its cached. Hope this helps!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Here's the link to the app...
http://www.gadgetlite.com/2011/01/25/viber-app-hits-version-1-1-network/
I've looked around and mostly suggest private api or networkactivityindicator (which is not what im looking for)
Would appreciate any hint on how I could start
The network quality of the Viber app refers to the data connection.
Set a start time at NSURLConnectionDataDelegate's connection:didReceiveResponse:, then transmit something and count the bytes at connection:didReceiveData:. At connectionDidFinishLoading: set the finish time, calculate the time interval and match that against your arbitrary thresholds.
I have the feeling a default iOS framework would have that information (look at networking libraries in iOS). If not, you could possibly look at ping times (ping a URL in the background and look at the delay amount, make sure you're using a server that's available and quick at all times. ping google.com maybe?)
So I looked around, having read the very useful answer that Ege Akpinar gave earlier, and stumbled upon this article. They use the Apple's own Class, which can be used on Mac OSX and iOS:
Get ping latency from host
The link to Apple's Sample is available through the above link, but for the sake of efficiency and speed, here is its direct link:
https://developer.apple.com/library/mac/samplecode/SimplePing/Introduction/Intro.html#//apple_ref/doc/uid/DTS10000716-Intro-DontLinkElementID_2
I also found another post that shows how to implement the class using Swift. I thought I might include it, in case you are using Swift:
Using Simple Ping in swift (iOS)
I hope this will be of some use.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking to send data from iPhone app to desktop OpenGL application using sockets connection. e.g. location of texture,
I have the OpenGL application running on the desktop.
And a separate socket application for desktop and iPhone where I can send/receive the data.
But I'm not sure how to combine the sockets application and OpenGL application for the desktop.
The desktop OpenGL application can only receive data once, and then it gets into glutMainLoop().
The desktop opengl application can only recieve data once, and then it gets into glutMainLoop().
That's because you wrote it that way. Your application does exactly and only what you tell it. You put your "get data from socket" code outside of the main loop.
You can simply set up a timer function with glutTimerFunc. In that function, you check to see if there's more data, and if there is, you store it and call glutPostRedisplay to make GLUT call its display method again.
Personally, I would suggest avoiding GLUT for an application like this, where you need control over the main loop. GLFW will be much more useful to you, since it's easier to simply check the socket to see if there's new data after rendering a frame. You might even want a threaded solution, though that's a little much for a simple case like this.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I've been asked to come up with options to offer free ringtone downloads on a website. These would be actual free ringtone downloads, not "Sure, we've got free ringtones, but wouldn't you rather have these much cooler ringtones over here for $1.99?", but actual free-to-download ringtones. Is there a way to provide this in a relatively global manner? Is it as simple as providing a low-quality, 30-second MP3 that the user can convert themselves? Is there a service out there that provides this functionality? We're looking for options. Thanks.
There's different methods of starting downloads based on which carrier/phone you're using
Sprint - GCD(generic content descriptor)
Verizon you have to send an MMS
ATT - depends on the phone
Nokia phones need a DD(download descriptor)
The list goes on and on and on
Not really a simple problem to solve
ringtones vary by phone; some require MIDI ringtone, for example, but for most modern phones a direct download of a short mp3 file is sufficient