I have created one group using the Group module, then I added some members in that group. Now I want to get list of all members in the group from some custom code.
How do I get the list of all group members?
You can build a view using the Views UI, then export the view, and integrate that exported View in your custom code.
For the actual view, you should create a view of "Group Memberships", and optionally add a filter by Group ID (=
For an example of such view, refer to my answer to "How to add a column to the list of group members or create a Views equivalent of it?", which includes a view (in export format), which should be pretty close to what you're asking for.
Use the Group module API.