i already inputted all the necessary parameters for it to work according to the docs and the forums but it just can't seem to work on me
private void joinMeeting(Context context, String meetingNumber,String zak, String userName, String usID){
int ret = -1;
MeetingService meetingService = ZoomSDK.getInstance().getMeetingService();
JoinMeetingOptions options = new JoinMeetingOptions();
//JoinMeetingParams params = new JoinMeetingParams();
//params.displayName=userName;
//params.meetingNo =meetingNumber;
//params.password=meetingPassword;
//meetingService.joinMeetingWithParams(context,params,options);
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
params.userId = usID; // Based on this id we are able to start the meeting as host
params.userType = MeetingService.USER_TYPE_API_USER;
params.displayName = userName;
params.zoomAccessToken = zak; //getting the zoom access token from start_url
params.meetingNo = meetingNumber; // meetingNo, getting this from create meeting api response
ret = meetingService.startMeetingWithParams(context,params,options);
Log.e("Start Meeting As Host", "===startMeetingWithNumber====ret=" + ret);
}
i tried all generating more meeting using my web sdk but it wont work either
Related
I have a application which useds TFS JAVA SDK 14.0.3 .
I have a shared query on my tfs , how can i run the shared query and get the response back using TFS SDK 14.0.3
Also I could see that the query url will expire in every 90 days , so any better way to execute the shared query?
Now I have a method to run a query , i want method to run shared query also.
public void getWorkItem(TFSTeamProjectCollection tpc, Project project){
WorkItemClient workItemClient = project.getWorkItemClient();
// Define the WIQL query.
String wiqlQuery = "Select ID, Title,Assigned from WorkItems where (State = 'Active') order by Title";
// Run the query and get the results.
WorkItemCollection workItems = workItemClient.query(wiqlQuery);
System.out.println("Found " + workItems.size() + " work items.");
System.out.println();
// Write out the heading.
System.out.println("ID\tTitle");
// Output the first 20 results of the query, allowing the TFS SDK to
// page
// in data as required
final int maxToPrint = 5;
for (int i = 0; i < workItems.size(); i++) {
if (i >= maxToPrint) {
System.out.println("[...]");
break;
}
WorkItem workItem = workItems.getWorkItem(i);
System.out.println(workItem.getID() + "\t" + workItem.getTitle());
}
}
Shared query is a query which has been run and saved, so what you need should be getting a a shared query, not run a shared query. You could refer to case Access TFS Team Query from Client Object API:
///Handles nested query folders
private static Guid FindQuery(QueryFolder folder, string queryName)
{
foreach (var item in folder)
{
if (item.Name.Equals(queryName, StringComparison.InvariantCultureIgnoreCase))
{
return item.Id;
}
var itemFolder = item as QueryFolder;
if (itemFolder != null)
{
var result = FindQuery(itemFolder, queryName);
if (!result.Equals(Guid.Empty))
{
return result;
}
}
}
return Guid.Empty;
}
static void Main(string[] args)
{
var collectionUri = new Uri("http://TFS/tfs/DefaultCollection");
var server = new TfsTeamProjectCollection(collectionUri);
var workItemStore = server.GetService<WorkItemStore>();
var teamProject = workItemStore.Projects["TeamProjectName"];
var x = teamProject.QueryHierarchy;
var queryId = FindQuery(x, "QueryNameHere");
var queryDefinition = workItemStore.GetQueryDefinition(queryId);
var variables = new Dictionary<string, string>() {{"project", "TeamProjectName"}};
var result = workItemStore.Query(queryDefinition.QueryText,variables);
}
By the way, you could also check the REST API in the following link:
https://learn.microsoft.com/en-us/rest/api/vsts/wit/queries/get
In my current Java/Spring project, I am in the phase of integration with PayPal. After configure a Java class to handle the payment process, following the instructions from here, I run my application and try to checkout an order with paypal.
I am redirected correctly to the PayPal login page, and after the login, to this payment review page:
but then after I click on "Continue", instead of finalizing the payment, I am redirected to my profile page.
Here is my code:
Paypal prop = this.paypalDao.get();
String clientId = prop.getClientID();
String clientSecret = prop.getClientSecret();
APIContext apiContext = new APIContext(clientId, clientSecret, "sandbox");
if(payerId != null) {
if(guid != null) {
Payment payment = new Payment();
payment.setId(map.get(guid));
PaymentExecution paymentExecution = new PaymentExecution();
paymentExecution.setPayerId(payerId);
payment.execute(apiContext, paymentExecution);
String url = request.getContextPath();
return url+"/orders";
}
} else {
List<Produto> lista_de_produtos = this.getListaDeProdutos(clienteId);
Double total = 0.0;
for(Produto produto : lista_de_produtos)
total = total + produto.getPreco();
DecimalFormat df = new DecimalFormat("0.00");
String svalue = df.format(total).replace(',', '.');
Details details = new Details();
details.setSubtotal(svalue);
Amount amount = new Amount();
amount.setCurrency("BRL");
amount.setTotal(svalue);
amount.setDetails(details);
Transaction transaction = new Transaction();
transaction.setAmount(amount);
transaction.setDescription(lista_de_produtos.toString());
List<Transaction> transactions = new ArrayList<Transaction>();
transactions.add(transaction);
Payer payer = new Payer();
payer.setPaymentMethod("paypal");
Payment payment = new Payment();
payment.setIntent("sale");
payment.setPayer(payer);
payment.setTransactions(transactions);
RedirectUrls redirectUrls = new RedirectUrls();
guid = UUID.randomUUID().toString();
String url = request.getContextPath();
redirectUrls.setCancelUrl( url+"/cart" );
redirectUrls.setReturnUrl( url+"/paypal/checkout/"+clientId+"/?guid=" + guid );
payment.setRedirectUrls(redirectUrls);
Payment createdPayment = payment.create(apiContext);
Iterator<Links> links = createdPayment.getLinks().iterator();
while (links.hasNext()) {
Links link = links.next();
if (link.getRel().equalsIgnoreCase("approval_url")) {
map.put("redirectURL", link.getHref());
redirectURL = link.getHref();
}
}
map.put(guid, createdPayment.getId());
payment.setId(map.get(guid));
}
return redirectURL;
Can someone tell me, what am I missing here?
Try printing this value:
System.out.println(url+"/paypal/checkout/"+clientId+"/?guid=" + guid);
The result should be https://www.yoursite.com/paypal/checkout/<number>/?guid=<number>, or a page that would direct there (leaving out https:// to save on bytes could be okay depending on your server configuration).
Additional tests you should try:
Try cancelling on your site.
Try cancelling the payment on paypal's site.
Iff one works but the second does not, then paypal is not redirecting properly, which probably means you're not giving it the right string. Also see comment by #Emile.
I want to iterate on an ArrayList called localWifiList that contains the wifi networks detected by a wifi scan.
For every element of the ArrayList I want to run a query to get all tuples in the database with that specific mac address, create a new object and add this object into a new arrayList called wifiFromDatabase.
I wrote this code:`
ArrayList<wifiList> wifiFromDatabase = new ArrayList<wifiList>();
ArrayList<wifiList> localWifiList = ScanService.wifiArraList;
//field to read the values of wifi query results
String mac;
String ssid;
String cid;
String signalLevel;
String capabilities;
String rssi;
String lat, lng;
String date;
String frequency;
int flagInt;
Cursor cursor;
Iterator<wifiList> iterator = localWifiList.iterator();
while(iterator.hasNext()){
wifiList element = (wifiList) iterator.next();
cursor = MainActivity.getDBOperationHelper().getWifiTupleByMac
(MainActivity.getDBOperationHelper().getReadableDatabase(), element.getMacAddress());
if(cursor.getCount()>0){
if (cursor .moveToFirst()) {
while (cursor.isAfterLast() == false) {
mac = cursor.getString(cursor.getColumnIndex(DBOperationHelper.MAC));//
ssid = cursor.getString(cursor.getColumnIndex(DBOperationHelper.SSID));//
capabilities = cursor.getString(cursor.getColumnIndex(DBOperationHelper.CAPABILITIES));//
frequency = cursor.getString(cursor.getColumnIndex(DBOperationHelper.FREQUENCY));//
cid = cursor.getString(cursor.getColumnIndex(DBOperationHelper.CELL_ID_UMTS));//
signalLevel = cursor.getString(cursor.getColumnIndex(DBOperationHelper.SIGNAL_LEVEL_WIFI));//
rssi = cursor.getString(cursor.getColumnIndex(DBOperationHelper.RSSI));
lat = cursor.getString(cursor.getColumnIndex(DBOperationHelper.GPS_LATITUDE_WIFI));//
lng = cursor.getString(cursor.getColumnIndex(DBOperationHelper.GPS_LONGITUDE_WIFI));//
date = cursor.getString(cursor.getColumnIndex(DBOperationHelper.DATE_WIFI));//
flagInt = cursor.getInt(cursor.getColumnIndex(DBOperationHelper.FLAG));
wifiList objectFromDb = WifiPhoneConfiguredNetworkHandler.CreateProperlyWifiListObject(ssid, capabilities, frequency, signalLevel, ConnectionPointAnalyzer.INVALID_ID_WIFI, signalLevel,
mac, rssi, date, cid, lat, lng, flagInt, false);
wifiFromDatabase.add(objectFromDb);
cursor.moveToNext();
}
}
}else{ //the database has not tuples with this mac
Log.d(ConnectionPointAnalyzer.LOG_TAG, "OracoloBrain.java/AllInterfacesActived: no tuples found in the db with mac = "+element.getMacAddress()+
" ssid = "+element.getSsid());
}
} `
where the method CreateProperlyWifiListObject create an wifiList object given the fields passed as arguments.
I read many thread about this issues, but nothing to do. I try also with synchronized on the arrayList.
The exception is thrown by iterator.next() command.
Try to create a copy:
ArrayList<wifiList> localWifiList = new ArrayList<wifiList>(ScanService.wifiArraList);
Best
Goal :
Receiving geographic data(coordinates), time-stamps... . "From pictures taken in Vienna."
My question:
How can i do this in Java? (using flickrapi-1.2.jar)
What did i already found out? :
Give me the 500 most recent pictures - url's ... :s
public static void main(String[] args) throws FlickrException, IOException,
SAXException {
String apiKey = "123456789abcdefghijklmnopqrstvwuxz";
Flickr f = new Flickr(apiKey);
PhotosInterface photosInterface = f.getPhotosInterface();
Collection photosCollection = null;
photosCollection = photosInterface.getRecent(500, 0);
int i = 0;
Photo photo = null;
Iterator photoIterator = photosCollection.iterator();
while (photoIterator.hasNext()) {
i++;
photo = (Photo) photoIterator.next();
System.out.println(i + " - Description: " + photo.getSmallUrl());
}
}
Option : Good Examples or a decent manual is welkom, because i don't know exactly how this API works...
Kind regards
You need to call the flickr.photos.search API method.
With Flickr4Java it would look like this:
String apikey;
String secret;
// Create a Flickr instance with your data. No need to authenticate
Flickr flickr = new Flickr(apikey, secret, new REST());
// Set the wanted search parameters (I'm not using real variables in the example)
SearchParameters searchParameters = new SearchParameters();
searchParameters.setAccuracy(accuracyLevel);
searchParameters.setBBox(minimum_longitude,
minimum_latitude,
maximum_longitude,
maximum_latitude);
PhotoList<Photo> list = flickr.getPhotosInterface().search(searchParameters, 0, 0);
// Do something with the list
I'm using the code
byte[] mac = ni.getHardwareAddress();
for (int i = 0; i < mac.length; i++) {
System.out.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "");
to output: 00-27-0E-C2-53-B7
I need this output to be stored in a variable and I need a query to save it to a MySQL database. I also want to fetch MAC addresses automatically on my login page along with user details.
That way, I can store users' MAC addresses along with their usernames and passwords in the database. The idea is that, when a user logs in, I want to be able to fetch the MAC address automatically to authenticate the user.
How can I do this?
You are asking a lot of questions.
Your mac address is already stored in variable. Array mac[] is a array variable. If you need separate variable just define it like the following:
String myMac = mac[i];
Saving data in DB. I believe that you are already using DB. If for exampel you are using plain JDBC construct insert or update SQL statement like this:
insert into UserData ('mac') VAULUES (?) where user_id=?
Obviously the concrete fields depend on your DB schema.
If you are using some ORM system ask more specific question about this ORM. But in most cases this will be even simpler. If for example you already have class User:
class User {
private String username;
private String password;
// etc
}
...just add the new field mac there:
class User {
private String username;
private String password;
private String mac;
// etc
}
If you are using JPA your DB schema will be updated automatically and the data will be saved there too.
The same is about login page. If you already have login page that shows for example user ID, add similar code for MAC
etc, etc....
The zen of Python says "simple is better than complex."
This code is from SO user Carles Barrobes:
public String obtainMacAddress() throws Exception
{
Process aProc = Runtime.getRuntime().exec("ipconfig /all");
InputStream procOut = new DataInputStream(aProc.getInputStream());
BufferedReader br = new BufferedReader(new InputStreamReader(procOut));
String aMacAddress = "((\\p{XDigit}\\p{XDigit}-){5}\\p{XDigit}\\p{XDigit})";
Pattern aPatternMac = Pattern.compile(aMacAddress);
String aIpAddress = ".*IP.*: (([0-9]*\\.){3}[0-9]).*$";
Pattern aPatternIp = Pattern.compile(aIpAddress);
String aNewAdaptor = "[A-Z].*$";
Pattern aPatternNewAdaptor = Pattern.compile(aNewAdaptor);
// locate first MAC address that has IP address
boolean zFoundMac = false;
boolean zFoundIp = false;
String foundMac = null;
String theGoodMac = null;
String strLine;
while (((strLine = br.readLine()) != null) && !(zFoundIp && zFoundMac)) {
Matcher aMatcherNewAdaptor = aPatternNewAdaptor.matcher(strLine);
if (aMatcherNewAdaptor.matches()) {
zFoundMac = zFoundIp = false;
}
Matcher aMatcherMac = aPatternMac.matcher(strLine);
if (aMatcherMac.find()) {
foundMac = aMatcherMac.group(0);
zFoundMac = true;
}
Matcher aMatcherIp = aPatternIp.matcher(strLine);
if (aMatcherIp.matches()) {
zFoundIp = true;
if(zFoundMac && (theGoodMac == null)) theGoodMac = foundMac;
}
}
aProc.destroy();
aProc.waitFor();
return theGoodMac;}
Note that it is necessary to have an ethernet or wifi connection to run the above.