Giter Club home page Giter Club logo

Comments (14)

ramtinak avatar ramtinak commented on September 4, 2024

I test this method in a loop, but it's ok for me:

for (int i = 0; i < 50; i++)
{
    var device = AndroidDeviceGenerator.GetRandomAndroidDevice();
    Debug.WriteLine($"{device.HardwareManufacturer} - {device.HardwareModel}\t\t\t\t|\t{device.AndroidVersion.VersionNumber}\t|\t{device.AndroidVersion.APILevel}");
}

Output:

LGE - Nexus 4				|	5.0	|	21
asus - Nexus 7				|	7.0	|	24
Huawei - Nexus 6P			|	9.0	|	27
Sony - SO-02G				|	4.2	|	17
LGE - Nexus 5X				|	9.0	|	27
samsung - SM-T705			|	8.1	|	27
Sony - E6653				|	7.0	|	24
samsung - SM-N915W8			|	8.0	|	26
samsung - SM-G935T			|	4.4	|	19
Sony - E6653				|	7.0	|	24
samsung - SM-G935T			|	4.4	|	19
LGE - Nexus 4				|	5.0	|	21
samsung - SM-N915W8			|	8.0	|	26
LGE - Nexus 5				|	7.1	|	25
asus - Nexus 7				|	7.0	|	24
LGE - LG-LS970				|	9.0	|	27
asus - Nexus 7				|	4.0.3	|	15
samsung - SM-N900P			|	4.2	|	17
LGE - LG-LS970				|	9.0	|	27
samsung - SM-N900P			|	4.2	|	17
LGE - LG-LS970				|	9.0	|	27
asus - Nexus 7				|	4.0.3	|	15
samsung - SM-N915W8			|	8.0	|	26
LGE - Nexus 5X				|	9.0	|	27
LGE - LG-D500				|	4.1	|	16
HTC - HTC 10				|	4.3	|	18
asus - Nexus 7				|	7.0	|	24
Sony - E6653				|	7.0	|	24
HUAWEI - hi6250				|	4.3	|	18
asus - Nexus 7				|	4.0.3	|	15
samsung - SM-T705			|	8.1	|	27
LGE - LG-LS970				|	9.0	|	27
samsung - SM-N900P			|	4.2	|	17
LGE - Nexus 5X				|	9.0	|	27
HUAWEI - hi6250				|	4.3	|	18
LGE - LG-D500				|	4.1	|	16
LGE - LG-LS970				|	9.0	|	27
samsung - SM-T310			|	7.0	|	24
Huawei - Nexus 6P			|	9.0	|	27
HTC - HTC 10				|	4.3	|	18
LGE - Nexus 4				|	5.0	|	21
LGE - LG-LS970				|	9.0	|	27
Sony - SO-02G				|	4.2	|	17
samsung - samsungexynos7420		|	8.0	|	26
samsung - SM-G900F			|	4.2	|	17
LGE - Nexus 4				|	5.0	|	21
samsung - SM-G900F			|	4.2	|	17
LGE - LG-D500				|	4.1	|	16
LGE - Nexus 5				|	7.1	|	25
LGE - Nexus 5X				|	9.0	|	27

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

i tested the code its beginning to end with other methods together. This is a web app. Page reload every 3 seconds and get user media list. And i got this result. Please watch the video.

https://www.youtube.com/watch?v=Vz5UzZlZLGA

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

i fixed bug like this:

in AndroidVersion.cs change like that:
private static AndroidVersion LastAndriodVersion;
to
private static AndroidVersion LastAndriodVersion = AndroidVersions[AndroidVersions.Count - 1];

return LastAndriodVersion = androidVersion;
to
return androidVersion;

in AndroidDevice.cs change like that:
public AndroidVersion AndroidVersion { get; set; } = AndroidVersion.GetRandomAndriodVersion();
to
public AndroidVersion AndroidVersionx { get; set; } = AndroidVersion.GetRandomAndriodVersion();
(this name replaced everywhere used)

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

Please send a pull request for your fix

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

Sorry but it dont know how can i do it :( you must do this changes and update project.

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

Added bfd5253 .
wait for v1.1.0.3

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

Find a bug while loading session.
Please don't use new version.
Can you do one thing? Only change this part of old commit:
return LastAndriodVersion = androidVersion
to
return androidVersion

Without changing AndroidVersion to AndroidVersionx!
And try it. Let me know.

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

i tried this. But not worked correctly. Because it is always overwrite to old list. So method is becoming to endless loop.
When change;

public AndroidVersion AndroidVersion { get; set; } = AndroidVersion.GetRandomAndriodVersion();
to
public AndroidVersion AndroidVer { get; set; } = AndroidVersion.GetRandomAndriodVersion();

and

return LastAndriodVersion = androidVersion;
to
return androidVersion;

and

private static AndroidVersion LastAndriodVersion;
to
private static AndroidVersion LastAndriodVersion = AndroidVersions[AndroidVersions.Count - 1];

it is working perfectly.

Note: if you change only
return LastAndriodVersion = androidVersion;
to
return androidVersion;

You must change this line
private static AndroidVersion LastAndriodVersion;
to
private static AndroidVersion LastAndriodVersion = AndroidVersions[AndroidVersions.Count - 1];

because LastAndriodVersion is always default value = null.
And if you change only this line, always is happening endless loop

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

Please try this one:
Change:

return LastAndriodVersion = androidVersion;

to

LastAndriodVersion = androidVersion;
return androidVersion;

then test it.

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

No. it is same. Overwrite to list!

test12

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

OK, I will changed to AndroidVer but you need to login again,
If you didn't new login, every time you load your old account session, android device will change.
Because it saved as AndroidVersion not AndroidVer.

wait for v1.1.0.5

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

Ok. Thank you.

from instagramapisharp.

ramtinak avatar ramtinak commented on September 4, 2024

Added 3cdcb2f .

from instagramapisharp.

aspmaker avatar aspmaker commented on September 4, 2024

@ramtinak why i don't know but this problem continue again :( when using static class it is always overwrite itself. so i did something like that. Create a new class for AndroidVersion in Classess > Android > DeviceInfo > AndroidVersionClass.cs and change something in AndroidVersion.cs & AndroidDevice.cs. i hope this is help for that. i tested it is working.

DeviceInfo.zip

from instagramapisharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.