I'm building an app that revolves around users scanning each other's QR codes and sharing information. This would be the main feature of the app, but often times the information in the QR code can get very large, and so it gets harder and harder to scan. In this case, should I encode only a URL in the QR code and pull the information from there? Obviously this approach would require Internet connection.
I think it will depend entirely on exactly how much information you would like to store. After a certain point QR's storing the data directly becomes unwieldy if not impossible.
Taking a look at this website: http://www.qrcode.com/en/about/version.html
You can see that as you add more data the QR code must become much bigger.
If you want to store just 500 alpha-numeric characters with Low error correction (may not be preferable if it can be printed) then your QR code will need to be 65 x 65 modules, not pretty but usable. If you need more data than that stored you can have up to 4,296 characters with version 40, the highest supported version, although your QR will look like that 177 x 177 monster on the right of the picture. Any more than that and you have to use a URL to point to your data (or find another encoding than alpha-numeric).
Using a URL also has the benefit of it being dynamic after the QR is created. So if the app generates a new QR evry time this may not be an issue, but if you'd like your users to have their own QR that doesn't change, allowing them to print it or share on social media yet stay updated then you'd want to point to a URL.
This is a good idea but let's go a step further? Why are they exchanging information and what's the frequency?
Can we use Bluetooth and pair them and send it back and forth?
Even better what about nfc? Maybe bump them to send it or bump them to establish a bluetooth connection and send the large data.
But large QR codes is going to be annoying after a point test it on some users and see what they think.
Going with the existing approach of your app, without requiring internet, you might consider using multiple QR codes. Two could probably be displayed on a smartphone, for example, at the same time. Beyond two, this might start seeming unwieldy, though.
Putting a URL in a QR code, as you noted, is a commonly used solution. It will scale better to a much larger data size.
Overall, however, the main thing about QR codes is that it is a "standard" that (almost) any QR code reader should be able to consume. Do you really need your app for the communication part, or just to store and use the exchanged data in some way? If your app is focussed on the communication, then there are methods of communicating that are much more scalable to bigger data. These include bluetooth and WiFi, for example.
I agree with @someone in that QR code is better and faster solution in exchanging some kind of data and agree with @David too ,in that it's not the best for some other data types.
I think you should determine your app scope.for example it's goal can be exchanging short texts,email addresses,contact information and URLs. a minimal app with high functionality with focus on sharing without any need to WiFi or Bluetooth. with acceptation this approach,you wont require Internet connection.