title: How to porting Paging 3 from Kotlin Flow to Java? - Unable to find PagingDataFlow.create function
body: <p>Paging 3 just released few days ago.</p>
  
  <p>Currently, we are porting the following Paging 3 example code, from Kotlin to Java.</p>
  
  <p><a href="https://github.com/android/architecture-components-samples/blob/a2151cf66483560f76b041ba95ce96e931c50caf/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseViewModel.kt" rel="nofollow noreferrer">https://github.com/android/architecture-components-samples/blob/a2151cf66483560f76b041ba95ce96e931c50caf/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseViewModel.kt</a></p>
  
  <h2>Kotlin</h2>
  
  <pre><code>/**
   * We use the Kotlin API to construct a [Flow]&lt;[PagingData]&gt;. Java developers should use the
   * Java API: `PagingDataFlow.create`
   */
  val allCheeses = Pager(
      PagingConfig(
          /**
           * A good page size is a value that fills at least a few screens worth of content on a
           * large device so the User is unlikely to see a null item.
           * You can play with this constant to observe the paging behavior.
           *
           * It's possible to vary this with list device size, but often unnecessary, unless a
           * user scrolling on a large device is expected to scroll through items more quickly
           * than a small device, such as when the large device uses a grid layout of items.
           */
          pageSize = 60,
  
          /**
           * If placeholders are enabled, PagedList will report the full size but some items might
           * be null in onBind method (PagedListAdapter triggers a rebind when data is loaded).
           *
           * If placeholders are disabled, onBind will never receive null but as more pages are
           * loaded, the scrollbars will jitter as new pages are loaded. You should probably
           * disable scrollbars if you disable placeholders.
           */
          enablePlaceholders = true,
  
          /**
           * Maximum number of items a PagedList should hold in memory at once.
           *
           * This number triggers the PagedList to start dropping distant pages as more are loaded.
           */
          maxSize = 200
      )
  ) {
      dao.allCheesesByName()
  }.flow
  </code></pre>
  
  <hr>
  
  <h2>Java</h2>
  
  <p>Constructing a <code>PagingConfig</code> isn't much issue.</p>
  
  <pre><code>final int pageSize = 60;
  final int prefetchDistance = pageSize;
  final boolean enablePlaceholders = false;
  final int initialLoadSize = pageSize * PagingConfig.DEFAULT_INITIAL_PAGE_MULTIPLIER;
  final int maxSize = PagingConfig.MAX_SIZE_UNBOUNDED;
  final int jumpThreshold = PagingSource.LoadResult.Page.COUNT_UNDEFINED;
  
  PagingConfig pagingConfig = new PagingConfig(
          pageSize,
          prefetchDistance,
          enablePlaceholders,
          initialLoadSize,
          maxSize,
          jumpThreshold
  );
  </code></pre>
  
  <p>But, we are stuck then.</p>
  
  <p>The following code comment draws our attention.</p>
  
  <blockquote>
    <p>Java developers should use the Java API: <code>PagingDataFlow.create</code></p>
  </blockquote>
  
  <p>According to code comment, Java developer should use <code>PagingDataFlow.create</code>. But, from IDE, we really can't find a class named <code>androidx.paging.PagingDataFlow</code>.</p>
  
  <p>We are expecting to have <code>LiveData</code> which we can observe. Kotlin's flow/ co-routine isn't something we are expecting in Java land.</p>
  
  <p>Any idea how we can use <code>PagingDataFlow.create</code>?</p>