Android development reads missing lines in TXT files

Updated on technology 2024-05-25
9 answers
  1. Anonymous users2024-02-11

    if ( ==null){

    break;

    You did it twice, but only the first read was saved by you.

    The result that comes out according to your ** should be 123789null, if you want to get the desired result, you can modify ** as follows:

    string str= null;

    while (null != (str =;

  2. Anonymous users2024-02-10

    Here's the problem.

    When you call , you will read a line in the file, and you have called it once in if, and this call you have not existed in the string, so the reading result will miss a line.

    while (true){

    string tempstr = ;

    if (tempstr ==null){

    break;;

  3. Anonymous users2024-02-09

    First you need to get an IO stream, then read each row with the scanner object, use while to control the loop body, and then save it in the arraylist as you read. Got it?

  4. Anonymous users2024-02-08

    Specify the number of words displayed on each line, set the number of lines displayed, so that you can fix the number of words displayed on the current page, and then read the file, when you read so many words, save it with str, pos record the position of the current read, display str on the page, and then through the screen event, take down a paragraph with so many words,,, and so on.

  5. Anonymous users2024-02-07

    How many rows you plan to use as a page, according to the txt content you get, store them one by one according to the specified number of rows into an arraylist, and if you want to display them in pagination, you can use viewpager, viewflow, and even gallery to adapt these data, as long as one textview per page. This feature is easy to implement. If you don't understand, just send a private message.

  6. Anonymous users2024-02-06

    The method is correct, missing a path to the SD card, this reads the file in memory, and then specifies the path of the SD card Chinese.

  7. Anonymous users2024-02-05

    I want to read a book.

    First of all, file operation, have you applied for permission?

  8. Anonymous users2024-02-04

    Is your memory read and write permission enabled?

  9. Anonymous users2024-02-03

    The documentation here implements the response to an external action event.

Related questions
7 answers2024-05-25

The reading is correct, but the display of MATLAB only shows four decimal places, you can see the exact value by copying the data read into the workspace in MATLAB into XLS.

4 answers2024-05-25

using system;

using ; >>>More

13 answers2024-05-25

Curl is a well-known open-source file transfer protocol implementation software, which includes the implementation of many common and uncommon protocols such as HTTP, HTTPS, FTP, etc. In the latest version of curl, the official source ** actually includes the android build file (, but there is still some work to be done to compile it. The curl version I'm using is 7

21 answers2024-05-25

Loop reads. cstring str, strcnt, strtemp;

int num= 0; >>>More

5 answers2024-05-25

It depends on whether you are from the perspective of an insider or an outsider, if you are a practitioner, you look at it this way, then you don't know the circle, if you are just an outsider, it is recommended that you are not too optimistic, you can go to the major app markets to see, what appstore, Amazon's appstore, google play You just look at the ranking, the most is the first two hundred applications are considered to be on fire, But if you look at how many applications there are in the entire application market, hey, they are all developed by people, and there are so many that can really be popular, and others, hehe, it is difficult to support yourself, most of them rely on channels, what is a channel, you have to spend money on advertising first, or you are a big company, a big enough company, otherwise, pay money honestly, advertise, don't believe what technology is good enough, the application is dazzling enough, this, just after the success of the people fool you, you have to understand, for an application, the most important thing is that there are enough users, Everything else is non-essential and can make a difference when the application is upgraded. I'm also doing mobile development, sorry for making a fuss under your question. What mobile development doesn't know can hi me, I've always been **.