0

I want to use the entire text from a .srt file for an android app.

One way of doing this was to:-

  1. open the file in an app downloaded from the play store called "Subtitle Editor" and save it as a .txt file.

2.Open this .txt file in "Polaris Viewer 4.1".

3.Select text by double-tapping the screen and then adjusting the selectors.

But in this manner, I was allowed to select only a maximum of one page at a time due to a limit on clipboard/Polaris Viewer capacity.

Thus, in order to select the entire text from a .srt file which is atleast 10 pages, I need to repeat this process for each of the 10 pages.

Hence, this is very cumbersome.

Is there any other workaround/solution by which I might be able to do this..??

The solution can be both programmatical or use a software to do so... Thanks.

Naman Sancheti
  • 414
  • 1
  • 8
  • 18
  • 1) did you try to just open the file and read it? 2) `EditText` has the method `selectAll()` (and I remember I saw a menu item like this in at least one text editor), but I think you should just open the file programmatically. – 18446744073709551615 Jul 01 '14 at 12:14
  • After having selected the text, you would copy/paste it. You did not tell where you would paste it to. If you want to use the complete 'text' in your android app then just load the .txt file in your app. – greenapps Jul 01 '14 at 18:49
  • @18446744073709551615 1) I did do that using "Subtitle Editor" but it won't let me select the text. 2)But as far as I understand, selectAll() can only select the text present in a TextView but the issue is getting the required text from the .srt file to the TextView. – Naman Sancheti Jul 02 '14 at 15:04
  • @greenapps I would paste the text in a TextView in my app. Could u guide me as to how to load the .txt file in my app...?? – Naman Sancheti Jul 02 '14 at 15:08
  • If you just took the effort to search for "android load file in string". – greenapps Jul 02 '14 at 16:11
  • there's an Android app, ES File Manager. In the worst case (that is, if you will not just open the .srt in a editor) you will be able to rename .srt to .txt and then open it. – 18446744073709551615 Jul 03 '14 at 12:02
  • @18446744073709551615 I have already tried opening the file in the ES Note Editor present in ES File Manager/Explorer that I have installed but it doesn't let me select the text. Only thing it lets u do even in edit mode is paste some text. – Naman Sancheti Jul 04 '14 at 04:19
  • @greenapps I did as u advised and found the solution in another stackoverflow question.It works for the .srt file also.Here's the link:- http://stackoverflow.com/questions/12910503/read-file-as-string Thanks for guiding me as the keywords u gave led to me exactly what I was looking for since days. – Naman Sancheti Jul 04 '14 at 07:10
  • A srt file is a text file so yes this will work also. I wonder why you would cumbersome let an external app make a plain text file from it. Your app could load the srt file, parse it and remove some formatting tags when needed on the fly. – greenapps Jul 04 '14 at 07:14
  • `I want to use the entire text from a .srt file for an android app` Think that most people are not familiar with the srt file format. At least i was not. So some explanation would have been great. Because why would 'all text' not be 'the whole file'? You could have posted a piece of such a file. It is a text file with simple html tag formatting. All techniqes to extract content from html can be applied to a srt too. Jsoup is the way. Please post a piece of such a file. – greenapps Jul 04 '14 at 07:37
  • @greenapps Yes all text is indeed the whole file. Regarding posting such a file, if I may use your own words-"if you just took the effort to search for" 'download srt file', you would find millions of them. – – Naman Sancheti Jul 07 '14 at 06:57
  • Not funny at all user number so and so. You did not understand my hint. And show yourself less than thankful for received help. – greenapps Jul 07 '14 at 07:07
  • @greenapps Well, I had conveyed my thanks earlier too but if it was not then I thank you once again for giving the keywords which led me to the solution. – Naman Sancheti Jul 08 '14 at 14:50

0 Answers0