Android Question stdviewpager (I am trying to update an old app I wrote)

Marc De Loose

Member
Licensed User
Longtime User
I think we are not able to and even can't Use stdviewpager anymore.

I just dont know what to use instead of these lines. Its been a while since I coded for android.

B4X:
Private vp As StdViewPager

For Each v As View In vp.Panels(Nmbr-1).GetAllViewsRecursive

vp.Initialize("vp", Ettape_Size-1, 100%x, height)

Activity.AddView(vp.AsView, 0, 0, 100%x, height)

vp.Panels(i-1).LoadLayout("page1.bal")

vp.AsView.left = Activity.Width / 2 - vp.panels(0).Width / 2

vp.AsView.top = Activity.height / 2 - vp.panels(0).height / 2

vp.ScrollTo(params.LastKnown-1,False)

Sub VP_PageSelected (Position As Int)

vp.ScrollTo(params.LastKnown-1,False)

vp.ScrollTo(params.LastKnown-1,False)
 

Attachments

  • ontheroadv0_1.zip
    12.3 KB · Views: 19

MicroDrie

Well-Known Member
Licensed User
Longtime User
Quickly looking at the source code and reading the Dutch text, I get the idea that you are actually filling in a kind of Excel spreadsheet. You have already wrote by yourself say that you have not programmed for a while. I get the impression that beside new functionality like B4X] B4XPages - Cross platform and simple framework for managing multiple pages, you also missed XLUtils / jPOI 5 - Read and write MS Excel workbooks. The advice is to first develop and test your program in B4J with B4XPages on the PC. If that works well, then link the program source with the B4A environment and copy your layout between B4J and B4A. You can also do that to the iPhone, but I have no experience with that. I have no experience with what stdviewpager does, but I suspect that you would be better off first delving into an XLUtils / jPOI 5 - Read and write MS Excel workbooks example and then transferring your old program components to it.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
If you first develop a program in B4J with as many B4X components as possible, the difference between B4J and B4A is minimal. Once tested for correct operation in B4J and then transferred to B4A, you will see how to add very little B4A specific code in #IF B4A - #END IF code block and in B4A "wrong" B4J code to be shielded in an #IF B4J #END IF code block.
then you are probably not there yet because there are much stricter restrictions added in Android and routines in Android have disappeared, causing older libraries to no longer work or to be made to work. All the more reason to choose B4XPages and JPoi solution.
 
Upvote 0
Top