There is JS API for AnkiDroid and I created addon for supporting unofficial JS API.
How it will help in card template design?
Using JS API know about card is new, learn or review then show some fields of cards when card is new and hide when it is review or learn.
For e.g.
There are four fields in practicing hanzi writing by drawing strokes. (Simplified, Traditional, Pinyin, Meaning)
So, when cards are new then show simplified and traditional characters with outline hint. But when cards are review then hide those fields and hint.
On AnkiDroid using JS API
AnkiDroidJS.ankiGetCardType()
On AnkiDesktop using unofficial JS API.
pycmd("AnkiJS.ankiGetCardType()", (ret) => {
console.log(ret);
});