Power a circuit and read output from tablet microphone port
It's probably possible to power your device from the microphone port itself if your device consumes about 1-2 mA or less. Just connect the "power" rail of the device to the microphone input positive terminal with an RC filter and put a capacitor between the device's output and the microphone input terminal. Choose the resistor's resistance so that the voltage drop is acceptable to you and the capacitor so that the RC is about 5 times longer then 1/f, where f is the lowest frequency present in the signal.

If you need to attenuate your signal, connect a resistor in series with the capacitor between the device's output and the microphone input. Treat it as a resistive divider where the "upper" resistance is this resistor and the "lower" is the input resistance of the microphone amplifier and your RC-filter's resistor connected in parallel.