Prevent complete charging?
The only potential solution would be to find a way to current-limit the cable so that the phone would have to run off battery. You cannot simply disconnect Vcc and Ground pins, as the USB standard requires the presence of those electrical connections before D+ and D- pins are permitted to be energized. Running off battery like that would just increase your charge cycles, causing the wear you want to avoid.

As far as apps, there is no way to programmatically control the battery charging subsystem in this way; BatteryManager outputs information but does not accept inputs from user apps.