Just because he texts you doesn't mean that he likes you. I have a male friend so sends me flirty texts all the time. he likes it because then he gets flirty texts back and it makes him feel good about himself. Whenever he is between girlfriends/ love interests whatever or drunk I get a text, its not to make me feel good its to make him feel good its like a game, he doesn't fancy me enough to ask me out because if he did he would have done so by now, its just convenient. I play along cos it makes me feel good too. We've been on dates "as friends" of course, meals drinks etc but nothing is ever going to come of it, oh apart from a quick shag if I fancied it which I don't am wary of casual things.
If anything was going to happen with you two and he was going to treat you right it would have happened by now, ok. You are just a convenience to him that makes him feel good about himself. Its harsh but true.